WebExtension Internationalization placeholders


(Rob Garrison) #1

Our _locales/en/messages.json source file includes lots of placeholders entries. We use Transifex services to translate this file, but these entries are always stripped out of our downloaded language files.

I’ve search both the chrome docs & MDN docs, but no where does it explicitly mention that the placeholders entries are required to be included in the non-source language files. I did learn of an npm module named webext-tx-fix which copies the placeholders entries over from the source file. I also found placeholders entries included in the notify-link-clicks-i18n webextension example. This leads me to assume that the entries are required in all language files. This fact is missing from the documentation.

Alternatively, when a language file is missing a specific translation, it falls back to the source translation. I think it would make sense to also do this with the placeholder entries. This change would reduce development time and the extension size.

(Martin Giger) #2

Transifex just released a new parser for the messages.json. If you re-upload your resources again you should get the new parser that keeps the placeholders around.

(Rob Garrison) #3

Thanks, I’ll check that out!

I still think this needs to be documented and maybe include a fallback.