rpg-engine 0.12.0 → 0.13.0
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/README.md +1 -1
- package/dist/commands/effect.d.ts +1 -1
- package/dist/commands/shared/inputs.d.ts +2 -2
- package/dist/commands/shared/inputs.js +15 -2
- package/dist/commands/shared/page-words.d.ts +4 -0
- package/dist/commands/shared/page-words.js +7 -7
- package/dist/commands/shared/system-texts.d.ts +11 -0
- package/dist/commands/shared/system-texts.js +203 -0
- package/dist/commands/shared/world.d.ts +2 -0
- package/dist/commands/shared/world.js +13 -3
- package/dist/commands/view/view.d.ts +4 -0
- package/dist/commands/view/view.js +14 -3
- package/dist/commands/write/write.d.ts +3 -3
- package/dist/core/context.d.ts +16 -0
- package/dist/core/files.js +2 -3
- package/dist/core/language.d.ts +2 -0
- package/dist/core/language.js +8 -0
- package/dist/core/text.d.ts +2 -0
- package/dist/core/text.js +5 -0
- package/dist/dashboard/app.js +2 -1
- package/dist/dashboard/guide/ar.md +2 -2
- package/dist/dashboard/guide/cs.md +2 -2
- package/dist/dashboard/guide/da.md +2 -2
- package/dist/dashboard/guide/de.md +2 -2
- package/dist/dashboard/guide/el.md +2 -2
- package/dist/dashboard/guide/en.md +1 -1
- package/dist/dashboard/guide/es.md +2 -2
- package/dist/dashboard/guide/fi.md +2 -2
- package/dist/dashboard/guide/fr.md +2 -2
- package/dist/dashboard/guide/he.md +2 -2
- package/dist/dashboard/guide/hi.md +2 -2
- package/dist/dashboard/guide/hu.md +2 -2
- package/dist/dashboard/guide/is.md +2 -2
- package/dist/dashboard/guide/it.md +2 -2
- package/dist/dashboard/guide/ja.md +2 -2
- package/dist/dashboard/guide/ko.md +2 -2
- package/dist/dashboard/guide/nb.md +2 -2
- package/dist/dashboard/guide/nl.md +2 -2
- package/dist/dashboard/guide/pl.md +2 -2
- package/dist/dashboard/guide/pt.md +2 -2
- package/dist/dashboard/guide/ro.md +2 -2
- package/dist/dashboard/guide/ru.md +2 -2
- package/dist/dashboard/guide/sv.md +2 -2
- package/dist/dashboard/guide/tr.md +2 -2
- package/dist/dashboard/guide/uk.md +2 -2
- package/dist/dashboard/guide/zh.md +2 -2
- package/dist/dashboard/i18n/ar.json +2 -1
- package/dist/dashboard/i18n/cs.json +2 -1
- package/dist/dashboard/i18n/da.json +2 -1
- package/dist/dashboard/i18n/de.json +2 -1
- package/dist/dashboard/i18n/el.json +2 -1
- package/dist/dashboard/i18n/es.json +2 -1
- package/dist/dashboard/i18n/fi.json +2 -1
- package/dist/dashboard/i18n/fr.json +2 -1
- package/dist/dashboard/i18n/he.json +2 -1
- package/dist/dashboard/i18n/hi.json +2 -1
- package/dist/dashboard/i18n/hu.json +2 -1
- package/dist/dashboard/i18n/is.json +2 -1
- package/dist/dashboard/i18n/it.json +2 -1
- package/dist/dashboard/i18n/ja.json +2 -1
- package/dist/dashboard/i18n/ko.json +2 -1
- package/dist/dashboard/i18n/nb.json +2 -1
- package/dist/dashboard/i18n/nl.json +2 -1
- package/dist/dashboard/i18n/pl.json +2 -1
- package/dist/dashboard/i18n/pt.json +2 -1
- package/dist/dashboard/i18n/ro.json +2 -1
- package/dist/dashboard/i18n/ru.json +2 -1
- package/dist/dashboard/i18n/sv.json +2 -1
- package/dist/dashboard/i18n/tr.json +2 -1
- package/dist/dashboard/i18n/uk.json +2 -1
- package/dist/dashboard/i18n/zh.json +2 -1
- package/dist/dashboard/notices.js +9 -2
- package/dist/dashboard/saves.js +1 -1
- package/dist/dashboard/text.js +7 -2
- package/dist/documents/png.d.ts +2 -3
- package/dist/documents/png.js +6 -6
- package/dist/documents/read.js +2 -1
- package/dist/extensions/words.js +2 -1
- package/dist/languages/language-pack.js +2 -2
- package/dist/pages/index.d.ts +1 -1
- package/dist/pages/index.js +1 -1
- package/dist/pages/world.d.ts +5 -0
- package/dist/pages/world.js +22 -11
- package/dist/server/dashboard/files.js +3 -2
- package/dist/server/dashboard/index.d.ts +3 -1
- package/dist/server/dashboard/index.js +3 -1
- package/dist/server/mcp.js +3 -1
- package/dist/systems/game-system.js +2 -1
- package/dist/systems/words.js +2 -1
- package/dist/testing/index.js +1 -1
- package/instructions/play.md +1 -1
- package/package.json +4 -4
|
@@ -885,7 +885,7 @@
|
|
|
885
885
|
"The game goes back to how it was then. What happened after it is gone from the story, and so are the {count} saves after it.": "गेम वैसा हो जाएगा जैसा तब था। उसके बाद जो हुआ, वह कहानी से मिट जाएगा, और उसके बाद के {count} सेव भी।",
|
|
886
886
|
"The game goes back to how it was then. What happened after it is gone from the story, and so is the save after it.": "गेम वैसा हो जाएगा जैसा तब था। उसके बाद जो हुआ, वह कहानी से मिट जाएगा, और उसके बाद का सेव भी।",
|
|
887
887
|
"The game goes back to how it was then. What happened after it is gone from the story.": "गेम वैसा हो जाएगा जैसा तब था। उसके बाद जो हुआ, वह कहानी से मिट जाएगा।",
|
|
888
|
-
"The game goes on in the new chat: write «
|
|
888
|
+
"The game goes on in the new chat: write «continue» there.": "खेल नई चैट में आगे चलता है: वहाँ «जारी रखें» लिखें।",
|
|
889
889
|
"The game master": "गेम मास्टर",
|
|
890
890
|
"The game master, {mood}": "गेम मास्टर, {mood}",
|
|
891
891
|
"The game master, away": "गेम मास्टर, दूर",
|
|
@@ -1057,6 +1057,7 @@
|
|
|
1057
1057
|
"With a new character": "नया किरदार बनाकर",
|
|
1058
1058
|
"With the same character": "वही किरदार रखकर",
|
|
1059
1059
|
"With you": "आपके पास",
|
|
1060
|
+
"With your account, Codex or Claude Code is translating the game's rules into {language}: until then they stay in English.": "आपके अकाउंट से Codex या Claude Code गेम के नियमों का {language} में अनुवाद कर रहा है: तब तक वे अंग्रेज़ी में ही रहेंगे।",
|
|
1060
1061
|
"Within": "अंदर",
|
|
1061
1062
|
"Without a licence, all rights are reserved.": "लाइसेंस के बिना, सभी अधिकार सुरक्षित हैं।",
|
|
1062
1063
|
"World": "दुनिया",
|
|
@@ -885,7 +885,7 @@
|
|
|
885
885
|
"The game goes back to how it was then. What happened after it is gone from the story, and so are the {count} saves after it.": "A játék úgy folytatódik, ahogy akkor volt. Ami utána történt, kikerül a történetből, és vele együtt az utána következő {count} mentés is.",
|
|
886
886
|
"The game goes back to how it was then. What happened after it is gone from the story, and so is the save after it.": "A játék úgy folytatódik, ahogy akkor volt. Ami utána történt, kikerül a történetből, és vele együtt az utána következő mentés is.",
|
|
887
887
|
"The game goes back to how it was then. What happened after it is gone from the story.": "A játék úgy folytatódik, ahogy akkor volt. Ami utána történt, kikerül a történetből.",
|
|
888
|
-
"The game goes on in the new chat: write «
|
|
888
|
+
"The game goes on in the new chat: write «continue» there.": "A játék az új csevegésben folytatódik: írd oda: «folytasd».",
|
|
889
889
|
"The game master": "A mesélő",
|
|
890
890
|
"The game master, {mood}": "A mesélő, {mood}",
|
|
891
891
|
"The game master, away": "A mesélő, távol",
|
|
@@ -1057,6 +1057,7 @@
|
|
|
1057
1057
|
"With a new character": "Új karakterrel",
|
|
1058
1058
|
"With the same character": "Ugyanazzal a karakterrel",
|
|
1059
1059
|
"With you": "Nálad",
|
|
1060
|
+
"With your account, Codex or Claude Code is translating the game's rules into {language}: until then they stay in English.": "A fiókoddal a Codex vagy a Claude Code fordítja le a játék szabályait ({language} nyelvre): addig angolul maradnak.",
|
|
1060
1061
|
"Within": "Bent",
|
|
1061
1062
|
"Without a licence, all rights are reserved.": "Licenc nélkül minden jog fenntartva.",
|
|
1062
1063
|
"World": "Világ",
|
|
@@ -885,7 +885,7 @@
|
|
|
885
885
|
"The game goes back to how it was then. What happened after it is gone from the story, and so are the {count} saves after it.": "Leikurinn fer aftur í það ástand sem hann var þá í. Það sem gerðist eftir það hverfur úr sögunni, og vistanirnar {count} á eftir því líka.",
|
|
886
886
|
"The game goes back to how it was then. What happened after it is gone from the story, and so is the save after it.": "Leikurinn fer aftur í það ástand sem hann var þá í. Það sem gerðist eftir það hverfur úr sögunni, og vistunin á eftir því líka.",
|
|
887
887
|
"The game goes back to how it was then. What happened after it is gone from the story.": "Leikurinn fer aftur í það ástand sem hann var þá í. Það sem gerðist eftir það hverfur úr sögunni.",
|
|
888
|
-
"The game goes on in the new chat: write «
|
|
888
|
+
"The game goes on in the new chat: write «continue» there.": "Leikurinn heldur áfram í nýja spjallinu: skrifaðu «haltu áfram» þar.",
|
|
889
889
|
"The game master": "Sögumaður",
|
|
890
890
|
"The game master, {mood}": "Sögumaður, {mood}",
|
|
891
891
|
"The game master, away": "Sögumaður, fjarverandi",
|
|
@@ -1057,6 +1057,7 @@
|
|
|
1057
1057
|
"With a new character": "Með nýrri persónu",
|
|
1058
1058
|
"With the same character": "Með sömu persónu",
|
|
1059
1059
|
"With you": "Með þér",
|
|
1060
|
+
"With your account, Codex or Claude Code is translating the game's rules into {language}: until then they stay in English.": "Codex eða Claude Code þýðir reglur leiksins á {language} með þínum aðgangi: þangað til haldast þær á ensku.",
|
|
1060
1061
|
"Within": "Inni í",
|
|
1061
1062
|
"Without a licence, all rights are reserved.": "Án leyfis áskilinn er allur réttur.",
|
|
1062
1063
|
"World": "Heimur",
|
|
@@ -885,7 +885,7 @@
|
|
|
885
885
|
"The game goes back to how it was then. What happened after it is gone from the story, and so are the {count} saves after it.": "Il gioco torna com'era allora. Ciò che è successo dopo sparisce dalla storia, e così i {count} salvataggi dopo.",
|
|
886
886
|
"The game goes back to how it was then. What happened after it is gone from the story, and so is the save after it.": "Il gioco torna com'era allora. Ciò che è successo dopo sparisce dalla storia, e così il salvataggio dopo.",
|
|
887
887
|
"The game goes back to how it was then. What happened after it is gone from the story.": "Il gioco torna com'era allora. Ciò che è successo dopo sparisce dalla storia.",
|
|
888
|
-
"The game goes on in the new chat: write «
|
|
888
|
+
"The game goes on in the new chat: write «continue» there.": "Il gioco prosegue nella chat nuova: scrivi lì «continua».",
|
|
889
889
|
"The game master": "Il master",
|
|
890
890
|
"The game master, {mood}": "Il master, {mood}",
|
|
891
891
|
"The game master, away": "Il master, assente",
|
|
@@ -1057,6 +1057,7 @@
|
|
|
1057
1057
|
"With a new character": "Con un personaggio nuovo",
|
|
1058
1058
|
"With the same character": "Con lo stesso personaggio",
|
|
1059
1059
|
"With you": "Con te",
|
|
1060
|
+
"With your account, Codex or Claude Code is translating the game's rules into {language}: until then they stay in English.": "Con il tuo account, Codex o Claude Code sta traducendo le regole del gioco in {language}: fino ad allora restano in inglese.",
|
|
1060
1061
|
"Within": "Dentro",
|
|
1061
1062
|
"Without a licence, all rights are reserved.": "Senza licenza, tutti i diritti sono riservati.",
|
|
1062
1063
|
"World": "Mondo",
|
|
@@ -885,7 +885,7 @@
|
|
|
885
885
|
"The game goes back to how it was then. What happened after it is gone from the story, and so are the {count} saves after it.": "ゲームはそのときの状態に戻ります。それ以降に起きたことはストーリーから消え、その後の{count}件のセーブも消えます。",
|
|
886
886
|
"The game goes back to how it was then. What happened after it is gone from the story, and so is the save after it.": "ゲームはそのときの状態に戻ります。それ以降に起きたことはストーリーから消え、その後のセーブも消えます。",
|
|
887
887
|
"The game goes back to how it was then. What happened after it is gone from the story.": "ゲームはそのときの状態に戻ります。それ以降に起きたことはストーリーから消えます。",
|
|
888
|
-
"The game goes on in the new chat: write «
|
|
888
|
+
"The game goes on in the new chat: write «continue» there.": "ゲームは新しいチャットで続きます。そこで「続けて」と入力してください。",
|
|
889
889
|
"The game master": "GM",
|
|
890
890
|
"The game master, {mood}": "GM({mood})",
|
|
891
891
|
"The game master, away": "GM(不在)",
|
|
@@ -1057,6 +1057,7 @@
|
|
|
1057
1057
|
"With a new character": "新しいキャラクターで",
|
|
1058
1058
|
"With the same character": "同じキャラクターで",
|
|
1059
1059
|
"With you": "所持中",
|
|
1060
|
+
"With your account, Codex or Claude Code is translating the game's rules into {language}: until then they stay in English.": "お使いのアカウントで、CodexまたはClaude Codeがゲームのルールを{language}に翻訳しています。完了するまでは英語のままです。",
|
|
1060
1061
|
"Within": "内部",
|
|
1061
1062
|
"Without a licence, all rights are reserved.": "ライセンスがない場合、すべての権利は留保されます。",
|
|
1062
1063
|
"World": "ワールド",
|
|
@@ -885,7 +885,7 @@
|
|
|
885
885
|
"The game goes back to how it was then. What happened after it is gone from the story, and so are the {count} saves after it.": "게임이 그때 상태로 돌아가요. 그 뒤에 일어난 일과 그 뒤의 세이브 {count}개가 이야기에서 사라져요.",
|
|
886
886
|
"The game goes back to how it was then. What happened after it is gone from the story, and so is the save after it.": "게임이 그때 상태로 돌아가요. 그 뒤에 일어난 일과 그 뒤의 세이브가 이야기에서 사라져요.",
|
|
887
887
|
"The game goes back to how it was then. What happened after it is gone from the story.": "게임이 그때 상태로 돌아가요. 그 뒤에 일어난 일은 이야기에서 사라져요.",
|
|
888
|
-
"The game goes on in the new chat: write «
|
|
888
|
+
"The game goes on in the new chat: write «continue» there.": "새 채팅에서 게임이 이어져요. 거기에 «계속»라고 써 주세요.",
|
|
889
889
|
"The game master": "GM",
|
|
890
890
|
"The game master, {mood}": "GM, {mood}",
|
|
891
891
|
"The game master, away": "GM, 자리 비움",
|
|
@@ -1057,6 +1057,7 @@
|
|
|
1057
1057
|
"With a new character": "새 캐릭터로",
|
|
1058
1058
|
"With the same character": "같은 캐릭터로",
|
|
1059
1059
|
"With you": "소지 중",
|
|
1060
|
+
"With your account, Codex or Claude Code is translating the game's rules into {language}: until then they stay in English.": "계정으로 Codex 또는 Claude Code가 게임 규칙을 {language}(으)로 번역하고 있어요. 그때까지는 영어로 표시돼요.",
|
|
1060
1061
|
"Within": "내부",
|
|
1061
1062
|
"Without a licence, all rights are reserved.": "라이선스가 없으면 모든 권리가 보유돼요.",
|
|
1062
1063
|
"World": "세계",
|
|
@@ -885,7 +885,7 @@
|
|
|
885
885
|
"The game goes back to how it was then. What happened after it is gone from the story, and so are the {count} saves after it.": "Spillet går tilbake til slik det var da. Det som skjedde etterpå, forsvinner fra historien, og det samme gjør de {count} lagrede spillene etter det.",
|
|
886
886
|
"The game goes back to how it was then. What happened after it is gone from the story, and so is the save after it.": "Spillet går tilbake til slik det var da. Det som skjedde etterpå, forsvinner fra historien, og det samme gjør det lagrede spillet etter det.",
|
|
887
887
|
"The game goes back to how it was then. What happened after it is gone from the story.": "Spillet går tilbake til slik det var da. Det som skjedde etterpå, forsvinner fra historien.",
|
|
888
|
-
"The game goes on in the new chat: write «
|
|
888
|
+
"The game goes on in the new chat: write «continue» there.": "Spillet fortsetter i den nye chatten: skriv «fortsett» der.",
|
|
889
889
|
"The game master": "Spilleder",
|
|
890
890
|
"The game master, {mood}": "Spilleder, {mood}",
|
|
891
891
|
"The game master, away": "Spilleder, borte",
|
|
@@ -1057,6 +1057,7 @@
|
|
|
1057
1057
|
"With a new character": "Med en ny karakter",
|
|
1058
1058
|
"With the same character": "Med samme karakter",
|
|
1059
1059
|
"With you": "Med deg",
|
|
1060
|
+
"With your account, Codex or Claude Code is translating the game's rules into {language}: until then they stay in English.": "Med kontoen din oversetter Codex eller Claude Code spillreglene til {language}. Frem til det er ferdig forblir de på engelsk.",
|
|
1060
1061
|
"Within": "Innenfor",
|
|
1061
1062
|
"Without a licence, all rights are reserved.": "Uten lisens er alle rettigheter forbeholdt.",
|
|
1062
1063
|
"World": "Verden",
|
|
@@ -885,7 +885,7 @@
|
|
|
885
885
|
"The game goes back to how it was then. What happened after it is gone from the story, and so are the {count} saves after it.": "Het spel gaat terug naar hoe het toen was. Wat daarna gebeurde verdwijnt uit het verhaal, en de {count} opgeslagen spellen erna ook.",
|
|
886
886
|
"The game goes back to how it was then. What happened after it is gone from the story, and so is the save after it.": "Het spel gaat terug naar hoe het toen was. Wat daarna gebeurde verdwijnt uit het verhaal, en het opgeslagen spel erna ook.",
|
|
887
887
|
"The game goes back to how it was then. What happened after it is gone from the story.": "Het spel gaat terug naar hoe het toen was. Wat daarna gebeurde verdwijnt uit het verhaal.",
|
|
888
|
-
"The game goes on in the new chat: write «
|
|
888
|
+
"The game goes on in the new chat: write «continue» there.": "Het spel gaat verder in de nieuwe chat: schrijf daar «verder».",
|
|
889
889
|
"The game master": "De spelleider",
|
|
890
890
|
"The game master, {mood}": "De spelleider, {mood}",
|
|
891
891
|
"The game master, away": "De spelleider, afwezig",
|
|
@@ -1057,6 +1057,7 @@
|
|
|
1057
1057
|
"With a new character": "Met een nieuw personage",
|
|
1058
1058
|
"With the same character": "Met hetzelfde personage",
|
|
1059
1059
|
"With you": "Bij je",
|
|
1060
|
+
"With your account, Codex or Claude Code is translating the game's rules into {language}: until then they stay in English.": "Met jouw account vertaalt Codex of Claude Code de spelregels naar het {language}: tot die tijd blijven ze in het Engels.",
|
|
1060
1061
|
"Within": "Binnen",
|
|
1061
1062
|
"Without a licence, all rights are reserved.": "Zonder licentie zijn alle rechten voorbehouden.",
|
|
1062
1063
|
"World": "Wereld",
|
|
@@ -885,7 +885,7 @@
|
|
|
885
885
|
"The game goes back to how it was then. What happened after it is gone from the story, and so are the {count} saves after it.": "Gra wraca do stanu z tamtej chwili. To, co wydarzyło się później, znika z historii, a razem z tym zapisy po nim. Liczba zapisów: {count}.",
|
|
886
886
|
"The game goes back to how it was then. What happened after it is gone from the story, and so is the save after it.": "Gra wraca do stanu z tamtej chwili. To, co wydarzyło się później, znika z historii, a razem z tym zapis po nim.",
|
|
887
887
|
"The game goes back to how it was then. What happened after it is gone from the story.": "Gra wraca do stanu z tamtej chwili. To, co wydarzyło się później, znika z historii.",
|
|
888
|
-
"The game goes on in the new chat: write «
|
|
888
|
+
"The game goes on in the new chat: write «continue» there.": "Gra toczy się dalej w nowym czacie: napisz tam «kontynuuj».",
|
|
889
889
|
"The game master": "Mistrz Gry",
|
|
890
890
|
"The game master, {mood}": "Mistrz Gry, {mood}",
|
|
891
891
|
"The game master, away": "Mistrz Gry, nieobecny",
|
|
@@ -1057,6 +1057,7 @@
|
|
|
1057
1057
|
"With a new character": "Z nową postacią",
|
|
1058
1058
|
"With the same character": "Z tą samą postacią",
|
|
1059
1059
|
"With you": "Przy sobie",
|
|
1060
|
+
"With your account, Codex or Claude Code is translating the game's rules into {language}: until then they stay in English.": "Za pomocą Twojego konta Codex lub Claude Code tłumaczy zasady gry na język {language}. Do tego czasu pozostają po angielsku.",
|
|
1060
1061
|
"Within": "Wewnątrz",
|
|
1061
1062
|
"Without a licence, all rights are reserved.": "Bez licencji wszelkie prawa są zastrzeżone.",
|
|
1062
1063
|
"World": "Świat",
|
|
@@ -885,7 +885,7 @@
|
|
|
885
885
|
"The game goes back to how it was then. What happened after it is gone from the story, and so are the {count} saves after it.": "O jogo volta a como era naquele momento. O que aconteceu depois sai da história, e os {count} jogos salvos seguintes também.",
|
|
886
886
|
"The game goes back to how it was then. What happened after it is gone from the story, and so is the save after it.": "O jogo volta a como era naquele momento. O que aconteceu depois sai da história, e o jogo salvo seguinte também.",
|
|
887
887
|
"The game goes back to how it was then. What happened after it is gone from the story.": "O jogo volta a como era naquele momento. O que aconteceu depois sai da história.",
|
|
888
|
-
"The game goes on in the new chat: write «
|
|
888
|
+
"The game goes on in the new chat: write «continue» there.": "O jogo continua no novo chat: escreva «continuar» lá.",
|
|
889
889
|
"The game master": "O mestre",
|
|
890
890
|
"The game master, {mood}": "O mestre, {mood}",
|
|
891
891
|
"The game master, away": "O mestre, ausente",
|
|
@@ -1057,6 +1057,7 @@
|
|
|
1057
1057
|
"With a new character": "Com um novo personagem",
|
|
1058
1058
|
"With the same character": "Com o mesmo personagem",
|
|
1059
1059
|
"With you": "Com você",
|
|
1060
|
+
"With your account, Codex or Claude Code is translating the game's rules into {language}: until then they stay in English.": "Com a sua conta, o Codex ou o Claude Code está traduzindo as regras do jogo para {language}: até lá, elas continuam em inglês.",
|
|
1060
1061
|
"Within": "Dentro",
|
|
1061
1062
|
"Without a licence, all rights are reserved.": "Sem licença, todos os direitos são reservados.",
|
|
1062
1063
|
"World": "Mundo",
|
|
@@ -885,7 +885,7 @@
|
|
|
885
885
|
"The game goes back to how it was then. What happened after it is gone from the story, and so are the {count} saves after it.": "Jocul revine la cum era atunci. Ce s-a întâmplat după aceea dispare din poveste, la fel și cele {count} salvări de după ea.",
|
|
886
886
|
"The game goes back to how it was then. What happened after it is gone from the story, and so is the save after it.": "Jocul revine la cum era atunci. Ce s-a întâmplat după aceea dispare din poveste, la fel și salvarea de după ea.",
|
|
887
887
|
"The game goes back to how it was then. What happened after it is gone from the story.": "Jocul revine la cum era atunci. Ce s-a întâmplat după aceea dispare din poveste.",
|
|
888
|
-
"The game goes on in the new chat: write «
|
|
888
|
+
"The game goes on in the new chat: write «continue» there.": "Jocul continuă în chatul nou: scrie acolo «continuă».",
|
|
889
889
|
"The game master": "Maestrul de joc",
|
|
890
890
|
"The game master, {mood}": "Maestrul de joc, {mood}",
|
|
891
891
|
"The game master, away": "Maestrul de joc, plecat",
|
|
@@ -1057,6 +1057,7 @@
|
|
|
1057
1057
|
"With a new character": "Cu un personaj nou",
|
|
1058
1058
|
"With the same character": "Cu același personaj",
|
|
1059
1059
|
"With you": "La tine",
|
|
1060
|
+
"With your account, Codex or Claude Code is translating the game's rules into {language}: until then they stay in English.": "Cu contul tău, Codex sau Claude Code traduce regulile jocului în {language}: până atunci rămân în engleză.",
|
|
1060
1061
|
"Within": "Înăuntru",
|
|
1061
1062
|
"Without a licence, all rights are reserved.": "Fără licență, toate drepturile sunt rezervate.",
|
|
1062
1063
|
"World": "Lume",
|
|
@@ -885,7 +885,7 @@
|
|
|
885
885
|
"The game goes back to how it was then. What happened after it is gone from the story, and so are the {count} saves after it.": "Игра вернётся к тому моменту. Всё, что случилось после, исчезнет из истории, как и сохранения после него (их {count}).",
|
|
886
886
|
"The game goes back to how it was then. What happened after it is gone from the story, and so is the save after it.": "Игра вернётся к тому моменту. Всё, что случилось после, исчезнет из истории, как и следующее за ним сохранение.",
|
|
887
887
|
"The game goes back to how it was then. What happened after it is gone from the story.": "Игра вернётся к тому моменту. Всё, что случилось после, исчезнет из истории.",
|
|
888
|
-
"The game goes on in the new chat: write «
|
|
888
|
+
"The game goes on in the new chat: write «continue» there.": "Игра продолжится в новом чате: напиши там «продолжай».",
|
|
889
889
|
"The game master": "Мастер",
|
|
890
890
|
"The game master, {mood}": "Мастер: {mood}",
|
|
891
891
|
"The game master, away": "Мастер отсутствует",
|
|
@@ -1057,6 +1057,7 @@
|
|
|
1057
1057
|
"With a new character": "С новым персонажем",
|
|
1058
1058
|
"With the same character": "С тем же персонажем",
|
|
1059
1059
|
"With you": "При тебе",
|
|
1060
|
+
"With your account, Codex or Claude Code is translating the game's rules into {language}: until then they stay in English.": "С твоего аккаунта Codex или Claude Code переводит правила игры на {language}: до тех пор они остаются на английском.",
|
|
1060
1061
|
"Within": "Внутри",
|
|
1061
1062
|
"Without a licence, all rights are reserved.": "Без лицензии все права защищены.",
|
|
1062
1063
|
"World": "Мир",
|
|
@@ -885,7 +885,7 @@
|
|
|
885
885
|
"The game goes back to how it was then. What happened after it is gone from the story, and so are the {count} saves after it.": "Spelet går tillbaka till hur det var då. Det som hände efter försvinner ur berättelsen, och de {count} sparade spelen efter det också.",
|
|
886
886
|
"The game goes back to how it was then. What happened after it is gone from the story, and so is the save after it.": "Spelet går tillbaka till hur det var då. Det som hände efter försvinner ur berättelsen, och det sparade spelet efter det också.",
|
|
887
887
|
"The game goes back to how it was then. What happened after it is gone from the story.": "Spelet går tillbaka till hur det var då. Det som hände efter försvinner ur berättelsen.",
|
|
888
|
-
"The game goes on in the new chat: write «
|
|
888
|
+
"The game goes on in the new chat: write «continue» there.": "Spelet fortsätter i den nya chatten: skriv «fortsätt» där.",
|
|
889
889
|
"The game master": "Spelledaren",
|
|
890
890
|
"The game master, {mood}": "Spelledaren, {mood}",
|
|
891
891
|
"The game master, away": "Spelledaren, borta",
|
|
@@ -1057,6 +1057,7 @@
|
|
|
1057
1057
|
"With a new character": "Med en ny rollperson",
|
|
1058
1058
|
"With the same character": "Med samma rollperson",
|
|
1059
1059
|
"With you": "Med dig",
|
|
1060
|
+
"With your account, Codex or Claude Code is translating the game's rules into {language}: until then they stay in English.": "Med ditt konto översätter Codex eller Claude Code spelets regler till {language}. Tills det är klart förblir de på engelska.",
|
|
1060
1061
|
"Within": "Inuti",
|
|
1061
1062
|
"Without a licence, all rights are reserved.": "Utan licens förbehålls alla rättigheter.",
|
|
1062
1063
|
"World": "Värld",
|
|
@@ -885,7 +885,7 @@
|
|
|
885
885
|
"The game goes back to how it was then. What happened after it is gone from the story, and so are the {count} saves after it.": "Oyun o zamanki hâline döner. Sonrasında olanlar hikâyeden silinir, ondan sonraki {count} kayıt da silinir.",
|
|
886
886
|
"The game goes back to how it was then. What happened after it is gone from the story, and so is the save after it.": "Oyun o zamanki hâline döner. Sonrasında olanlar hikâyeden silinir, ondan sonraki kayıt da silinir.",
|
|
887
887
|
"The game goes back to how it was then. What happened after it is gone from the story.": "Oyun o zamanki hâline döner. Sonrasında olanlar hikâyeden silinir.",
|
|
888
|
-
"The game goes on in the new chat: write «
|
|
888
|
+
"The game goes on in the new chat: write «continue» there.": "Oyun yeni sohbette devam eder: orada «devam et» yaz.",
|
|
889
889
|
"The game master": "Oyun yöneticisi",
|
|
890
890
|
"The game master, {mood}": "Oyun yöneticisi, {mood}",
|
|
891
891
|
"The game master, away": "Oyun yöneticisi, uzakta",
|
|
@@ -1057,6 +1057,7 @@
|
|
|
1057
1057
|
"With a new character": "Yeni bir karakterle",
|
|
1058
1058
|
"With the same character": "Aynı karakterle",
|
|
1059
1059
|
"With you": "Yanında",
|
|
1060
|
+
"With your account, Codex or Claude Code is translating the game's rules into {language}: until then they stay in English.": "Hesabınla Codex veya Claude Code, oyunun kurallarını {language} diline çeviriyor: o zamana kadar kurallar İngilizce kalır.",
|
|
1060
1061
|
"Within": "İçinde",
|
|
1061
1062
|
"Without a licence, all rights are reserved.": "Lisans yoksa tüm haklar saklıdır.",
|
|
1062
1063
|
"World": "Dünya",
|
|
@@ -885,7 +885,7 @@
|
|
|
885
885
|
"The game goes back to how it was then. What happened after it is gone from the story, and so are the {count} saves after it.": "Гра повернеться до того стану, який був тоді. Усе, що сталося після цього, зникне з історії, так само як і збереження після нього (кількість: {count}).",
|
|
886
886
|
"The game goes back to how it was then. What happened after it is gone from the story, and so is the save after it.": "Гра повернеться до того стану, який був тоді. Усе, що сталося після цього, зникне з історії, так само як і збереження після нього.",
|
|
887
887
|
"The game goes back to how it was then. What happened after it is gone from the story.": "Гра повернеться до того стану, який був тоді. Усе, що сталося після цього, зникне з історії.",
|
|
888
|
-
"The game goes on in the new chat: write «
|
|
888
|
+
"The game goes on in the new chat: write «continue» there.": "Гра триває в новому чаті: напиши там «продовжуй».",
|
|
889
889
|
"The game master": "Майстер",
|
|
890
890
|
"The game master, {mood}": "Майстер, {mood}",
|
|
891
891
|
"The game master, away": "Майстер, відсутній",
|
|
@@ -1057,6 +1057,7 @@
|
|
|
1057
1057
|
"With a new character": "З новим персонажем",
|
|
1058
1058
|
"With the same character": "З тим самим персонажем",
|
|
1059
1059
|
"With you": "З тобою",
|
|
1060
|
+
"With your account, Codex or Claude Code is translating the game's rules into {language}: until then they stay in English.": "З твого акаунта Codex або Claude Code перекладає правила гри мовою {language}: до того часу вони залишаються англійською.",
|
|
1060
1061
|
"Within": "Усередині",
|
|
1061
1062
|
"Without a licence, all rights are reserved.": "Без ліцензії всі права захищені.",
|
|
1062
1063
|
"World": "Світ",
|
|
@@ -885,7 +885,7 @@
|
|
|
885
885
|
"The game goes back to how it was then. What happened after it is gone from the story, and so are the {count} saves after it.": "游戏会回到当时的样子。之后发生的事会从故事中消失,之后的 {count} 个存档也一样。",
|
|
886
886
|
"The game goes back to how it was then. What happened after it is gone from the story, and so is the save after it.": "游戏会回到当时的样子。之后发生的事会从故事中消失,之后的存档也一样。",
|
|
887
887
|
"The game goes back to how it was then. What happened after it is gone from the story.": "游戏会回到当时的样子。之后发生的事会从故事中消失。",
|
|
888
|
-
"The game goes on in the new chat: write «
|
|
888
|
+
"The game goes on in the new chat: write «continue» there.": "游戏将在新聊天中继续:请在那里输入“继续”。",
|
|
889
889
|
"The game master": "主持人",
|
|
890
890
|
"The game master, {mood}": "主持人,{mood}",
|
|
891
891
|
"The game master, away": "主持人,离开中",
|
|
@@ -1057,6 +1057,7 @@
|
|
|
1057
1057
|
"With a new character": "使用新角色",
|
|
1058
1058
|
"With the same character": "沿用同一角色",
|
|
1059
1059
|
"With you": "随身携带",
|
|
1060
|
+
"With your account, Codex or Claude Code is translating the game's rules into {language}: until then they stay in English.": "Codex 或 Claude Code 正在通过你的账号将游戏规则翻译成{language},在此之前规则仍为英文。",
|
|
1060
1061
|
"Within": "内部",
|
|
1061
1062
|
"Without a licence, all rights are reserved.": "未附许可证时,保留所有权利。",
|
|
1062
1063
|
"World": "世界",
|
|
@@ -27,10 +27,14 @@ export function importNotices(importing) {
|
|
|
27
27
|
const count = importing.done !== undefined && importing.of !== undefined && importing.of > 0 ? { count: { done: importing.done, of: importing.of } } : {};
|
|
28
28
|
return [{ kind: importing.step === "stopped" ? "problem" : "info", text: texts[importing.step], key: "import", ...count }];
|
|
29
29
|
}
|
|
30
|
-
/**
|
|
31
|
-
|
|
30
|
+
/**
|
|
31
|
+
* What the page has to say of the game: the campaign's files that do not read, which the master fixes; the page being translated, or out of reach (D-406); the
|
|
32
|
+
* game system's pages being translated (D-539).
|
|
33
|
+
*/
|
|
34
|
+
export function gameNotices(problems, textsTranslating) {
|
|
32
35
|
const translation = pageTranslation();
|
|
33
36
|
const language = translation === undefined ? "" : languageName(translation.language, pageLocale()) ?? translation.language;
|
|
37
|
+
const textsLanguage = textsTranslating === undefined ? "" : languageName(textsTranslating, pageLocale()) ?? textsTranslating;
|
|
34
38
|
return [
|
|
35
39
|
...(problems === undefined || problems === 0
|
|
36
40
|
? []
|
|
@@ -40,5 +44,8 @@ export function gameNotices(problems) {
|
|
|
40
44
|
}]),
|
|
41
45
|
...(translation?.state === "translating" ? [{ kind: "info", text: t("This computer is translating the page into {language}: until then it stays in English.", { language }) }] : []),
|
|
42
46
|
...(translation?.state === "unable" ? [{ kind: "info", text: t("The page stays in English: Codex or Claude Code would translate it into {language} on this computer.", { language }) }] : []),
|
|
47
|
+
...(textsTranslating !== undefined
|
|
48
|
+
? [{ kind: "info", text: t("With your account, Codex or Claude Code is translating the game's rules into {language}: until then they stay in English.", { language: textsLanguage }) }]
|
|
49
|
+
: []),
|
|
43
50
|
];
|
|
44
51
|
}
|
package/dist/dashboard/saves.js
CHANGED
|
@@ -45,7 +45,7 @@ export function SavesView({ version, campaign, several = false }) {
|
|
|
45
45
|
read();
|
|
46
46
|
};
|
|
47
47
|
const points = saves?.reset ?? [];
|
|
48
|
-
return (_jsxs("section", { class: "saves", "aria-labelledby": "saves-title", children: [_jsx(PageHead, { section: "saves", id: "saves-title" }), saves !== undefined && (_jsxs("p", { class: "saves-lead", children: [_jsxs("strong", { children: [valueLabel(saves.mode), ":"] }), " ", modeText(saves.mode, several) ?? saves.rule, " ", _jsx("a", { href: sectionAddress("settings"), children: t("Change it in Settings.") })] })), problem !== undefined && _jsx("p", { class: "saves-said problem", role: "alert", children: problem }), said !== undefined && _jsx("p", { ref: saying, tabIndex: -1, class: said.problem ? "saves-said problem" : "saves-said", role: "status", children: said.text }), saves?.wentBack !== undefined && (_jsx(NewChat, { back: wentBackTitle(saves.wentBack, saves.saves), busy: busy, onConfirm: () => void send({ action: "new chat" }, `✓ ${t("The game goes on in the new chat: write «
|
|
48
|
+
return (_jsxs("section", { class: "saves", "aria-labelledby": "saves-title", children: [_jsx(PageHead, { section: "saves", id: "saves-title" }), saves !== undefined && (_jsxs("p", { class: "saves-lead", children: [_jsxs("strong", { children: [valueLabel(saves.mode), ":"] }), " ", modeText(saves.mode, several) ?? saves.rule, " ", _jsx("a", { href: sectionAddress("settings"), children: t("Change it in Settings.") })] })), problem !== undefined && _jsx("p", { class: "saves-said problem", role: "alert", children: problem }), said !== undefined && _jsx("p", { ref: saying, tabIndex: -1, class: said.problem ? "saves-said problem" : "saves-said", role: "status", children: said.text }), saves?.wentBack !== undefined && (_jsx(NewChat, { back: wentBackTitle(saves.wentBack, saves.saves), busy: busy, onConfirm: () => void send({ action: "new chat" }, `✓ ${t("The game goes on in the new chat: write «continue» there.")}`) })), saves?.make === true && _jsx(SaveNow, { busy: busy, onSave: (label) => void send({ action: "make", ...(label === "" ? {} : { label }) }, `✓ ${t("Saved.")}`) }), saves !== undefined && saves.saves.length === 0 && _jsx("p", { class: "saves-none", children: t("No saves yet: the game saves its start when play begins, then at the end of each scene.") }), saves !== undefined && saves.saves.length > 0 && (_jsx("ol", { class: "save-cards", children: saves.saves.map((save, index) => (_jsxs("li", { class: "save-card", children: [_jsx(SaveFace, { save: save }), save.load && (_jsx("button", { type: "button", class: "button", "aria-label": t("Go back here: {save}", { save: saveTitle(save) }), disabled: busy, onClick: () => setAsking(save), children: t("Go back here") })), saves.mode === "checkpoint" && index === 0 && !save.load && save.point === undefined && (_jsx("p", { class: "save-note", children: several ? t("Back here if they all die, or if the table chooses it when one dies") : t("Back here if your character dies") }))] }, save.number))) })), points.length > 0 && (_jsxs("section", { class: "saves-over", "aria-labelledby": "saves-over-title", children: [_jsx("h3", { id: "saves-over-title", children: t("Start over") }), _jsx("p", { children: points.length > 1
|
|
49
49
|
? t("Back to the campaign's start: everything that happened since is gone from the story, with the same character or a new one.")
|
|
50
50
|
: t("Back to the campaign's start: everything that happened since is gone from the story.") }), _jsx("button", { type: "button", class: "button danger", disabled: busy, onClick: () => setAsking("reset"), children: t("Start the campaign over…") })] })), asking !== undefined && asking !== "reset" && saves !== undefined && (_jsx(GoBack, { save: asking, later: saves.saves.filter((save) => save.number > asking.number).length, busy: busy, onClose: () => setAsking(undefined), onConfirm: () => void send({ action: "load", save: asking.number }, t("Back to {save}.", { save: saveTitle(asking) })) })), asking === "reset" && saves !== undefined && points.length > 0 && (_jsx(StartOver, { saves: saves.saves, points: points, campaign: campaign, busy: busy, onClose: () => setAsking(undefined), onConfirm: (name, to) => void send({ action: "reset", campaign: name, to }, to === "session zero" ? t("The campaign starts over, your character to make again.") : t("The campaign starts over.")) }))] }));
|
|
51
51
|
}
|
package/dist/dashboard/text.js
CHANGED
|
@@ -28,6 +28,8 @@ export const shippedLanguages = [
|
|
|
28
28
|
];
|
|
29
29
|
// Codes the page reads as another it ships: Norwegian as Bokmål.
|
|
30
30
|
const aliases = { no: "nb" };
|
|
31
|
+
// Chinese in traditional characters, whose base zh is the simplified.
|
|
32
|
+
const traditionalChinese = /^zh-(hant|tw|hk|mo)(-|$)/;
|
|
31
33
|
// The languages written from right to left, shipped or translated on the fly: the page mirrors for them.
|
|
32
34
|
const rightToLeft = ["ar", "he", "fa", "ur", "ps", "sd", "ug", "yi", "dv", "ckb"];
|
|
33
35
|
let phrases = {};
|
|
@@ -42,10 +44,13 @@ let flying;
|
|
|
42
44
|
const lacked = new Set();
|
|
43
45
|
const asked = new Set();
|
|
44
46
|
let asking;
|
|
45
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* The language the page writes in for a campaign's code: its own when shipped, else its base language's when written in the same script (pt-BR, pt; never
|
|
49
|
+
* zh-HK, zh, which is simplified), else English.
|
|
50
|
+
*/
|
|
46
51
|
export function pageLanguageOf(code) {
|
|
47
52
|
const asked = (code ?? "en").toLowerCase();
|
|
48
|
-
const base = asked.split("-")[0];
|
|
53
|
+
const base = traditionalChinese.test(asked) ? "" : asked.split("-")[0];
|
|
49
54
|
return [asked, base, aliases[base] ?? ""].find((one) => shippedLanguages.includes(one)) ?? "en";
|
|
50
55
|
}
|
|
51
56
|
/** The browser's language, where the package ships it: the page's until the setup sets the campaign's (playtest 01); none for English or another. */
|
package/dist/documents/png.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/** Raw pixels:
|
|
1
|
+
/** Raw pixels: four bytes for each, red, green, blue and alpha, row after row. */
|
|
2
2
|
export interface Pixels {
|
|
3
|
-
data: Uint8Array
|
|
3
|
+
data: Uint8Array;
|
|
4
4
|
width: number;
|
|
5
5
|
height: number;
|
|
6
|
-
channels: 1 | 3 | 4;
|
|
7
6
|
}
|
|
8
7
|
/** The pixels as a PNG, made smaller when their longer side passes `longest`. */
|
|
9
8
|
export declare function pngOf(pixels: Pixels, longest: number): Uint8Array;
|
package/dist/documents/png.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// Pixels as a PNG file, for the pictures a PDF holds as raw pixels (D-489 (8)):
|
|
1
|
+
// Pixels as a PNG file, for the pictures a PDF holds as raw pixels (D-489 (8)): RGBA, at most a size on its longer side.
|
|
2
2
|
import { zlibSync } from "fflate";
|
|
3
|
+
const channels = 4;
|
|
3
4
|
/** The pixels as a PNG, made smaller when their longer side passes `longest`. */
|
|
4
5
|
export function pngOf(pixels, longest) {
|
|
5
|
-
const { data, width, height
|
|
6
|
-
const kind = channels === 4 ? 6 : channels === 3 ? 2 : 0;
|
|
6
|
+
const { data, width, height } = smaller(pixels, longest);
|
|
7
7
|
const row = width * channels;
|
|
8
8
|
const raw = new Uint8Array((row + 1) * height);
|
|
9
9
|
for (let y = 0; y < height; y++) {
|
|
@@ -13,7 +13,8 @@ export function pngOf(pixels, longest) {
|
|
|
13
13
|
const view = new DataView(header.buffer);
|
|
14
14
|
view.setUint32(0, width);
|
|
15
15
|
view.setUint32(4, height);
|
|
16
|
-
|
|
16
|
+
// Eight bits a channel, colour type 6: RGBA.
|
|
17
|
+
header.set([8, 6, 0, 0, 0], 8);
|
|
17
18
|
return joined([new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]), chunk("IHDR", header), chunk("IDAT", zlibSync(raw, { level: 6 })), chunk("IEND", new Uint8Array(0))]);
|
|
18
19
|
}
|
|
19
20
|
// The pixels shrunk by a whole step, each new one the mean of the square it covers, until the longer side fits.
|
|
@@ -24,7 +25,6 @@ function smaller(pixels, longest) {
|
|
|
24
25
|
}
|
|
25
26
|
const width = Math.floor(pixels.width / step);
|
|
26
27
|
const height = Math.floor(pixels.height / step);
|
|
27
|
-
const { channels } = pixels;
|
|
28
28
|
const data = new Uint8Array(width * height * channels);
|
|
29
29
|
for (let y = 0; y < height; y++) {
|
|
30
30
|
for (let x = 0; x < width; x++) {
|
|
@@ -39,7 +39,7 @@ function smaller(pixels, longest) {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
return { data, width, height
|
|
42
|
+
return { data, width, height };
|
|
43
43
|
}
|
|
44
44
|
function chunk(type, body) {
|
|
45
45
|
const out = new Uint8Array(body.length + 12);
|
package/dist/documents/read.js
CHANGED
|
@@ -94,7 +94,8 @@ async function readFolder(folder, options) {
|
|
|
94
94
|
*/
|
|
95
95
|
async function readPdf(path, options) {
|
|
96
96
|
const { extractText, getDocumentProxy } = await import("unpdf");
|
|
97
|
-
|
|
97
|
+
// pdf.js says its warnings on the standard output, which is the MCP server's channel: errors only.
|
|
98
|
+
const pdf = await getDocumentProxy(new Uint8Array(readFileSync(path)), { verbosity: 0 }).catch((error) => {
|
|
98
99
|
throw error?.name === "PasswordException" ? new Error(`${basename(path)} asks for a password to open: the engine never opens a locked document.`) : error;
|
|
99
100
|
});
|
|
100
101
|
const { text } = await extractText(pdf, { mergePages: false });
|
package/dist/extensions/words.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// the names of the fields it adds to the game system, and any word or phrase its widgets write, by the English as its code writes it. The core hands them on: a word the list lacks stays as written.
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
+
import { codeAndBase } from "../core/language.js";
|
|
5
6
|
import { files } from "../core/store.js";
|
|
6
7
|
import { readYamlValues } from "../core/yaml-file.js";
|
|
7
8
|
const wordsSchema = z.object({
|
|
@@ -12,7 +13,7 @@ const wordsSchema = z.object({
|
|
|
12
13
|
}, { error: "write its title, its about, the names of its fields and its words, each from the text the code writes to the language's own, such as {words: {Weather: Meteo}}" }).strict();
|
|
13
14
|
/** The words of the extension in this folder for a language, or for its base language (pt for pt-BR); undefined when it has none in it. It throws when they do not read. */
|
|
14
15
|
export function extensionWords(folder, language) {
|
|
15
|
-
const file =
|
|
16
|
+
const file = codeAndBase(language).map((code) => join(folder, "words", `${code}.yaml`)).find((path) => files().exists(path));
|
|
16
17
|
if (file === undefined) {
|
|
17
18
|
return undefined;
|
|
18
19
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { packageFoldersIn } from "../core/files.js";
|
|
4
|
+
import { codeAndBase } from "../core/language.js";
|
|
4
5
|
import { files } from "../core/store.js";
|
|
5
6
|
import { readYamlValues } from "../core/yaml-file.js";
|
|
6
7
|
/** The file that makes a package a language's (D-485 (3)): its code and its name. */
|
|
@@ -33,8 +34,7 @@ export function installedLanguages(folders) {
|
|
|
33
34
|
/** The package for a language: its own code, else its base language's (pt for pt-BR); undefined when none is installed. */
|
|
34
35
|
export function languagePackFor(folders, code) {
|
|
35
36
|
const packs = installedLanguages(folders);
|
|
36
|
-
|
|
37
|
-
return packs.find((pack) => pack.code.toLowerCase() === wanted) ?? packs.find((pack) => pack.code.toLowerCase() === wanted.split("-")[0]);
|
|
37
|
+
return codeAndBase(code).map((wanted) => packs.find((pack) => pack.code.toLowerCase() === wanted)).find((pack) => pack !== undefined);
|
|
38
38
|
}
|
|
39
39
|
/** A language package from its folder; it throws, saying what is wrong, when it does not read. */
|
|
40
40
|
export function readLanguagePack(folder) {
|
package/dist/pages/index.d.ts
CHANGED
|
@@ -14,5 +14,5 @@ export { countedText, entryOfKind, type EntryReading, readEntry, withStackCount
|
|
|
14
14
|
export { carriesKind, carriesNamed, entryKind, entryPage, goodsNamed, type HeldStack, heldStacks, heldStacksOfKind, isKind, kindNamed, ownStack, pageNamedQuietly, type Stack, stackName, stacksOf } from "./stacks/kinds.ts";
|
|
15
15
|
export { canHold, containerFieldOf, isCoreField, isCounterField, isEmptyField, isStandardField, listFieldNames, misspelledFieldProblem, misspelledStandardField, newPageFields, standardValues } from "./standard-fields.ts";
|
|
16
16
|
export { alwaysInList, declaredKind, hidingMessage, isDeclaredUncounted, kindMessage, readOnlyMessage, systemKnowsReason, systemLabel } from "./system-pages.ts";
|
|
17
|
-
export { type Backlink, backlinks, bonusPages, concernsPlayer, createWorld, findPage, isCountedItem, isInParty, isPartyMember, isPlayerCharacter, linksIn, loadWorld, locate, namesakes, type Page, pageFileNamed, type PageMatch, pageNamed, pagesWithName, pagesWithNameOrAlias, pageWithPath, parsePageReference, playerCharacters, searchPages, searchSystemPages, systemFirstFix, type SystemInfo, systemPageNamed, type SystemPages, textsIn, validHoldersOf, withPage, type World, } from "./world.ts";
|
|
17
|
+
export { type Backlink, backlinks, bonusPages, concernsPlayer, createWorld, findPage, isCountedItem, isInParty, isPartyMember, isPlayerCharacter, linksIn, loadWorld, locate, namesakes, type Page, pageFileNamed, type PageMatch, pageNamed, pagesWithName, pagesWithNameOrAlias, pageWithPath, parsePageReference, playerCharacters, searchPages, searchSystemPages, systemFirstFix, type SystemInfo, systemPageNamed, type SystemPages, textsIn, validHoldersOf, versionTranslations, withPage, type World, } from "./world.ts";
|
|
18
18
|
export { checkFieldChange, type PageChange, writePage } from "./write-page.ts";
|
package/dist/pages/index.js
CHANGED
|
@@ -15,5 +15,5 @@ export { countedText, entryOfKind, readEntry, withStackCount } from "./stacks/en
|
|
|
15
15
|
export { carriesKind, carriesNamed, entryKind, entryPage, goodsNamed, heldStacks, heldStacksOfKind, isKind, kindNamed, ownStack, pageNamedQuietly, stackName, stacksOf } from "./stacks/kinds.js";
|
|
16
16
|
export { canHold, containerFieldOf, isCoreField, isCounterField, isEmptyField, isStandardField, listFieldNames, misspelledFieldProblem, misspelledStandardField, newPageFields, standardValues } from "./standard-fields.js";
|
|
17
17
|
export { alwaysInList, declaredKind, hidingMessage, isDeclaredUncounted, kindMessage, readOnlyMessage, systemKnowsReason, systemLabel } from "./system-pages.js";
|
|
18
|
-
export { backlinks, bonusPages, concernsPlayer, createWorld, findPage, isCountedItem, isInParty, isPartyMember, isPlayerCharacter, linksIn, loadWorld, locate, namesakes, pageFileNamed, pageNamed, pagesWithName, pagesWithNameOrAlias, pageWithPath, parsePageReference, playerCharacters, searchPages, searchSystemPages, systemFirstFix, systemPageNamed, textsIn, validHoldersOf, withPage, } from "./world.js";
|
|
18
|
+
export { backlinks, bonusPages, concernsPlayer, createWorld, findPage, isCountedItem, isInParty, isPartyMember, isPlayerCharacter, linksIn, loadWorld, locate, namesakes, pageFileNamed, pageNamed, pagesWithName, pagesWithNameOrAlias, pageWithPath, parsePageReference, playerCharacters, searchPages, searchSystemPages, systemFirstFix, systemPageNamed, textsIn, validHoldersOf, versionTranslations, withPage, } from "./world.js";
|
|
19
19
|
export { checkFieldChange, writePage } from "./write-page.js";
|
package/dist/pages/world.d.ts
CHANGED
|
@@ -105,6 +105,7 @@ export declare function loadWorld(root: string, options?: {
|
|
|
105
105
|
system?: SystemInfo & {
|
|
106
106
|
folder: string;
|
|
107
107
|
version?: {
|
|
108
|
+
name: string;
|
|
108
109
|
folder: string;
|
|
109
110
|
};
|
|
110
111
|
};
|
|
@@ -113,6 +114,8 @@ export declare function loadWorld(root: string, options?: {
|
|
|
113
114
|
missingSystem?: string;
|
|
114
115
|
noSystem?: boolean;
|
|
115
116
|
rigor?: string;
|
|
117
|
+
/** The folder of the system's pages translated on this computer into the campaign's language (D-539), where the system has no translation of its own. */
|
|
118
|
+
ownTranslations?: string;
|
|
116
119
|
}): World;
|
|
117
120
|
/**
|
|
118
121
|
* The page with this name, ignoring case and Unicode normalization: the campaign's, else the game system's (SYS-3). Two pages of the campaign with that name stop the command:
|
|
@@ -210,3 +213,5 @@ export declare function pageFileNamed(root: string, name: string): {
|
|
|
210
213
|
} | undefined;
|
|
211
214
|
/** The pages of the system's bonus lists a page names (FOR-5, D-449): an attuned ring, a feat; of a list given only while in another, only those in it too, as a ring worn (BND-4). */
|
|
212
215
|
export declare function bonusPages(world: World, fields: Record<string, unknown>): Page[];
|
|
216
|
+
/** Where a version's pages translated on this computer are, under the folder of the language's (D-539). */
|
|
217
|
+
export declare function versionTranslations(version: string): string;
|
package/dist/pages/world.js
CHANGED
|
@@ -3,7 +3,7 @@ import { isReservedName } from "../core/archive-paths.js";
|
|
|
3
3
|
import { translationFolder } from "../core/files.js";
|
|
4
4
|
import { frozen } from "../core/frozen.js";
|
|
5
5
|
import { files } from "../core/store.js";
|
|
6
|
-
import { comparableText, valueNamed } from "../core/text.js";
|
|
6
|
+
import { comparableText, textPrint, valueNamed } from "../core/text.js";
|
|
7
7
|
import { linkedPages, links } from "./markdown.js";
|
|
8
8
|
import { readFields, splitPageFile } from "./page-file.js";
|
|
9
9
|
import { pageTypes, typeOfFolder, worldFolderName } from "./page-types.js";
|
|
@@ -27,12 +27,15 @@ export function createWorld(root) {
|
|
|
27
27
|
*/
|
|
28
28
|
export function loadWorld(root, options = {}) {
|
|
29
29
|
const campaign = readPages(root);
|
|
30
|
-
const { system, language, words, missingSystem, noSystem, rigor } = options;
|
|
30
|
+
const { system, language, words, missingSystem, noSystem, rigor, ownTranslations } = options;
|
|
31
31
|
if (system === undefined) {
|
|
32
32
|
return frozen({ root, ...campaign, language, missingSystem, noSystem, ...(rigor === undefined ? {} : { rigor }) });
|
|
33
33
|
}
|
|
34
|
-
const read = (folder) => translatedPages(packagePages(folder, system.name), folder, system.name, language);
|
|
35
|
-
|
|
34
|
+
const read = (folder, own) => translatedPages(packagePages(folder, system.name), folder, system.name, language, own);
|
|
35
|
+
// A version's pages translated on this computer have a folder of their own, as their text is the version's (D-539).
|
|
36
|
+
const systemPages = system.version === undefined
|
|
37
|
+
? read(system.folder, ownTranslations)
|
|
38
|
+
: versionPages(read(system.folder, ownTranslations), read(system.version.folder, ownTranslations === undefined ? undefined : join(ownTranslations, versionTranslations(system.version.name))));
|
|
36
39
|
const { name, title, fields, formulas, progression, itemFormulas, alwaysIn, uses, statusLine, load, lengthUnit, bonusLists, bonusWhile } = system;
|
|
37
40
|
const problems = [...campaign.problems, ...systemPages.problems];
|
|
38
41
|
return frozen({
|
|
@@ -364,27 +367,35 @@ function packagePages(folder, system) {
|
|
|
364
367
|
const packages = new Map();
|
|
365
368
|
/**
|
|
366
369
|
* A system's pages with their text and their name in the campaign's language beside their own, where the system has a translation of them in it, by the same
|
|
367
|
-
* path under translations/<language> (D-542); their fields and text stay, which the engine reads. Read once in a process, as the pages are.
|
|
370
|
+
* path under translations/<language> (D-542); their fields and text stay, which the engine reads. Read once in a process, as the pages are. Where the system
|
|
371
|
+
* has none, those translated on this computer (D-539), each while the text it was made from is the page's: read through the store, as they grow.
|
|
368
372
|
*/
|
|
369
|
-
function translatedPages(read, folder, system, language) {
|
|
373
|
+
function translatedPages(read, folder, system, language, own) {
|
|
370
374
|
const translations = translationFolder(folder, language);
|
|
371
375
|
if (translations === undefined) {
|
|
372
|
-
return read;
|
|
376
|
+
return own === undefined ? read : withTranslations(read, readPages(own, system), true);
|
|
373
377
|
}
|
|
374
378
|
const key = `${translations}|${system}`;
|
|
375
|
-
const known = translated.get(key) ?? withTranslations(read, readPages(translations, system));
|
|
379
|
+
const known = translated.get(key) ?? withTranslations(read, readPages(translations, system), false);
|
|
376
380
|
translated.set(key, known);
|
|
377
381
|
return known;
|
|
378
382
|
}
|
|
379
383
|
const translated = new Map();
|
|
380
|
-
function withTranslations(read, translations) {
|
|
384
|
+
function withTranslations(read, translations, printed) {
|
|
381
385
|
const byPath = new Map(translations.pages.map((page) => [page.path, page]));
|
|
382
386
|
const pages = read.pages.map((page) => {
|
|
383
|
-
const
|
|
387
|
+
const found = byPath.get(page.path);
|
|
388
|
+
// A translation made on this computer from a text the system has since changed is no longer the page's.
|
|
389
|
+
const other = printed && found?.fields.source !== textPrint(page.body) ? undefined : found;
|
|
384
390
|
const title = typeof other?.fields.name === "string" && other.fields.name.trim() !== "" ? other.fields.name.trim() : undefined;
|
|
385
391
|
return other === undefined ? page : frozen({ ...page, translated: other.body, ...(title === undefined ? {} : { title }) });
|
|
386
392
|
});
|
|
387
|
-
|
|
393
|
+
// A file of this computer's that does not read is no problem of the campaign's: the page is translated again, over it.
|
|
394
|
+
return { pages, problems: printed ? read.problems : [...read.problems, ...translations.problems] };
|
|
395
|
+
}
|
|
396
|
+
/** Where a version's pages translated on this computer are, under the folder of the language's (D-539). */
|
|
397
|
+
export function versionTranslations(version) {
|
|
398
|
+
return join("versions", version);
|
|
388
399
|
}
|
|
389
400
|
/** A system's pages with those of the version of its rules over them (VER-3): a page of the version takes the place of a common one with its name. */
|
|
390
401
|
function versionPages(common, version) {
|