Skip to content

Conversation

muffinresearch
Copy link
Contributor

@muffinresearch muffinresearch commented Jun 30, 2016

Fixes mozilla/addons#9685

  • Makes DISABLED and ENABLED first-class states rather than being aliased.
  • ENABLED shares the same styles as installed.
  • Use the new browser API to enable an addon when it's been disabled
  • Fallback to quietly logging an error (where logging is enabled e.g. -dev) if addon.setEnable is not present - this means landing this will work before and after the API is available.

icon: iconUrl,
title: i18n.gettext('Your add-on is ready'),
text: i18n.sprintf(
i18n.gettext('Now you can access %(name)s from the toolbar.'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This "s" in %(name)s is intentional, right? It seems off but maybe I don't get what name will be set to...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking through it seems not. 🤔

Copy link
Contributor Author

@muffinresearch muffinresearch Jun 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's sprintf format [1] - we're using sprintf via jed [2] for localization substitutions. The 2nd arg is on the line below.

[1] http://www.diveintojavascript.com/projects/javascript-sprintf
[2] https://slexaxton.github.io/Jed/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooooohhhh okay yeah I should've realised.

Cool, all good, then. My r+wc is now just an r+ 😄

@tofumatt
Copy link
Contributor

r+wc

Code looks good and everything, just not sure about the contents of that string 😄

@muffinresearch muffinresearch merged commit 4e63706 into mozilla:master Jun 30, 2016
@muffinresearch muffinresearch deleted the enable-disabled-addons branch June 30, 2016 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle enabled/disabled add-ons

2 participants