By default, the L20n uses browser language settings to determine which language to display to the user. I assume that your browser has "en" or "en-US" in the language setting somewhere. You can view your settings by opening the developer console (Ctrl + Shift + K in Firefox, Ctrl + Shift + J in Chrome) and typing navigator.language or (in new versions of Firefox) navigator.languages .
In Firefox, you can change your language preferences by going to about:preferences#content and clicking "Select" in the "Languages" section. In Chrome, the settings have a similar panel, but in fact it does not change the navigator.language property, which is a known bug , you will need to download and install the French version of Chrome if you want to test this way.
An alternative is to use the L20n API and explicitly change the language with:
document.l10n.requestLanguages(['fr']);
This is useful if you want to provide part of the user interface so that your users change the language of the application. For example, you might have a drop-down menu with all the languages you support that calls document.l10n.requestLanguages when you select a new option.
source share