1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Added Basque translation, fixed issue with handling invalid translations. Updated translation FR.

This commit is contained in:
Laurent Cozic
2018-02-10 12:43:45 +00:00
parent ce2da0e6dc
commit 89a5ccdf93
45 changed files with 1857 additions and 230 deletions

View File

@ -256,7 +256,7 @@ function countryDisplayName(canonicalName) {
let extraString;
if (countryCode != "") {
if (countryCode) {
if (languageCode == "zh" && countryCode == "CN") {
extraString = "简体"; // "Simplified" in "Simplified Chinese"
} else {
@ -266,7 +266,7 @@ function countryDisplayName(canonicalName) {
if (languageCode == "zh" && (countryCode == "" || countryCode == "TW")) extraString = "繁體"; // "Traditional" in "Traditional Chinese"
if (extraString != "") output += " (" + extraString + ")";
if (extraString) output += " (" + extraString + ")";
return output;
}
@ -294,7 +294,11 @@ function _(s, ...args) {
let strings = localeStrings(currentLocale_);
let result = strings[s];
if (result === '' || result === undefined) result = s;
return sprintf(result, ...args);
try {
return sprintf(result, ...args);
} catch (error) {
return result + ' ' + args.join(', ') + ' (Translation error: ' + error.message + ')';
}
}
module.exports = { _, supportedLocales, countryDisplayName, localeStrings, setLocale, supportedLocalesToLanguages, defaultLocale, closestSupportedLocale, languageCode, countryCodeOnly };