Skip to content

Commit

Permalink
fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
hohMiyazawa committed Nov 17, 2021
1 parent 4f114ca commit f06d432
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/localisation.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const languageFiles = {
"Svenska": m4_include(data/languages/Swedish.json),
"English (US)": m4_include(data/languages/English_US.json)
}
function translate(key,subs){
function translate(key,subs,fallback){
if(key[0] !== "$"){
return key
}
Expand All @@ -24,6 +24,9 @@ function translate(key,subs){
if(!immediate){
immediate = languageFiles["English"].keys[key];
if(!immediate){
if(fallback){
return fallback
}
if(key.substring(0,6) !== "$role_"){
console.warn("[Automail localisation] missing key!",key)
}
Expand Down

0 comments on commit f06d432

Please sign in to comment.