-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc4255e
commit e675ec8
Showing
18 changed files
with
286 additions
and
15 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...c/js/src_Components_jsx.ed943ea7.chunk.js → ...c/js/src_Components_jsx.e88043ee.chunk.js
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
admin/custom/static/js/src_Components_jsx.e88043ee.chunk.js.map
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
admin/custom/static/js/src_Components_jsx.ed943ea7.chunk.js.map
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
const fs = require('node:fs'); | ||
const path = require('node:path'); | ||
|
||
let language = 'en'; | ||
let words = null; | ||
|
||
function init(lang) { | ||
language = lang; | ||
const files = fs.readdirSync(path.join(__dirname, '/i18n')); | ||
words = {}; | ||
files.forEach(file => { | ||
if (file.endsWith('.json')) { | ||
const lang = file.split('.')[0]; | ||
const wordsForLanguage = JSON.parse(fs.readFileSync(path.join(__dirname, `/i18n/${file}`)).toString('utf8')); | ||
Object.keys(wordsForLanguage).forEach(key => { | ||
if (!words[key]) { | ||
words[key] = {}; | ||
} | ||
words[key][lang] = wordsForLanguage[key]; | ||
}); | ||
} | ||
}); | ||
} | ||
|
||
function getText(key, lang) { | ||
lang = lang || language; | ||
if (!language && lang) { | ||
language = lang; | ||
} | ||
if (!words && !lang) { | ||
throw new Error('i18n not initialized'); | ||
} | ||
if (!words) { | ||
init(lang); | ||
} | ||
if (!words[key]) { | ||
return key; | ||
} | ||
return words[key][lang] || words[key].en || key; | ||
} | ||
|
||
function getAllTexts(key) { | ||
if (!words) { | ||
init(); | ||
} | ||
return words[key]; | ||
} | ||
|
||
module.exports = { | ||
init, | ||
t: getText, | ||
tt: getAllTexts, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"New devices found": "Neue Geräte wurden gefunden", | ||
"Notification is not actual. All found devices are already added.": "Benachrichtigung ist nicht aktuell. Alle gefundenen Geräte sind bereits hinzugefügt.", | ||
"Save settings": "Einstellungen speichern", | ||
"Open settings": "Einstellungen öffnen", | ||
"Saved": "Gespeichert" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"New devices found": "New devices found", | ||
"Notification is not actual. All found devices are already added.": "Notification is not actual. All found devices are already added.", | ||
"Save settings": "Save settings", | ||
"Saved": "Saved", | ||
"Open settings": "Open settings" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"New devices found": "Nuevos dispositivos encontrados", | ||
"Notification is not actual. All found devices are already added.": "La notificación no es actual. Todos los dispositivos encontrados ya están agregados.", | ||
"Open settings": "Abrir configuración", | ||
"Save settings": "Guardar configuración", | ||
"Saved": "Guardado" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"New devices found": "Nouveaux appareils trouvés", | ||
"Notification is not actual. All found devices are already added.": "La notification n'est pas actuelle. Tous les appareils trouvés sont déjà ajoutés.", | ||
"Open settings": "Ouvrir les paramètres", | ||
"Save settings": "Enregistrer les paramètres", | ||
"Saved": "Sauvé" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"New devices found": "Nuovi dispositivi trovati", | ||
"Notification is not actual. All found devices are already added.": "La notifica non è effettiva. Tutti i dispositivi trovati sono già stati aggiunti.", | ||
"Open settings": "Apri impostazioni", | ||
"Save settings": "Salva impostazioni", | ||
"Saved": "Salvato" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"New devices found": "Nieuwe apparaten gevonden", | ||
"Notification is not actual. All found devices are already added.": "Notificatie is niet actueel. Alle gevonden apparaten zijn al toegevoegd.", | ||
"Open settings": "Instellingen openen", | ||
"Save settings": "Instellingen opslaan", | ||
"Saved": "Opgeslagen" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"New devices found": "Znaleziono nowe urządzenia", | ||
"Notification is not actual. All found devices are already added.": "Powiadomienie nie jest aktualne. Wszystkie znalezione urządzenia są już dodane.", | ||
"Open settings": "Otwórz ustawienia", | ||
"Save settings": "Zapisz ustawienia", | ||
"Saved": "Zapisane" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"New devices found": "Novos dispositivos encontrados", | ||
"Notification is not actual. All found devices are already added.": "A notificação não é real. Todos os dispositivos encontrados já foram adicionados.", | ||
"Open settings": "Abrir configurações", | ||
"Save settings": "Salvar configurações", | ||
"Saved": "Salvo" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"New devices found": "Найдены новые устройства", | ||
"Notification is not actual. All found devices are already added.": "Уведомление не актуально. Все найденные устройства уже добавлены.", | ||
"Open settings": "Открыть настройки", | ||
"Save settings": "Сохранить настройки", | ||
"Saved": "Сохранено" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"New devices found": "发现新设备", | ||
"Notification is not actual. All found devices are already added.": "通知不真实。所有找到的设备均已添加。", | ||
"Open settings": "打开设置", | ||
"Save settings": "保存设置", | ||
"Saved": "已保存" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters