STAC Browser can be translated into other languages and can localize number formats, date formats etc.
You need to change the locale and supportedLocales settings to select the default language and the languages available to users.
The following languages are currently supported:
- Arabic
ar - German
de(Germanyde, Switzerlandde-CH) - Spanish
es - English
en(Internationalen, USen-US, UKen-GB) - French
fr(Canadafr-CA, Francefr, Switzerlandfr-CH) - Indonesian
id - Italian
it(Italyit, Switzerlandit-CH) - Romanian
ro - Japanese
ja - Portuguese
pt(Brazilpt-BR, Portugalpt) - Polish
pl - Swedish
sv - Russian
ru
We manage the translations in Crowdin, please see https://crowdin.com/project/stac-browser/ for details.
To add your own language, please follow the guide below: Adding a new language
The following contributors kindly provide the translations:
- @jfbourgon:
fr,fr-CA - @jtreska:
pl - @amrirasyidi:
id - @mneagul:
ro - @m-mohr:
de,en,en-GB,en-US - @p1d1d1:
de-CH,fr-CH,it,it-CH - @psacra:
pt - @randa-11295:
ar - @rnanclares:
es - @uba:
pt-BR - @lovisasandgren:
sv - @gtitov:
ru
You can translate STAC Browser into other languages. You can also use one of the existing languages and provide an alternate version for a specifc country, e.g. a Australian English (en-AU) version of the US-English language pack (en).
Important
Persons contributing languages are expected to maintain them long-term! If you are not able to maintain the language pack, please indicate so in the PR.
The following guide helps you to get started:
- Copy the
enfolder (or any other language without a country code that you want to base the translation on).- Note: If you start with the
enfolder, you have to remove the leading//from the line// { fields: require('./fields.json') }in the filedefault.js.
- Note: If you start with the
- Name the new folder according to RFC5646.
- Add the language to the list of supported locales (
supportedLocales) in theconfig.jsfile. - Add the language to the list of languages in this file.
- Translate the
.jsonfiles, most importantlyconfig.json,fields.jsonandtexts.json.- Please note that you never need to translate any object keys!
- If you base your language on another existing language (e.g. create
en-INbased onen) you can delete individual files and import existing files from other languages indefault.js.
- Adapt the
datepicker.js,duration.jsandvalidation.jsfiles to import the existing definitions from their corresponding external packages, but you could also define the specifics yourself. Ensure the imported files actually exist in the packages. - Check that your translation works by running the development server (
npm start) and navigating to the STAC Browser instance in your browser (usuallyhttp://localhost:8080). - Once completed, please open a pull request and we'll get back to you as soon as possible.
- After merging the PR for the first time, we'll add you to our translation management tool Crowdin: https://crowdin.com/project/stac-browser/. Please get in touch to get your invite!
You can define custom phrases in the custom.json.
This is especially useful for phrases that are coming from non-standadized metadata fields (see the chapter "Additional metadata fields").
If you've found metadata labels (e.g. "Price" and "Generation Time") that are not translated,
you can add it to the custom.json. For metadata fields you need to add it to a the object fields
as it is the group for the metadata-related phrases.
There you can add as many phrases as you like. For example:
{
"fields": {
"Price": "Preis",
"Generation Time": "Generierungszeit"
}
}