Skip to content

Localization

Stefan Wajda edited this page Aug 22, 2022 · 1 revision

You may want to add some new content, needing texts, or to add support for a whole language. If so, there's two steps to go.

Localize text

When adding any UI element in webextension's popup, you have to localize it. This is very, very simple: just put the localizeMe class to your HTML element and ensure it has an ID, and you're done!

Translate text

There's a locales.js file in the scripts folder that handle every strings. For each string, you'll need to provide the targetted HTML element's ID as key, and webextension's popup will load your localized strings when needed.

Clone this wiki locally