@terrafirmagreg-team/translate 1.2.5 → 1.2.7
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 +1 -1
- package/src/config.ts +4 -3
- package/src/lib/registry.server.ts +5 -1
- package/src/locales/guide/en_us.json +1 -0
- package/src/locales/guide/ru_ru.json +1 -0
- package/src/locales/kit/en_us.json +5 -0
- package/src/locales/kit/ru_ru.json +5 -0
- package/src/locales/quest/en_us.json +3 -0
- package/src/locales/quest/ru_ru.json +3 -0
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)": "Открыть",
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
+
"cached(kit.stale_badge)": "cached",
|
|
3
|
+
"Dismiss(kit.dismiss)": "Dismiss",
|
|
2
4
|
"Failed to copy(ui.copy_error)": "Failed to copy",
|
|
5
|
+
"Retry now(kit.retry_now)": "Retry now",
|
|
6
|
+
"retrying in {seconds}s(kit.retrying_in)": "retrying in {seconds}s",
|
|
3
7
|
"Section data is temporarily unavailable. Try again later.(kit.section_unavailable)": "Section data is temporarily unavailable. Try again later.",
|
|
4
8
|
"Select dataset(ui.select_dataset)": "Select dataset",
|
|
5
9
|
"Select section(ui.select_section)": "Select section",
|
|
6
10
|
"View as Markdown(ui.view_markdown)": "View as Markdown",
|
|
11
|
+
"{datasets} data is temporarily unavailable(kit.dump_unavailable)": "{datasets} data is temporarily unavailable",
|
|
7
12
|
"latest(ui.version_latest)": "latest"
|
|
8
13
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
+
"cached(kit.stale_badge)": "кэш",
|
|
3
|
+
"Dismiss(kit.dismiss)": "Скрыть",
|
|
2
4
|
"Failed to copy(ui.copy_error)": "Не удалось скопировать",
|
|
5
|
+
"Retry now(kit.retry_now)": "Повторить",
|
|
6
|
+
"retrying in {seconds}s(kit.retrying_in)": "повтор через {seconds} с",
|
|
3
7
|
"Section data is temporarily unavailable. Try again later.(kit.section_unavailable)": "Данные раздела временно недоступны. Попробуйте позже.",
|
|
4
8
|
"Select dataset(ui.select_dataset)": "Выберите набор данных",
|
|
5
9
|
"Select section(ui.select_section)": "Выберите раздел",
|
|
6
10
|
"View as Markdown(ui.view_markdown)": "Просмотр Markdown",
|
|
11
|
+
"{datasets} data is temporarily unavailable(kit.dump_unavailable)": "Данные {datasets} временно недоступны",
|
|
7
12
|
"latest(ui.version_latest)": "последняя"
|
|
8
13
|
}
|
|
@@ -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
|
}
|