Use xx-XX format for translation files and default to en-US

Many languages have different variants, so instead of "en" we should be
using "en-US" - this will make it possible to add slightly different
British English translations, for example.
Note that this was already supported for the `locale` config option, we
were simply discarding the part after the dash when looking for the
right translation file.

Also make sure the en-US translations are actually American English,
I'll add en-GB separately.
This commit is contained in:
Linus Groh
2021-02-14 13:21:54 +01:00
parent a9026c7a0a
commit b29cd12ed9
8 changed files with 12 additions and 11 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ const DEFAULT_CONFIG = {
minAccuracy: null,
},
ignorePingLocation: true,
locale: "en",
locale: "en-US",
map: {
attribution:
'&copy; <a href="https://osm.org/copyright">OpenStreetMap</a> contributors',
+2 -2
View File
@@ -16,8 +16,8 @@ locales.keys().forEach((key) => {
});
export default new VueI18n({
locale: config.locale.split("-")[0],
fallbackLocale: "en",
locale: config.locale,
fallbackLocale: "en-US",
formatFallbackMessages: true,
messages,
});
@@ -10,7 +10,7 @@
"Select user": "Select user",
"Show all": "Show all",
"Select device": "Select device",
"Distance travelled": "Distance travelled",
"Distance travelled": "Distance traveled",
"Download raw data": "Download raw data",
"Information": "Information",
"Show last known locations": "Show last known locations",