Unpackaged Internationalization

As far as I understand, all translations are packaged into an extension no matter what?

Wouldn’t this mean the more languages one supports and the more one has to translate, the more useless data is packaged and downloaded by users?

Before this my first thought was to simply package different versions with different languages, since this doesn’t require much work to add into my bundler and the user wouldn’t see more than a simple language selection before the download.

Considering that most users don’t regularly switch between languages I saw this as a reasonable approach, however this wouldn’t work with Mozillas addon distribution I’m guessing or is there a way to provide different version / flavors?

Another approach I was considering is to fetch translations with every install / addon update and to either ship minimal English / full English translations by default.

Yes, that is correct.

How big of a project (in terms of localization) are we talking about? Unless the extension is very large, the size of the translations in the final .xpi is usually rather insignificant, especially since it’s only downloaded at install and update of the extension.

The extension I’m developing is only just starting out, so there isn’t anything to speak of yet, which is precisely why I wanted to make sure to take the most fitting approach right from the get-go.

In that case, I’d start by having the translations inside the extension in _locales folder (more instructions in the documentation).

It’s the best and easiest way to do it: allows you to keep one codebase and there’s no need to manage/build/publish separate versions and it’s easier for the users as they only need to find one extension to install.

If it becomes a problem due to a massive size, then it may be worth looking into other solutions but I don’t know of any existing extensions that have needed more complex solutions.

Guess I’ll go with that then, thanks.

On a sidenote,

allows you to keep one codebase

won’t be the case anyways, well at least the translations
will be in a separate repository and automatically bundled.

:smile: