@terrafirmagreg-team/translate 1.2.5 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -3,13 +3,14 @@ export type TranslateConfig = {
|
|
|
3
3
|
locales?: Record<string, unknown> | Record<string, unknown>[];
|
|
4
4
|
};
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const store = globalThis as Record<symbol, TranslateConfig | undefined>;
|
|
7
|
+
const CONFIG_KEY = Symbol.for('terrafirmagreg.config.translate');
|
|
7
8
|
|
|
8
9
|
export function registerTranslateConfig(next: TranslateConfig): void {
|
|
9
|
-
|
|
10
|
+
store[CONFIG_KEY] = { ...store[CONFIG_KEY], ...next };
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export function translateConfig(): TranslateConfig {
|
|
13
|
-
return
|
|
14
|
+
return store[CONFIG_KEY] ?? {};
|
|
14
15
|
}
|
|
15
16
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import 'server-only';
|
|
2
2
|
import { createLocaleSet, type LocaleSet } from '@terrafirmagreg-team/translate/create';
|
|
3
3
|
import { translateConfig } from '@terrafirmagreg-team/translate/config';
|
|
4
|
+
import { locales as packageLocales } from '../locales';
|
|
4
5
|
import { flattenMessages } from './flatten';
|
|
5
6
|
import { sortLangCodes } from './code';
|
|
6
7
|
import type { LocaleMessages, LocaleRegistry } from '@terrafirmagreg-team/translate/types/locale';
|
|
@@ -27,7 +28,10 @@ function flattenAll(
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
function discoverLocaleRegistry(): LocaleRegistry {
|
|
30
|
-
const catalogs = [
|
|
31
|
+
const catalogs = [
|
|
32
|
+
...Object.values(packageLocales),
|
|
33
|
+
translateConfig().locales ?? [],
|
|
34
|
+
].flat();
|
|
31
35
|
|
|
32
36
|
const messages: Record<string, LocaleMessages> = {};
|
|
33
37
|
for (const catalog of catalogs) {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"Entry not found(guide.entry_missing)": "Entry not found",
|
|
4
4
|
"Gameplay guide(sections.desc.guide)": "Gameplay guide",
|
|
5
5
|
"Guide(sections.guide)": "Guide",
|
|
6
|
+
"Guide data is temporarily unavailable. Try again later.(guide.unavailable)": "Guide data is temporarily unavailable. Try again later.",
|
|
6
7
|
"No recipes(guide.recipe_empty)": "No recipes",
|
|
7
8
|
"Objective(guide.objective)": "Objective",
|
|
8
9
|
"Open(guide.link)": "Open",
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"Entry not found(guide.entry_missing)": "Запись не найдена",
|
|
4
4
|
"Gameplay guide(sections.desc.guide)": "Игровой гайд",
|
|
5
5
|
"Guide(sections.guide)": "Гайды",
|
|
6
|
+
"Guide data is temporarily unavailable. Try again later.(guide.unavailable)": "Данные гайдов временно недоступны. Попробуйте позже.",
|
|
6
7
|
"No recipes(guide.recipe_empty)": "Нет рецептов",
|
|
7
8
|
"Objective(guide.objective)": "Задача",
|
|
8
9
|
"Open(guide.link)": "Открыть",
|
|
@@ -7,9 +7,12 @@
|
|
|
7
7
|
"Prerequisites are hidden.(quest.prerequisites_hidden)": "Prerequisites are hidden.",
|
|
8
8
|
"Prerequisites(quest.prerequisites)": "Prerequisites",
|
|
9
9
|
"Quest chapters and objectives(sections.desc.quest)": "Quest chapters and objectives",
|
|
10
|
+
"Quest data is temporarily unavailable. Try again later.(quest.unavailable)": "Quest data is temporarily unavailable. Try again later.",
|
|
11
|
+
"Quest not found(quest.not_found)": "Quest not found",
|
|
10
12
|
"Quests(sections.quest)": "Quests",
|
|
11
13
|
"Rewards(quest.rewards)": "Rewards",
|
|
12
14
|
"Search quests(quest.search)": "Search quests",
|
|
15
|
+
"Select a quest to view its details.(quest.select_hint)": "Select a quest to view its details.",
|
|
13
16
|
"Tasks(quest.tasks)": "Tasks",
|
|
14
17
|
"Unlocks(quest.dependents)": "Unlocks"
|
|
15
18
|
}
|
|
@@ -7,9 +7,12 @@
|
|
|
7
7
|
"Prerequisites are hidden.(quest.prerequisites_hidden)": "Требования скрыты.",
|
|
8
8
|
"Prerequisites(quest.prerequisites)": "Требования",
|
|
9
9
|
"Quest chapters and objectives(sections.desc.quest)": "Главы и задания квестбука",
|
|
10
|
+
"Quest data is temporarily unavailable. Try again later.(quest.unavailable)": "Данные квестов временно недоступны. Попробуйте позже.",
|
|
11
|
+
"Quest not found(quest.not_found)": "Квест не найден",
|
|
10
12
|
"Quests(sections.quest)": "Квесты",
|
|
11
13
|
"Rewards(quest.rewards)": "Награды",
|
|
12
14
|
"Search quests(quest.search)": "Поиск квестов",
|
|
15
|
+
"Select a quest to view its details.(quest.select_hint)": "Выберите квест, чтобы увидеть детали.",
|
|
13
16
|
"Tasks(quest.tasks)": "Задания",
|
|
14
17
|
"Unlocks(quest.dependents)": "Открывает"
|
|
15
18
|
}
|