mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-21 15:26:17 -04:00
add default values to Localization.getTranslation function
This commit is contained in:
parent
d689fe28e5
commit
02911804cb
2 changed files with 3 additions and 3 deletions
|
@ -42,7 +42,7 @@ class Localization {
|
|||
|
||||
static async setLocale(newLocale) {
|
||||
if (newLocale === Localization.locale) return false;
|
||||
|
||||
|
||||
Localization.defaultTranslations = await Localization.fetchTranslationsFor(Localization.defaultLocale);
|
||||
|
||||
const newTranslations = await Localization.fetchTranslationsFor(newLocale);
|
||||
|
@ -94,7 +94,7 @@ class Localization {
|
|||
}
|
||||
}
|
||||
|
||||
static getTranslation(key, attr, data, useDefault=false) {
|
||||
static getTranslation(key, attr=null, data={}, useDefault=false) {
|
||||
const keys = key.split(".");
|
||||
|
||||
let translationCandidates = useDefault
|
||||
|
|
|
@ -94,7 +94,7 @@ class Localization {
|
|||
}
|
||||
}
|
||||
|
||||
static getTranslation(key, attr, data, useDefault=false) {
|
||||
static getTranslation(key, attr=null, data={}, useDefault=false) {
|
||||
const keys = key.split(".");
|
||||
|
||||
let translationCandidates = useDefault
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue