Skip to content

Conversation

willdurand
Copy link
Member

@willdurand willdurand requested a review from tofumatt August 21, 2017 19:58
Copy link
Contributor

@tofumatt tofumatt left a comment

Choose a reason for hiding this comment

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

This looks good, but while you're at it could you use this helper in the places we're already translating the entire string to include the addonType? I think it's largely just in the "leave a review" section of the add-on detail page.

oneLineTranslationString(pluralKey), val);
};

// Because the `addonType` we use internally is not translated, we needs this
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick editorialising, but this could be:

// The `addonType` we use internally is not translated, so we use this
// helper to return translated add-on type names.

expect(i18n.addonType(ADDON_TYPE_LANG)).toEqual('language pack');
expect(i18n.addonType(ADDON_TYPE_OPENSEARCH)).toEqual('search plugin');
expect(i18n.addonType(ADDON_TYPE_THEME)).toEqual('theme');
// this one seems deprecated
Copy link
Contributor

Choose a reason for hiding this comment

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

It is but it will still appear for older (ESR) clients I think? I would include it as "theme" as well.

return i18n.gettext('language pack');
case ADDON_TYPE_OPENSEARCH:
return i18n.gettext('search plugin');
case ADDON_TYPE_THEME:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can just add case ADDON_TYPE_COMPLETE_THEME: here; as long as we "support" it we should return a value.

@kumar303
Copy link
Contributor

This is my first time seeing mozilla/addons#10681 . I don't think it's safe to replace %(addonsType)s in localizable strings because it's hard to anticipate all the grammatical fluctuations. For example, some languages may use different conjugations of the word language pack depending on the context of the sentence. The rules for pluralization can also vary between language.

@tofumatt
Copy link
Contributor

As mentioned on IRC we actually shouldn't do this, as advised by localisers. There are too many edge-cases we can't anticipate. Sorry about that @willdurand 😢

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.

addonType is not translated; create a helper for this
3 participants