@celljs/ta-web 4.19.0 → 4.21.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.
Files changed (145) hide show
  1. package/esm/browser/account/device-account.d.ts +65 -1
  2. package/esm/browser/account/device-account.js +206 -6
  3. package/esm/browser/assistant/assistant-chat-list.js +2 -1
  4. package/esm/browser/assistant/call-turn-end.d.ts +55 -0
  5. package/esm/browser/assistant/call-turn-end.js +68 -0
  6. package/esm/browser/assistant/realtime-voice.js +3 -3
  7. package/esm/browser/assistant/voice-call.d.ts +19 -28
  8. package/esm/browser/assistant/voice-call.js +64 -51
  9. package/esm/browser/components/account-menu.d.ts +9 -4
  10. package/esm/browser/components/account-menu.js +59 -20
  11. package/esm/browser/components/account-view.d.ts +33 -7
  12. package/esm/browser/components/account-view.js +140 -79
  13. package/esm/browser/components/app-view.js +2 -2
  14. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  15. package/esm/browser/components/cloud-sign-in-view.js +4 -1
  16. package/esm/browser/components/dino-look.d.ts +9 -1
  17. package/esm/browser/components/dino-look.js +46 -1
  18. package/esm/browser/components/environment-view.js +12 -1
  19. package/esm/browser/components/face-pictures.d.ts +10 -0
  20. package/esm/browser/components/face-pictures.js +24 -0
  21. package/esm/browser/components/face.d.ts +4 -1
  22. package/esm/browser/components/face.js +16 -1
  23. package/esm/browser/components/host-view.d.ts +15 -8
  24. package/esm/browser/components/host-view.js +23 -70
  25. package/esm/browser/components/me-view.d.ts +2 -2
  26. package/esm/browser/components/me-view.js +7 -6
  27. package/esm/browser/components/picture-dialog.d.ts +18 -0
  28. package/esm/browser/components/picture-dialog.js +116 -0
  29. package/esm/browser/components/profile-view.d.ts +11 -0
  30. package/esm/browser/components/profile-view.js +85 -0
  31. package/esm/browser/components/workbench-view.js +42 -7
  32. package/esm/browser/extension/icons.js +2 -1
  33. package/esm/browser/extension/web-api-components.d.ts +2 -2
  34. package/esm/browser/extension/web-api-home.d.ts +13 -0
  35. package/esm/browser/extension/web-api-home.js +2 -0
  36. package/esm/browser/extension/web-extension-api.d.ts +4 -4
  37. package/esm/browser/extension/web-extension-context.js +2 -1
  38. package/esm/browser/extension/web-home.d.ts +8 -0
  39. package/esm/browser/extension/web-home.js +20 -0
  40. package/esm/browser/gateway/console-limits.d.ts +15 -0
  41. package/esm/browser/gateway/console-limits.js +2 -2
  42. package/esm/browser/gateway/console-tenant.js +33 -2
  43. package/esm/browser/gateway/console-updates.d.ts +12 -0
  44. package/esm/browser/gateway/console-updates.js +76 -0
  45. package/esm/browser/gateway/console-util.d.ts +7 -1
  46. package/esm/browser/gateway/console-util.js +18 -0
  47. package/esm/browser/gateway/console-view.js +9 -2
  48. package/esm/browser/i18n/locales.d.ts +55 -3
  49. package/esm/browser/i18n/locales.js +9 -3
  50. package/esm/browser/i18n/messages-all.d.ts +7 -0
  51. package/esm/browser/i18n/messages-all.js +14 -0
  52. package/esm/browser/i18n/messages-ja.js +54 -4
  53. package/esm/browser/i18n/messages-zh-tw.js +54 -4
  54. package/esm/browser/i18n/messages.d.ts +56 -8
  55. package/esm/browser/i18n/messages.js +141 -19
  56. package/esm/browser/i18n/use-t.js +4 -3
  57. package/esm/browser/settings/settings.js +3 -1
  58. package/esm/browser/style/conversation-column.d.ts +1 -1
  59. package/esm/browser/style/conversation-column.js +2 -1
  60. package/esm/browser/style/dialogs.d.ts +1 -1
  61. package/esm/browser/style/dialogs.js +6 -0
  62. package/esm/browser/style/pages.d.ts +1 -1
  63. package/esm/browser/style/pages.js +11 -0
  64. package/esm/browser/style/surfaces.d.ts +1 -1
  65. package/esm/browser/style/surfaces.js +1 -0
  66. package/esm/browser/util/picture.d.ts +5 -0
  67. package/esm/browser/util/picture.js +43 -0
  68. package/esm/browser/util/turn-end.d.ts +8 -0
  69. package/esm/browser/util/turn-end.js +78 -35
  70. package/esm/browser/workbench-hosts.d.ts +4 -1
  71. package/esm/browser/workbench-hosts.js +17 -0
  72. package/esm/browser/workbench-protocol.d.ts +8 -0
  73. package/lib/browser/account/device-account.d.ts +65 -1
  74. package/lib/browser/account/device-account.js +206 -6
  75. package/lib/browser/assistant/assistant-chat-list.js +2 -1
  76. package/lib/browser/assistant/call-turn-end.d.ts +56 -0
  77. package/lib/browser/assistant/call-turn-end.js +72 -0
  78. package/lib/browser/assistant/realtime-voice.js +3 -3
  79. package/lib/browser/assistant/voice-call.d.ts +19 -28
  80. package/lib/browser/assistant/voice-call.js +67 -54
  81. package/lib/browser/components/account-menu.d.ts +9 -4
  82. package/lib/browser/components/account-menu.js +57 -18
  83. package/lib/browser/components/account-view.d.ts +33 -7
  84. package/lib/browser/components/account-view.js +142 -77
  85. package/lib/browser/components/app-view.js +1 -1
  86. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  87. package/lib/browser/components/cloud-sign-in-view.js +4 -1
  88. package/lib/browser/components/dino-look.d.ts +9 -1
  89. package/lib/browser/components/dino-look.js +48 -1
  90. package/lib/browser/components/environment-view.js +11 -0
  91. package/lib/browser/components/face-pictures.d.ts +11 -0
  92. package/lib/browser/components/face-pictures.js +60 -0
  93. package/lib/browser/components/face.d.ts +4 -1
  94. package/lib/browser/components/face.js +16 -1
  95. package/lib/browser/components/host-view.d.ts +15 -8
  96. package/lib/browser/components/host-view.js +22 -68
  97. package/lib/browser/components/me-view.d.ts +2 -2
  98. package/lib/browser/components/me-view.js +7 -6
  99. package/lib/browser/components/picture-dialog.d.ts +19 -0
  100. package/lib/browser/components/picture-dialog.js +153 -0
  101. package/lib/browser/components/profile-view.d.ts +12 -0
  102. package/lib/browser/components/profile-view.js +123 -0
  103. package/lib/browser/components/workbench-view.js +39 -4
  104. package/lib/browser/extension/icons.js +1 -0
  105. package/lib/browser/extension/web-api-components.d.ts +2 -2
  106. package/lib/browser/extension/web-api-home.d.ts +14 -0
  107. package/lib/browser/extension/web-api-home.js +3 -0
  108. package/lib/browser/extension/web-extension-api.d.ts +4 -4
  109. package/lib/browser/extension/web-extension-context.js +2 -1
  110. package/lib/browser/extension/web-home.d.ts +8 -0
  111. package/lib/browser/extension/web-home.js +54 -1
  112. package/lib/browser/gateway/console-limits.d.ts +15 -0
  113. package/lib/browser/gateway/console-limits.js +2 -0
  114. package/lib/browser/gateway/console-tenant.js +32 -1
  115. package/lib/browser/gateway/console-updates.d.ts +13 -0
  116. package/lib/browser/gateway/console-updates.js +113 -0
  117. package/lib/browser/gateway/console-util.d.ts +7 -1
  118. package/lib/browser/gateway/console-util.js +18 -0
  119. package/lib/browser/gateway/console-view.js +9 -2
  120. package/lib/browser/i18n/locales.d.ts +55 -3
  121. package/lib/browser/i18n/locales.js +8 -2
  122. package/lib/browser/i18n/messages-all.d.ts +8 -0
  123. package/lib/browser/i18n/messages-all.js +17 -0
  124. package/lib/browser/i18n/messages-ja.js +54 -4
  125. package/lib/browser/i18n/messages-zh-tw.js +54 -4
  126. package/lib/browser/i18n/messages.d.ts +56 -8
  127. package/lib/browser/i18n/messages.js +143 -21
  128. package/lib/browser/i18n/use-t.js +4 -3
  129. package/lib/browser/settings/settings.js +3 -1
  130. package/lib/browser/style/conversation-column.d.ts +1 -1
  131. package/lib/browser/style/conversation-column.js +2 -1
  132. package/lib/browser/style/dialogs.d.ts +1 -1
  133. package/lib/browser/style/dialogs.js +6 -0
  134. package/lib/browser/style/pages.d.ts +1 -1
  135. package/lib/browser/style/pages.js +11 -0
  136. package/lib/browser/style/surfaces.d.ts +1 -1
  137. package/lib/browser/style/surfaces.js +1 -0
  138. package/lib/browser/util/picture.d.ts +6 -0
  139. package/lib/browser/util/picture.js +46 -0
  140. package/lib/browser/util/turn-end.d.ts +8 -0
  141. package/lib/browser/util/turn-end.js +78 -35
  142. package/lib/browser/workbench-hosts.d.ts +4 -1
  143. package/lib/browser/workbench-hosts.js +17 -0
  144. package/lib/browser/workbench-protocol.d.ts +8 -0
  145. package/package.json +7 -7
@@ -0,0 +1,14 @@
1
+ import { EN_MESSAGES, ZH_MESSAGES } from './messages.js';
2
+ import { JA_MESSAGES } from './messages-ja.js';
3
+ import { ZH_TW_MESSAGES } from './messages-zh-tw.js';
4
+ /**
5
+ * The messages of each language of Ta, checked by scripts/check-i18n.ts. Not for the page, which loads Traditional
6
+ * Chinese and Japanese as they are chosen (`loadMessages`): imported there, they would be in its first code again.
7
+ */
8
+ export const MESSAGES = {
9
+ 'zh-CN': ZH_MESSAGES,
10
+ 'zh-TW': ZH_TW_MESSAGES,
11
+ 'en-US': EN_MESSAGES,
12
+ 'ja-JP': JA_MESSAGES,
13
+ };
14
+ //# sourceMappingURL=messages-all.js.map
@@ -376,6 +376,36 @@ export const JA_MESSAGES = {
376
376
  'ta.console.manage': '管理',
377
377
  'ta.console.sandbox': 'サンドボックス',
378
378
  'ta.console.about': '基本情報',
379
+ 'ta.console.updatesAvailable': '{count} 台の Ta を {version} に更新できます',
380
+ 'ta.console.updateAll': 'すべて更新',
381
+ 'ta.console.updateAllConfirm': '{count} 台の Ta を {version} に更新しますか?',
382
+ 'ta.console.updateAllDetail': '1 台ずつ更新します。停止して新しいバージョンで起動し、作業は続きから再開します。起動できない Ta は元のバージョンに戻り、残りは更新しません。',
383
+ 'ta.console.updatingProgress': '更新中 {done}/{total}',
384
+ 'ta.console.update': '更新',
385
+ 'ta.console.updateConfirm': '{account} の Ta を {version} に更新しますか?',
386
+ 'ta.console.updateDetail': '停止して新しいバージョンで起動し、作業は続きから再開します。起動できなければ元のバージョンに戻ります。',
387
+ 'ta.console.updateWorking': '{count} 件の会話が進行中です。一時停止し、起動後に続きから再開します。',
388
+ 'ta.console.rollback': '前のバージョン({version})に戻す',
389
+ 'ta.console.rollbackConfirm': '{account} の Ta を {version} に戻しますか?',
390
+ 'ta.console.rollbackDetail': '前のバージョンで再起動し、手動で更新するまでこのバージョンには自動で更新しません。',
391
+ 'ta.console.version': 'バージョン',
392
+ 'ta.console.updatable': '更新あり',
393
+ 'ta.console.updates': '更新',
394
+ 'ta.console.updatesHint': '起動する Ta は常に最新バージョンを使います。起動できなければ自動で元のバージョンに戻ります。',
395
+ 'ta.console.updateMode': '実行中の Ta',
396
+ 'ta.console.updateIdle': 'アイドル時に自動更新',
397
+ 'ta.console.updateIdleHint': '進行中の会話がなく、10 分間動きがないとき',
398
+ 'ta.console.updateManual': '手動で更新',
399
+ 'ta.console.updateManualHint': 'アカウントページで「更新」したとき',
400
+ 'ta.console.checkUpdates': '新しいバージョンを確認',
401
+ 'ta.console.checked': '{count, plural, =0 {すべての Ta が最新バージョンです} other {# 台の Ta を更新できます}}',
402
+ 'ta.console.auditUpdate': '更新:',
403
+ 'ta.console.auditUpdateAll': 'すべての Ta を更新',
404
+ 'ta.console.auditRollback': '前のバージョンに戻した:',
405
+ 'ta.console.auditUpdatePolicy': '更新方法を変更',
406
+ 'ta.environment.newVersion': '新しいバージョン {version}',
407
+ 'ta.environment.newVersionIdle': 'アイドル時に自動で更新されます。今すぐ更新すると作業は一時停止し、続きから再開します。',
408
+ 'ta.environment.newVersionManual': '今すぐ更新します。作業は一時停止し、続きから再開します。',
379
409
  'ta.access.title': 'アクセス',
380
410
  'ta.access.bind': 'アカウントでサインイン',
381
411
  'ta.access.bindHint': 'サインインに使用するアカウントを許可するため、次回以降は任意のデバイスでサインインできます。',
@@ -631,6 +661,15 @@ export const JA_MESSAGES = {
631
661
  'ta.assistant.rename': '名前変更',
632
662
  'ta.assistant.prompt': 'システムプロンプト',
633
663
  'ta.assistant.look': '外見',
664
+ 'ta.picture.title': '私のアイコン',
665
+ 'ta.picture.hint': 'グループチャットと友だちに見えるあなた。分身は恐竜のままです。',
666
+ 'ta.picture.choose': '写真を選ぶ・撮る',
667
+ 'ta.picture.draw': 'Ta に描いてもらう',
668
+ 'ta.picture.reset': '恐竜に戻す',
669
+ 'ta.picture.drawPlaceholder': '何を描く?例:ヘッドホンをした柴犬',
670
+ 'ta.picture.drawSend': '描いてもらう',
671
+ 'ta.picture.tooLarge': 'この写真は十分に小さくできません。別の写真を試してください。',
672
+ 'ta.picture.drawPrompt': 'グループチャットと友だちに見せる私のアイコンを描いて:{what}。256 × 256 の正方形、主題は中央、文字なし。SVG か PNG で 11 KB 以内。描けたらまず見せて、私が OK と言ってから `ta call @celljs/ta-rooms picture /ファイルの絶対パス` で私のアイコンに設定して。直してほしいと言ったら、先に描き直して見せて。',
634
673
  'ta.look.title': '分身の外見',
635
674
  'ta.look.species': '恐竜',
636
675
  'ta.look.gait': '歩き方',
@@ -834,7 +873,7 @@ export const JA_MESSAGES = {
834
873
  'ta.settings.version': 'バージョン',
835
874
  'ta.settings.cwd': 'デフォルトのディレクトリ',
836
875
  'ta.settings.signOut': 'ログアウト',
837
- 'ta.account.switchSignIn': 'ログインを切り替え',
876
+ 'ta.account.switchSignIn': 'アカウントを切り替え',
838
877
  'ta.chat': '会話',
839
878
  'ta.sidebar': 'サイドバー',
840
879
  'ta.chat.new': '新しい会話',
@@ -1335,7 +1374,7 @@ export const JA_MESSAGES = {
1335
1374
  'ta.auth.hintRemote': '認証情報は Ta を実行しているマシンにのみ保存されます。',
1336
1375
  'ta.auth.later': '後で',
1337
1376
  'ta.hosts.title': 'コンピュータ',
1338
- 'ta.myDevices.title': 'アカウントとデバイス',
1377
+ 'ta.myDevices.title': 'マイデバイス',
1339
1378
  'ta.myDevices.hint': 'パソコンとスマホで同じアカウントにログインすると、互いに自動で表示されます。コードの読み取りは不要です。',
1340
1379
  'ta.myDevices.signInWith': '{name} でログイン',
1341
1380
  'ta.myDevices.enterCode': '{name} でこのコードを入力',
@@ -1355,11 +1394,22 @@ export const JA_MESSAGES = {
1355
1394
  'ta.myDevices.remove': '削除',
1356
1395
  'ta.myDevices.removeConfirm': '{name} をアカウントから削除しますか? あなたのパソコンに接続できなくなります。',
1357
1396
  'ta.myDevices.signOut': 'ログアウト',
1358
- 'ta.myDevices.signOutConfirm': 'アカウントからログアウトしますか? アカウントで追加されたパソコンはこのデバイスから外れ、コードで接続したものは残ります。',
1359
- 'ta.myDevices.signOutConfirmComputer': 'アカウントからログアウトしますか? アカウントで追加したデバイスはこのパソコンに接続できなくなります。',
1397
+ 'ta.myDevices.signOutConfirm': 'ログアウトしますか? アカウントのパソコンとクラウドの Ta はこのデバイスから外れ、コードで接続したものは残ります。',
1398
+ 'ta.myDevices.signOutConfirmComputer': 'ログアウトしますか? このパソコンはアカウントから外れ、アカウントで追加したデバイスは接続できなくなります。',
1360
1399
  'ta.myDevices.none': 'まだこのデバイスだけです。ほかのパソコンやスマホで同じアカウントにログインしてください。',
1361
1400
  'ta.myDevices.open': '開く',
1362
1401
  'ta.myDevices.signInAccount': 'アカウントでログイン',
1402
+ 'ta.myDevices.others': 'ほかのデバイス',
1403
+ 'ta.myDevices.computersComing': 'パソコンの Ta で同じアカウントにログインすると、ここに自動で表示されます。',
1404
+ 'ta.me.profile': 'プロフィール',
1405
+ 'ta.me.picture': 'アイコン',
1406
+ 'ta.me.name': '名前',
1407
+ 'ta.me.nameHint': '友だちやグループで表示される名前',
1408
+ 'ta.me.account': 'アカウント',
1409
+ 'ta.me.noAccount': '未ログイン',
1410
+ 'ta.me.companyAccount': '会社のアカウント',
1411
+ 'ta.me.recent': '最近のログイン',
1412
+ 'ta.me.profileHint': '友だちやグループにはこのアイコンと名前が表示されます。同じアカウントのパソコンで共有されます。',
1363
1413
  'ta.hosts.scan': 'スキャンして接続',
1364
1414
  'ta.hosts.scanShort': 'スキャン',
1365
1415
  'ta.hosts.paste': 'リンクを貼り付け',
@@ -377,6 +377,36 @@ export const ZH_TW_MESSAGES = {
377
377
  'ta.console.manage': '管理',
378
378
  'ta.console.sandbox': '沙箱',
379
379
  'ta.console.about': '基本資訊',
380
+ 'ta.console.updatesAvailable': '{count} 台 Ta 可以更新到 {version}',
381
+ 'ta.console.updateAll': '全部更新',
382
+ 'ta.console.updateAllConfirm': '把 {count} 台 Ta 更新到 {version}?',
383
+ 'ta.console.updateAllDetail': '一台接一台地更新:先停下,再用新版本啟動,之前在做的事會接著做。有一台起不來時,它會自動回到原來的版本,其餘的不再更新。',
384
+ 'ta.console.updatingProgress': '正在更新 {done}/{total}',
385
+ 'ta.console.update': '更新',
386
+ 'ta.console.updateConfirm': '把 {account} 的 Ta 更新到 {version}?',
387
+ 'ta.console.updateDetail': '會先停下,再用新版本啟動,之前在做的事會接著做;起不來會自動回到原來的版本。',
388
+ 'ta.console.updateWorking': '有 {count} 個對話正在進行,會暫停,啟動後接著做。',
389
+ 'ta.console.rollback': '回到上一版({version})',
390
+ 'ta.console.rollbackConfirm': '把 {account} 的 Ta 回到 {version}?',
391
+ 'ta.console.rollbackDetail': '會用上一版重新啟動,之後不會再自動更新到這個版本,直到手動更新。',
392
+ 'ta.console.version': '版本',
393
+ 'ta.console.updatable': '可更新',
394
+ 'ta.console.updates': '更新',
395
+ 'ta.console.updatesHint': '新啟動的 Ta 都用最新版本;起不來時會自動回到原來的版本。',
396
+ 'ta.console.updateMode': '執行中的 Ta',
397
+ 'ta.console.updateIdle': '閒置時自動更新',
398
+ 'ta.console.updateIdleHint': '沒有對話在進行、10 分鐘沒有動靜時',
399
+ 'ta.console.updateManual': '手動更新',
400
+ 'ta.console.updateManualHint': '在帳號頁點「更新」時',
401
+ 'ta.console.checkUpdates': '檢查新版本',
402
+ 'ta.console.checked': '{count, plural, =0 {所有 Ta 都是最新版本} other {# 台 Ta 可以更新}}',
403
+ 'ta.console.auditUpdate': '更新了',
404
+ 'ta.console.auditUpdateAll': '更新了全部 Ta',
405
+ 'ta.console.auditRollback': '回退了',
406
+ 'ta.console.auditUpdatePolicy': '修改了更新方式',
407
+ 'ta.environment.newVersion': '有新版本 {version}',
408
+ 'ta.environment.newVersionIdle': '閒置時會自動更新;也可以現在更新,正在做的事會暫停後接著做。',
409
+ 'ta.environment.newVersionManual': '現在更新,正在做的事會暫停後接著做。',
380
410
  'ta.access.title': '存取',
381
411
  'ta.access.bind': '用你的帳號登入',
382
412
  'ta.access.bindHint': '允許你登入用的這個帳號,以後在任何裝置上都能用它登入。',
@@ -632,6 +662,15 @@ export const ZH_TW_MESSAGES = {
632
662
  'ta.assistant.rename': '重新命名',
633
663
  'ta.assistant.prompt': '系統提示詞',
634
664
  'ta.assistant.look': '形象',
665
+ 'ta.picture.title': '我的頭像',
666
+ 'ta.picture.hint': '群聊和好友裡別人看到的你,分身仍是恐龍。',
667
+ 'ta.picture.choose': '從相簿選擇或拍照',
668
+ 'ta.picture.draw': '讓 Ta 畫一個',
669
+ 'ta.picture.reset': '換回恐龍',
670
+ 'ta.picture.drawPlaceholder': '畫成什麼樣?比如:戴耳機的柴犬',
671
+ 'ta.picture.drawSend': '開始畫',
672
+ 'ta.picture.tooLarge': '這張照片壓不到夠小,換一張試試。',
673
+ 'ta.picture.drawPrompt': '給我畫一個頭像,別人在群聊和好友裡看到的就是它:{what}。正方形 256 × 256,主體置中,不要文字;SVG 或 PNG,11 KB 以內。畫好先給我看,等我說好了再用 `ta call @celljs/ta-rooms picture /檔案的絕對路徑` 設成我的頭像;我要改就先改好再給我看。',
635
674
  'ta.look.title': '分身形象',
636
675
  'ta.look.species': '恐龍',
637
676
  'ta.look.gait': '走路',
@@ -835,7 +874,7 @@ export const ZH_TW_MESSAGES = {
835
874
  'ta.settings.version': '版本',
836
875
  'ta.settings.cwd': '預設目錄',
837
876
  'ta.settings.signOut': '退出登入',
838
- 'ta.account.switchSignIn': '切換登入',
877
+ 'ta.account.switchSignIn': '切換帳號',
839
878
  'ta.chat': '對話',
840
879
  'ta.sidebar': '側欄',
841
880
  'ta.chat.new': '新對話',
@@ -1336,7 +1375,7 @@ export const ZH_TW_MESSAGES = {
1336
1375
  'ta.auth.hintRemote': '憑據只儲存在執行 Ta 的機器上。',
1337
1376
  'ta.auth.later': '稍後再說',
1338
1377
  'ta.hosts.title': '電腦',
1339
- 'ta.myDevices.title': '帳號與裝置',
1378
+ 'ta.myDevices.title': '我的裝置',
1340
1379
  'ta.myDevices.hint': '電腦和手機登入同一個帳號,彼此自動出現,不用掃碼。',
1341
1380
  'ta.myDevices.signInWith': '使用 {name} 登入',
1342
1381
  'ta.myDevices.enterCode': '在 {name} 輸入這串碼',
@@ -1356,11 +1395,22 @@ export const ZH_TW_MESSAGES = {
1356
1395
  'ta.myDevices.remove': '移除',
1357
1396
  'ta.myDevices.removeConfirm': '從帳號移除 {name}?它將無法再連線你的電腦。',
1358
1397
  'ta.myDevices.signOut': '登出帳號',
1359
- 'ta.myDevices.signOutConfirm': '登出帳號?帳號帶來的電腦會從這台裝置移除,掃碼連線的保留。',
1360
- 'ta.myDevices.signOutConfirmComputer': '登出帳號?帳號帶來的裝置將無法再連線這台電腦。',
1398
+ 'ta.myDevices.signOutConfirm': '登出?帳號帶來的電腦和雲端 Ta 會從這台裝置移除,掃碼連線的保留。',
1399
+ 'ta.myDevices.signOutConfirmComputer': '登出?這台電腦會登出帳號,帳號帶來的裝置將無法再連線它。',
1361
1400
  'ta.myDevices.none': '目前只有這台裝置。在其他電腦和手機上登入同一個帳號即可。',
1362
1401
  'ta.myDevices.open': '開啟',
1363
1402
  'ta.myDevices.signInAccount': '用帳號登入',
1403
+ 'ta.myDevices.others': '其他裝置',
1404
+ 'ta.myDevices.computersComing': '在電腦上的 Ta 裡登入同一個帳號,電腦會自動出現在這裡。',
1405
+ 'ta.me.profile': '個人資料',
1406
+ 'ta.me.picture': '頭像',
1407
+ 'ta.me.name': '名字',
1408
+ 'ta.me.nameHint': '好友和群組裡看到的名字',
1409
+ 'ta.me.account': '帳號',
1410
+ 'ta.me.noAccount': '未登入',
1411
+ 'ta.me.companyAccount': '公司帳號',
1412
+ 'ta.me.recent': '最近登入',
1413
+ 'ta.me.profileHint': '好友和群組裡看到的是這裡的頭像和名字,同帳號的電腦共用。',
1364
1414
  'ta.hosts.scan': '掃碼連線',
1365
1415
  'ta.hosts.scanShort': '掃一掃',
1366
1416
  'ta.hosts.paste': '貼上連結',
@@ -1,6 +1,3 @@
1
- import { type TaLanguage } from '@celljs/ta-protocol';
2
- import { JA_MESSAGES } from './messages-ja.js';
3
- import { ZH_TW_MESSAGES } from './messages-zh-tw.js';
4
1
  /** The messages of the web client, in ICU format. English is the source and the fallback. */
5
2
  export declare const EN_MESSAGES: {
6
3
  'ta.dismiss': string;
@@ -380,6 +377,36 @@ export declare const EN_MESSAGES: {
380
377
  'ta.console.manage': string;
381
378
  'ta.console.sandbox': string;
382
379
  'ta.console.about': string;
380
+ 'ta.console.updatesAvailable': string;
381
+ 'ta.console.updateAll': string;
382
+ 'ta.console.updateAllConfirm': string;
383
+ 'ta.console.updateAllDetail': string;
384
+ 'ta.console.updatingProgress': string;
385
+ 'ta.console.update': string;
386
+ 'ta.console.updateConfirm': string;
387
+ 'ta.console.updateDetail': string;
388
+ 'ta.console.updateWorking': string;
389
+ 'ta.console.rollback': string;
390
+ 'ta.console.rollbackConfirm': string;
391
+ 'ta.console.rollbackDetail': string;
392
+ 'ta.console.version': string;
393
+ 'ta.console.updatable': string;
394
+ 'ta.console.updates': string;
395
+ 'ta.console.updatesHint': string;
396
+ 'ta.console.updateMode': string;
397
+ 'ta.console.updateIdle': string;
398
+ 'ta.console.updateIdleHint': string;
399
+ 'ta.console.updateManual': string;
400
+ 'ta.console.updateManualHint': string;
401
+ 'ta.console.checkUpdates': string;
402
+ 'ta.console.checked': string;
403
+ 'ta.console.auditUpdate': string;
404
+ 'ta.console.auditUpdateAll': string;
405
+ 'ta.console.auditRollback': string;
406
+ 'ta.console.auditUpdatePolicy': string;
407
+ 'ta.environment.newVersion': string;
408
+ 'ta.environment.newVersionIdle': string;
409
+ 'ta.environment.newVersionManual': string;
383
410
  'ta.access.title': string;
384
411
  'ta.access.bind': string;
385
412
  'ta.access.bindHint': string;
@@ -635,6 +662,15 @@ export declare const EN_MESSAGES: {
635
662
  'ta.assistant.rename': string;
636
663
  'ta.assistant.prompt': string;
637
664
  'ta.assistant.look': string;
665
+ 'ta.picture.title': string;
666
+ 'ta.picture.hint': string;
667
+ 'ta.picture.choose': string;
668
+ 'ta.picture.draw': string;
669
+ 'ta.picture.reset': string;
670
+ 'ta.picture.drawPlaceholder': string;
671
+ 'ta.picture.drawSend': string;
672
+ 'ta.picture.tooLarge': string;
673
+ 'ta.picture.drawPrompt': string;
638
674
  'ta.look.title': string;
639
675
  'ta.look.species': string;
640
676
  'ta.look.gait': string;
@@ -1364,6 +1400,17 @@ export declare const EN_MESSAGES: {
1364
1400
  'ta.myDevices.none': string;
1365
1401
  'ta.myDevices.open': string;
1366
1402
  'ta.myDevices.signInAccount': string;
1403
+ 'ta.myDevices.others': string;
1404
+ 'ta.myDevices.computersComing': string;
1405
+ 'ta.me.profile': string;
1406
+ 'ta.me.picture': string;
1407
+ 'ta.me.name': string;
1408
+ 'ta.me.nameHint': string;
1409
+ 'ta.me.account': string;
1410
+ 'ta.me.noAccount': string;
1411
+ 'ta.me.companyAccount': string;
1412
+ 'ta.me.recent': string;
1413
+ 'ta.me.profileHint': string;
1367
1414
  'ta.hosts.scan': string;
1368
1415
  'ta.hosts.scanShort': string;
1369
1416
  'ta.hosts.paste': string;
@@ -1477,10 +1524,11 @@ export declare const EN_MESSAGES: {
1477
1524
  };
1478
1525
  export type MessageId = keyof typeof EN_MESSAGES;
1479
1526
  export declare const ZH_MESSAGES: Record<MessageId, string>;
1480
- export { JA_MESSAGES, ZH_TW_MESSAGES };
1481
- /** The messages of each language of Ta, checked by scripts/check-i18n.ts. */
1482
- export declare const MESSAGES: Readonly<Record<TaLanguage, Record<MessageId, string>>>;
1483
- /** The messages of a language of the settings (`zh-CN`, `zh-TW`, `ja-JP`), English for another. */
1484
- export declare function messagesOf(language: string): Record<MessageId, string>;
1527
+ type Messages = Record<MessageId, string>;
1528
+ /** The messages of a language of the settings (`zh-CN`, `zh-TW`, `ja-JP`), English for another and until loaded. */
1529
+ export declare function messagesOf(language: string): Messages;
1530
+ /** The messages of a language, loaded once; English for a language that fails to load. */
1531
+ export declare function loadMessages(language: string): Promise<Messages>;
1485
1532
  /** A message outside React, in a language of the settings. */
1486
1533
  export declare function message(language: string, id: MessageId): string;
1534
+ export {};
@@ -1,6 +1,4 @@
1
1
  import { TaLanguageUtil } from '@celljs/ta-protocol';
2
- import { JA_MESSAGES } from './messages-ja.js';
3
- import { ZH_TW_MESSAGES } from './messages-zh-tw.js';
4
2
  /** The messages of the web client, in ICU format. English is the source and the fallback. */
5
3
  export const EN_MESSAGES = {
6
4
  'ta.dismiss': 'Dismiss',
@@ -384,6 +382,36 @@ export const EN_MESSAGES = {
384
382
  'ta.console.manage': 'Manage',
385
383
  'ta.console.sandbox': 'Sandbox',
386
384
  'ta.console.about': 'About',
385
+ 'ta.console.updatesAvailable': '{count, plural, one {# Ta runs} other {# Ta run}} a version older than {version}',
386
+ 'ta.console.updateAll': 'Update all',
387
+ 'ta.console.updateAllConfirm': 'Update {count, plural, one {# Ta} other {# Ta}} to {version}?',
388
+ 'ta.console.updateAllDetail': 'One after another: each stops, starts on the new version and goes on with what it was doing. One that does not start goes back to its version, and the rest wait.',
389
+ 'ta.console.updatingProgress': 'Updating {done} of {total}',
390
+ 'ta.console.update': 'Update',
391
+ 'ta.console.updateConfirm': 'Update the Ta of {account} to {version}?',
392
+ 'ta.console.updateDetail': 'It stops and starts on the new version, and what it was doing goes on. If it does not start, it goes back to its version.',
393
+ 'ta.console.updateWorking': '{count, plural, one {# conversation is} other {# conversations are}} at work: they pause and go on once it starts.',
394
+ 'ta.console.rollback': 'Go back to {version}',
395
+ 'ta.console.rollbackConfirm': 'Take the Ta of {account} back to {version}?',
396
+ 'ta.console.rollbackDetail': 'It restarts on the version before, and stays on it until it is updated by hand.',
397
+ 'ta.console.version': 'Version',
398
+ 'ta.console.updatable': 'Update ready',
399
+ 'ta.console.updates': 'Updates',
400
+ 'ta.console.updatesHint': 'A Ta that starts runs the latest version; one that does not start goes back to the version before by itself.',
401
+ 'ta.console.updateMode': 'Running Ta',
402
+ 'ta.console.updateIdle': 'Update when idle',
403
+ 'ta.console.updateIdleHint': 'Once no conversation is at work and nothing happened for 10 minutes',
404
+ 'ta.console.updateManual': 'Update by hand',
405
+ 'ta.console.updateManualHint': 'When Update is tapped on its account page',
406
+ 'ta.console.checkUpdates': 'Check for a new version',
407
+ 'ta.console.checked': '{count, plural, =0 {Every Ta runs the latest version} one {# Ta can be updated} other {# Ta can be updated}}',
408
+ 'ta.console.auditUpdate': 'updated',
409
+ 'ta.console.auditUpdateAll': 'updated every Ta',
410
+ 'ta.console.auditRollback': 'took back',
411
+ 'ta.console.auditUpdatePolicy': 'changed when Ta updates',
412
+ 'ta.environment.newVersion': 'New version {version}',
413
+ 'ta.environment.newVersionIdle': 'It updates by itself once idle; update now, and what runs pauses and goes on after.',
414
+ 'ta.environment.newVersionManual': 'Update now: what runs pauses and goes on after.',
387
415
  'ta.access.title': 'Access',
388
416
  'ta.access.bind': 'Sign in with your account',
389
417
  'ta.access.bindHint': 'Lets in the account you sign in with, so that it signs you in next time, on any device.',
@@ -639,6 +667,15 @@ export const EN_MESSAGES = {
639
667
  'ta.assistant.rename': 'Rename',
640
668
  'ta.assistant.prompt': 'System prompt',
641
669
  'ta.assistant.look': 'Look',
670
+ 'ta.picture.title': 'My picture',
671
+ 'ta.picture.hint': 'What others see of you in group chats and among friends. Your double stays a dinosaur.',
672
+ 'ta.picture.choose': 'Choose or take a photo',
673
+ 'ta.picture.draw': 'Have Ta draw one',
674
+ 'ta.picture.reset': 'Back to the dinosaur',
675
+ 'ta.picture.drawPlaceholder': 'What should it be? e.g. a shiba in headphones',
676
+ 'ta.picture.drawSend': 'Draw it',
677
+ 'ta.picture.tooLarge': 'This photo cannot be made small enough. Try another.',
678
+ 'ta.picture.drawPrompt': 'Draw me a picture that others see of me in group chats and among friends: {what}. A square of 256 × 256, the subject in the middle, no text; an SVG or a PNG of 11 KB at most. Show it to me and wait: only once I say it is good, set it with `ta call @celljs/ta-rooms picture /the/absolute/path/of/it`; if I want changes, draw it again first.',
642
679
  'ta.look.title': 'Look of the double',
643
680
  'ta.look.species': 'Dinosaur',
644
681
  'ta.look.gait': 'Walk',
@@ -842,7 +879,7 @@ export const EN_MESSAGES = {
842
879
  'ta.settings.version': 'Version',
843
880
  'ta.settings.cwd': 'Default directory',
844
881
  'ta.settings.signOut': 'Sign out',
845
- 'ta.account.switchSignIn': 'Switch sign-in',
882
+ 'ta.account.switchSignIn': 'Switch account',
846
883
  'ta.chat': 'Chats',
847
884
  'ta.sidebar': 'Sidebar',
848
885
  'ta.chat.new': 'New chat',
@@ -1347,7 +1384,7 @@ export const EN_MESSAGES = {
1347
1384
  'ta.auth.hintRemote': 'Credentials stay on the machine that runs Ta.',
1348
1385
  'ta.auth.later': 'Later',
1349
1386
  'ta.hosts.title': 'Computers',
1350
- 'ta.myDevices.title': 'Account & devices',
1387
+ 'ta.myDevices.title': 'My devices',
1351
1388
  'ta.myDevices.hint': 'Sign in to one account on your computers and phone: they show up on each other, no code to scan.',
1352
1389
  'ta.myDevices.signInWith': 'Sign in with {name}',
1353
1390
  'ta.myDevices.enterCode': 'Enter this code on {name}',
@@ -1367,11 +1404,22 @@ export const EN_MESSAGES = {
1367
1404
  'ta.myDevices.remove': 'Remove',
1368
1405
  'ta.myDevices.removeConfirm': 'Remove {name} from your account? It can no longer reach your computers.',
1369
1406
  'ta.myDevices.signOut': 'Sign out',
1370
- 'ta.myDevices.signOutConfirm': 'Sign out of the account? The computers it added leave this device; those you scanned stay.',
1371
- 'ta.myDevices.signOutConfirmComputer': 'Sign out of the account? The devices it added can no longer reach this computer.',
1407
+ 'ta.myDevices.signOutConfirm': 'Sign out? The computers and the Ta in the cloud of your account leave this device; those you connected by a code stay.',
1408
+ 'ta.myDevices.signOutConfirmComputer': 'Sign out of the account? This computer leaves it, and the devices it added can no longer reach it.',
1372
1409
  'ta.myDevices.none': 'Only this device so far. Sign in to the same account on your other computers and phone.',
1373
1410
  'ta.myDevices.open': 'Open',
1374
1411
  'ta.myDevices.signInAccount': 'Sign in with an account',
1412
+ 'ta.myDevices.others': 'Other devices',
1413
+ 'ta.myDevices.computersComing': 'Sign in to the same account in Ta on your computer: it shows up here by itself.',
1414
+ 'ta.me.profile': 'Profile',
1415
+ 'ta.me.picture': 'Picture',
1416
+ 'ta.me.name': 'Name',
1417
+ 'ta.me.nameHint': 'The name friends and group chats see',
1418
+ 'ta.me.account': 'Account',
1419
+ 'ta.me.noAccount': 'Not signed in',
1420
+ 'ta.me.companyAccount': 'Company account',
1421
+ 'ta.me.recent': 'Signed in before',
1422
+ 'ta.me.profileHint': 'Friends and group chats see your picture and name. The computers of your account share them.',
1375
1423
  'ta.hosts.scan': 'Scan to connect',
1376
1424
  'ta.hosts.scanShort': 'Scan',
1377
1425
  'ta.hosts.paste': 'Paste a link',
@@ -1861,6 +1909,36 @@ export const ZH_MESSAGES = {
1861
1909
  'ta.console.manage': '管理',
1862
1910
  'ta.console.sandbox': '沙箱',
1863
1911
  'ta.console.about': '基本信息',
1912
+ 'ta.console.updatesAvailable': '{count} 台 Ta 可以更新到 {version}',
1913
+ 'ta.console.updateAll': '全部更新',
1914
+ 'ta.console.updateAllConfirm': '把 {count} 台 Ta 更新到 {version}?',
1915
+ 'ta.console.updateAllDetail': '一台接一台地更新:先停下,再用新版本启动,之前在做的事会接着做。有一台起不来时,它会自动回到原来的版本,其余的不再更新。',
1916
+ 'ta.console.updatingProgress': '正在更新 {done}/{total}',
1917
+ 'ta.console.update': '更新',
1918
+ 'ta.console.updateConfirm': '把 {account} 的 Ta 更新到 {version}?',
1919
+ 'ta.console.updateDetail': '会先停下,再用新版本启动,之前在做的事会接着做;起不来会自动回到原来的版本。',
1920
+ 'ta.console.updateWorking': '有 {count} 个对话正在进行,会暂停,启动后接着做。',
1921
+ 'ta.console.rollback': '回到上一版({version})',
1922
+ 'ta.console.rollbackConfirm': '把 {account} 的 Ta 回到 {version}?',
1923
+ 'ta.console.rollbackDetail': '会用上一版重新启动,之后不会再自动更新到这个版本,直到手动更新。',
1924
+ 'ta.console.version': '版本',
1925
+ 'ta.console.updatable': '可更新',
1926
+ 'ta.console.updates': '更新',
1927
+ 'ta.console.updatesHint': '新启动的 Ta 都用最新版本;起不来时会自动回到原来的版本。',
1928
+ 'ta.console.updateMode': '运行中的 Ta',
1929
+ 'ta.console.updateIdle': '空闲时自动更新',
1930
+ 'ta.console.updateIdleHint': '没有对话在进行、10 分钟没有动静时',
1931
+ 'ta.console.updateManual': '手动更新',
1932
+ 'ta.console.updateManualHint': '在账号页点“更新”时',
1933
+ 'ta.console.checkUpdates': '检查新版本',
1934
+ 'ta.console.checked': '{count, plural, =0 {所有 Ta 都是最新版本} other {# 台 Ta 可以更新}}',
1935
+ 'ta.console.auditUpdate': '更新了',
1936
+ 'ta.console.auditUpdateAll': '更新了全部 Ta',
1937
+ 'ta.console.auditRollback': '回退了',
1938
+ 'ta.console.auditUpdatePolicy': '修改了更新方式',
1939
+ 'ta.environment.newVersion': '有新版本 {version}',
1940
+ 'ta.environment.newVersionIdle': '空闲时会自动更新;也可以现在更新,正在做的事会暂停后接着做。',
1941
+ 'ta.environment.newVersionManual': '现在更新,正在做的事会暂停后接着做。',
1864
1942
  'ta.access.title': '访问',
1865
1943
  'ta.access.bind': '用你的账号登录',
1866
1944
  'ta.access.bindHint': '允许你登录用的这个账号,以后在任何设备上都能用它登录。',
@@ -2116,6 +2194,15 @@ export const ZH_MESSAGES = {
2116
2194
  'ta.assistant.rename': '重命名',
2117
2195
  'ta.assistant.prompt': '系统提示词',
2118
2196
  'ta.assistant.look': '形象',
2197
+ 'ta.picture.title': '我的头像',
2198
+ 'ta.picture.hint': '群聊和好友里别人看到的你,分身仍是恐龙。',
2199
+ 'ta.picture.choose': '从相册选择或拍照',
2200
+ 'ta.picture.draw': '让 Ta 画一个',
2201
+ 'ta.picture.reset': '换回恐龙',
2202
+ 'ta.picture.drawPlaceholder': '画成什么样?比如:戴耳机的柴犬',
2203
+ 'ta.picture.drawSend': '开始画',
2204
+ 'ta.picture.tooLarge': '这张照片压不到够小,换一张试试。',
2205
+ 'ta.picture.drawPrompt': '给我画一个头像,别人在群聊和好友里看到的就是它:{what}。正方形 256 × 256,主体居中,不要文字;SVG 或 PNG,11 KB 以内。画好先给我看,等我说好了再用 `ta call @celljs/ta-rooms picture /文件的绝对路径` 设成我的头像;我要改就先改好再给我看。',
2119
2206
  'ta.look.title': '分身形象',
2120
2207
  'ta.look.species': '恐龙',
2121
2208
  'ta.look.gait': '走路',
@@ -2319,7 +2406,7 @@ export const ZH_MESSAGES = {
2319
2406
  'ta.settings.version': '版本',
2320
2407
  'ta.settings.cwd': '默认目录',
2321
2408
  'ta.settings.signOut': '退出登录',
2322
- 'ta.account.switchSignIn': '切换登录',
2409
+ 'ta.account.switchSignIn': '切换账号',
2323
2410
  'ta.chat': '对话',
2324
2411
  'ta.sidebar': '侧栏',
2325
2412
  'ta.chat.new': '新对话',
@@ -2822,7 +2909,7 @@ export const ZH_MESSAGES = {
2822
2909
  'ta.auth.hintRemote': '凭据只保存在运行 Ta 的机器上。',
2823
2910
  'ta.auth.later': '稍后再说',
2824
2911
  'ta.hosts.title': '电脑',
2825
- 'ta.myDevices.title': '账号与设备',
2912
+ 'ta.myDevices.title': '我的设备',
2826
2913
  'ta.myDevices.hint': '电脑和手机登录同一个账号,彼此自动出现,不用扫码。',
2827
2914
  'ta.myDevices.signInWith': '使用 {name} 登录',
2828
2915
  'ta.myDevices.enterCode': '在 {name} 输入这串码',
@@ -2842,11 +2929,22 @@ export const ZH_MESSAGES = {
2842
2929
  'ta.myDevices.remove': '移除',
2843
2930
  'ta.myDevices.removeConfirm': '从账号移除 {name}?它将无法再连接你的电脑。',
2844
2931
  'ta.myDevices.signOut': '退出账号',
2845
- 'ta.myDevices.signOutConfirm': '退出账号?账号带来的电脑会从这台设备移除,扫码连接的保留。',
2846
- 'ta.myDevices.signOutConfirmComputer': '退出账号?账号带来的设备将无法再连接这台电脑。',
2932
+ 'ta.myDevices.signOutConfirm': '退出登录?账号带来的电脑和云端 Ta 会从这台设备移除,扫码连接的保留。',
2933
+ 'ta.myDevices.signOutConfirmComputer': '退出登录?这台电脑会退出账号,账号带来的设备将无法再连接它。',
2847
2934
  'ta.myDevices.none': '目前只有这台设备。在其他电脑和手机上登录同一个账号即可。',
2848
2935
  'ta.myDevices.open': '打开',
2849
2936
  'ta.myDevices.signInAccount': '用账号登录',
2937
+ 'ta.myDevices.others': '其他设备',
2938
+ 'ta.myDevices.computersComing': '在电脑上的 Ta 里登录同一个账号,电脑会自动出现在这里。',
2939
+ 'ta.me.profile': '个人信息',
2940
+ 'ta.me.picture': '头像',
2941
+ 'ta.me.name': '名字',
2942
+ 'ta.me.nameHint': '好友和群聊里看到的名字',
2943
+ 'ta.me.account': '账号',
2944
+ 'ta.me.noAccount': '未登录',
2945
+ 'ta.me.companyAccount': '公司账号',
2946
+ 'ta.me.recent': '最近登录',
2947
+ 'ta.me.profileHint': '好友和群聊里看到的是这里的头像和名字,同账号的电脑共用。',
2850
2948
  'ta.hosts.scan': '扫码连接',
2851
2949
  'ta.hosts.scanShort': '扫一扫',
2852
2950
  'ta.hosts.paste': '粘贴链接',
@@ -2958,17 +3056,41 @@ export const ZH_MESSAGES = {
2958
3056
  'ta.settings.cwdDescription': '新对话、终端和分身派出的任务在这里打开;已有的对话留在各自的目录:{path}',
2959
3057
  'ta.workingDirectory.changed': '默认目录已改为 {path}',
2960
3058
  };
2961
- export { JA_MESSAGES, ZH_TW_MESSAGES };
2962
- /** The messages of each language of Ta, checked by scripts/check-i18n.ts. */
2963
- export const MESSAGES = {
2964
- 'zh-CN': ZH_MESSAGES,
2965
- 'zh-TW': ZH_TW_MESSAGES,
2966
- 'en-US': EN_MESSAGES,
2967
- 'ja-JP': JA_MESSAGES,
3059
+ /**
3060
+ * Traditional Chinese and Japanese are chunks of their own, loaded by {@link loadMessages} as the language is chosen
3061
+ * (the Locale of each, through LocaleManager): together they made the first code of the page 170 KB larger.
3062
+ */
3063
+ const LOADERS = {
3064
+ 'zh-TW': () => import('./messages-zh-tw.js').then(module => module.ZH_TW_MESSAGES),
3065
+ 'ja-JP': () => import('./messages-ja.js').then(module => module.JA_MESSAGES),
2968
3066
  };
2969
- /** The messages of a language of the settings (`zh-CN`, `zh-TW`, `ja-JP`), English for another. */
3067
+ const loaded = { 'zh-CN': ZH_MESSAGES, 'en-US': EN_MESSAGES };
3068
+ const loading = new Map();
3069
+ /** The messages of a language of the settings (`zh-CN`, `zh-TW`, `ja-JP`), English for another and until loaded. */
2970
3070
  export function messagesOf(language) {
2971
- return TaLanguageUtil.pick(language, MESSAGES);
3071
+ var _a;
3072
+ return (_a = loaded[TaLanguageUtil.of(language)]) !== null && _a !== void 0 ? _a : EN_MESSAGES;
3073
+ }
3074
+ /** The messages of a language, loaded once; English for a language that fails to load. */
3075
+ export function loadMessages(language) {
3076
+ const lang = TaLanguageUtil.of(language);
3077
+ const load = LOADERS[lang];
3078
+ if (loaded[lang] || !load) {
3079
+ return Promise.resolve(messagesOf(lang));
3080
+ }
3081
+ let messages = loading.get(lang);
3082
+ if (!messages) {
3083
+ messages = load().then(done => {
3084
+ loaded[lang] = done;
3085
+ return done;
3086
+ }, error => {
3087
+ loading.delete(lang);
3088
+ console.error(`The messages of ${lang} failed to load: ${error instanceof Error ? error.message : error}`);
3089
+ return EN_MESSAGES;
3090
+ });
3091
+ loading.set(lang, messages);
3092
+ }
3093
+ return messages;
2972
3094
  }
2973
3095
  /** A message outside React, in a language of the settings. */
2974
3096
  export function message(language, id) {
@@ -10,14 +10,15 @@ function useIntl() {
10
10
  var _a;
11
11
  return (_a = React.useContext(IntlContext)) !== null && _a !== void 0 ? _a : english();
12
12
  }
13
+ /** By the messages, not the language: those of Japanese and Traditional Chinese are English until loaded. */
13
14
  const intls = new Map();
14
15
  /** The messages of a language outside of React: for what services say, in the words of the page. */
15
16
  export function translator(language) {
16
- let intl = intls.get(language);
17
+ const messages = messagesOf(language);
18
+ let intl = intls.get(messages);
17
19
  if (!intl) {
18
- const messages = messagesOf(language);
19
20
  intl = messages === EN_MESSAGES ? english() : createIntl({ locale: language, messages });
20
- intls.set(language, intl);
21
+ intls.set(messages, intl);
21
22
  }
22
23
  const shape = intl;
23
24
  return (id, values) => shape.formatMessage({ id, defaultMessage: EN_MESSAGES[id] }, values);
@@ -94,9 +94,11 @@ let TaSettingsImpl = class TaSettingsImpl {
94
94
  document.head.appendChild(meta);
95
95
  }
96
96
  meta.content = THEME_COLORS[state.theme].main;
97
+ // Even the current one: a language whose messages still load (Japanese, Traditional Chinese) is selected once
98
+ // they are there, unless another is asked for meanwhile.
97
99
  void this.localeManager.get().then(locales => {
98
100
  const locale = locales.find(candidate => candidate.lang === state.language);
99
- if (locale && this.localeManager.current !== locale) {
101
+ if (locale) {
100
102
  this.localeManager.setCurrent(locale);
101
103
  }
102
104
  });