@samitouri / QOSami-HFS / commits / dd1e0035

allow overriding translations with 'all' special language

Massimo Melina committed Apr 11, 2024 at 11:30 UTC dd1e00354bbe0fbcdc176c144934cc092d7f5df2
2 files changed +3 -1
dev-plugins.md
+2
@@ -415,6 +415,8 @@ HFS._.set(HFS.lang, 'en.translate.Options', 'Settings')
415 This works because all translations are stored inside `HFS.lang`.
416 Using `HFS._.set` is not necessary, but in this case is convenient, because the language-code key may not exist.
417
418 +If you want to override a text regardless of the language, use the special language-code `all`.
419 +
420 ## API version history
421
422 - 8.8 (v0.53.0)
frontend/src/i18n.ts
+1 -1
@@ -13,7 +13,7 @@ const state = proxy({
13 const searchLangs: string[] = []
14 watch(get => {
15 const snapshot = get(state)
16 - searchLangs.splice(0, Infinity, ...snapshot.langs, snapshot.embedded) // replace completely
16 + searchLangs.splice(0, Infinity, 'all', ...snapshot.langs, snapshot.embedded) // replace completely
17 })
18
19 const warns = new Set() // avoid duplicates