@celljs/ta-web 4.19.0 → 4.20.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 (91) hide show
  1. package/esm/browser/assistant/assistant-chat-list.js +2 -1
  2. package/esm/browser/components/account-menu.js +3 -1
  3. package/esm/browser/components/app-view.js +2 -2
  4. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  5. package/esm/browser/components/dino-look.d.ts +9 -1
  6. package/esm/browser/components/dino-look.js +46 -1
  7. package/esm/browser/components/environment-view.js +12 -1
  8. package/esm/browser/components/face-pictures.d.ts +10 -0
  9. package/esm/browser/components/face-pictures.js +24 -0
  10. package/esm/browser/components/face.d.ts +4 -1
  11. package/esm/browser/components/face.js +16 -1
  12. package/esm/browser/components/host-view.d.ts +1 -1
  13. package/esm/browser/components/picture-dialog.d.ts +18 -0
  14. package/esm/browser/components/picture-dialog.js +116 -0
  15. package/esm/browser/extension/icons.js +2 -1
  16. package/esm/browser/extension/web-api-home.d.ts +13 -0
  17. package/esm/browser/extension/web-api-home.js +2 -0
  18. package/esm/browser/extension/web-extension-api.d.ts +4 -4
  19. package/esm/browser/extension/web-extension-context.js +2 -1
  20. package/esm/browser/extension/web-home.d.ts +8 -0
  21. package/esm/browser/extension/web-home.js +20 -0
  22. package/esm/browser/gateway/console-limits.d.ts +15 -0
  23. package/esm/browser/gateway/console-limits.js +2 -2
  24. package/esm/browser/gateway/console-tenant.js +33 -2
  25. package/esm/browser/gateway/console-updates.d.ts +12 -0
  26. package/esm/browser/gateway/console-updates.js +76 -0
  27. package/esm/browser/gateway/console-util.d.ts +7 -1
  28. package/esm/browser/gateway/console-util.js +18 -0
  29. package/esm/browser/gateway/console-view.js +9 -2
  30. package/esm/browser/i18n/locales.d.ts +44 -3
  31. package/esm/browser/i18n/locales.js +9 -3
  32. package/esm/browser/i18n/messages-all.d.ts +7 -0
  33. package/esm/browser/i18n/messages-all.js +14 -0
  34. package/esm/browser/i18n/messages-ja.js +39 -0
  35. package/esm/browser/i18n/messages-zh-tw.js +39 -0
  36. package/esm/browser/i18n/messages.d.ts +45 -8
  37. package/esm/browser/i18n/messages.js +111 -11
  38. package/esm/browser/i18n/use-t.js +4 -3
  39. package/esm/browser/settings/settings.js +3 -1
  40. package/esm/browser/style/pages.d.ts +1 -1
  41. package/esm/browser/style/pages.js +5 -0
  42. package/esm/browser/style/surfaces.d.ts +1 -1
  43. package/esm/browser/style/surfaces.js +1 -0
  44. package/esm/browser/util/picture.d.ts +5 -0
  45. package/esm/browser/util/picture.js +43 -0
  46. package/lib/browser/assistant/assistant-chat-list.js +2 -1
  47. package/lib/browser/components/account-menu.js +2 -0
  48. package/lib/browser/components/app-view.js +1 -1
  49. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  50. package/lib/browser/components/dino-look.d.ts +9 -1
  51. package/lib/browser/components/dino-look.js +48 -1
  52. package/lib/browser/components/environment-view.js +11 -0
  53. package/lib/browser/components/face-pictures.d.ts +11 -0
  54. package/lib/browser/components/face-pictures.js +60 -0
  55. package/lib/browser/components/face.d.ts +4 -1
  56. package/lib/browser/components/face.js +16 -1
  57. package/lib/browser/components/host-view.d.ts +1 -1
  58. package/lib/browser/components/picture-dialog.d.ts +19 -0
  59. package/lib/browser/components/picture-dialog.js +153 -0
  60. package/lib/browser/extension/icons.js +1 -0
  61. package/lib/browser/extension/web-api-home.d.ts +14 -0
  62. package/lib/browser/extension/web-api-home.js +3 -0
  63. package/lib/browser/extension/web-extension-api.d.ts +4 -4
  64. package/lib/browser/extension/web-extension-context.js +2 -1
  65. package/lib/browser/extension/web-home.d.ts +8 -0
  66. package/lib/browser/extension/web-home.js +54 -1
  67. package/lib/browser/gateway/console-limits.d.ts +15 -0
  68. package/lib/browser/gateway/console-limits.js +2 -0
  69. package/lib/browser/gateway/console-tenant.js +32 -1
  70. package/lib/browser/gateway/console-updates.d.ts +13 -0
  71. package/lib/browser/gateway/console-updates.js +113 -0
  72. package/lib/browser/gateway/console-util.d.ts +7 -1
  73. package/lib/browser/gateway/console-util.js +18 -0
  74. package/lib/browser/gateway/console-view.js +9 -2
  75. package/lib/browser/i18n/locales.d.ts +44 -3
  76. package/lib/browser/i18n/locales.js +8 -2
  77. package/lib/browser/i18n/messages-all.d.ts +8 -0
  78. package/lib/browser/i18n/messages-all.js +17 -0
  79. package/lib/browser/i18n/messages-ja.js +39 -0
  80. package/lib/browser/i18n/messages-zh-tw.js +39 -0
  81. package/lib/browser/i18n/messages.d.ts +45 -8
  82. package/lib/browser/i18n/messages.js +113 -13
  83. package/lib/browser/i18n/use-t.js +4 -3
  84. package/lib/browser/settings/settings.js +3 -1
  85. package/lib/browser/style/pages.d.ts +1 -1
  86. package/lib/browser/style/pages.js +5 -0
  87. package/lib/browser/style/surfaces.d.ts +1 -1
  88. package/lib/browser/style/surfaces.js +1 -0
  89. package/lib/browser/util/picture.d.ts +6 -0
  90. package/lib/browser/util/picture.js +46 -0
  91. package/package.json +7 -7
@@ -379,6 +379,36 @@ exports.JA_MESSAGES = {
379
379
  'ta.console.manage': '管理',
380
380
  'ta.console.sandbox': 'サンドボックス',
381
381
  'ta.console.about': '基本情報',
382
+ 'ta.console.updatesAvailable': '{count} 台の Ta を {version} に更新できます',
383
+ 'ta.console.updateAll': 'すべて更新',
384
+ 'ta.console.updateAllConfirm': '{count} 台の Ta を {version} に更新しますか?',
385
+ 'ta.console.updateAllDetail': '1 台ずつ更新します。停止して新しいバージョンで起動し、作業は続きから再開します。起動できない Ta は元のバージョンに戻り、残りは更新しません。',
386
+ 'ta.console.updatingProgress': '更新中 {done}/{total}',
387
+ 'ta.console.update': '更新',
388
+ 'ta.console.updateConfirm': '{account} の Ta を {version} に更新しますか?',
389
+ 'ta.console.updateDetail': '停止して新しいバージョンで起動し、作業は続きから再開します。起動できなければ元のバージョンに戻ります。',
390
+ 'ta.console.updateWorking': '{count} 件の会話が進行中です。一時停止し、起動後に続きから再開します。',
391
+ 'ta.console.rollback': '前のバージョン({version})に戻す',
392
+ 'ta.console.rollbackConfirm': '{account} の Ta を {version} に戻しますか?',
393
+ 'ta.console.rollbackDetail': '前のバージョンで再起動し、手動で更新するまでこのバージョンには自動で更新しません。',
394
+ 'ta.console.version': 'バージョン',
395
+ 'ta.console.updatable': '更新あり',
396
+ 'ta.console.updates': '更新',
397
+ 'ta.console.updatesHint': '起動する Ta は常に最新バージョンを使います。起動できなければ自動で元のバージョンに戻ります。',
398
+ 'ta.console.updateMode': '実行中の Ta',
399
+ 'ta.console.updateIdle': 'アイドル時に自動更新',
400
+ 'ta.console.updateIdleHint': '進行中の会話がなく、10 分間動きがないとき',
401
+ 'ta.console.updateManual': '手動で更新',
402
+ 'ta.console.updateManualHint': 'アカウントページで「更新」したとき',
403
+ 'ta.console.checkUpdates': '新しいバージョンを確認',
404
+ 'ta.console.checked': '{count, plural, =0 {すべての Ta が最新バージョンです} other {# 台の Ta を更新できます}}',
405
+ 'ta.console.auditUpdate': '更新:',
406
+ 'ta.console.auditUpdateAll': 'すべての Ta を更新',
407
+ 'ta.console.auditRollback': '前のバージョンに戻した:',
408
+ 'ta.console.auditUpdatePolicy': '更新方法を変更',
409
+ 'ta.environment.newVersion': '新しいバージョン {version}',
410
+ 'ta.environment.newVersionIdle': 'アイドル時に自動で更新されます。今すぐ更新すると作業は一時停止し、続きから再開します。',
411
+ 'ta.environment.newVersionManual': '今すぐ更新します。作業は一時停止し、続きから再開します。',
382
412
  'ta.access.title': 'アクセス',
383
413
  'ta.access.bind': 'アカウントでサインイン',
384
414
  'ta.access.bindHint': 'サインインに使用するアカウントを許可するため、次回以降は任意のデバイスでサインインできます。',
@@ -634,6 +664,15 @@ exports.JA_MESSAGES = {
634
664
  'ta.assistant.rename': '名前変更',
635
665
  'ta.assistant.prompt': 'システムプロンプト',
636
666
  'ta.assistant.look': '外見',
667
+ 'ta.picture.title': '私のアイコン',
668
+ 'ta.picture.hint': 'グループチャットと友だちに見えるあなた。分身は恐竜のままです。',
669
+ 'ta.picture.choose': '写真を選ぶ・撮る',
670
+ 'ta.picture.draw': 'Ta に描いてもらう',
671
+ 'ta.picture.reset': '恐竜に戻す',
672
+ 'ta.picture.drawPlaceholder': '何を描く?例:ヘッドホンをした柴犬',
673
+ 'ta.picture.drawSend': '描いてもらう',
674
+ 'ta.picture.tooLarge': 'この写真は十分に小さくできません。別の写真を試してください。',
675
+ 'ta.picture.drawPrompt': 'グループチャットと友だちに見せる私のアイコンを描いて:{what}。256 × 256 の正方形、主題は中央、文字なし。SVG か PNG で 11 KB 以内。描けたらまず見せて、私が OK と言ってから `ta call @celljs/ta-rooms picture /ファイルの絶対パス` で私のアイコンに設定して。直してほしいと言ったら、先に描き直して見せて。',
637
676
  'ta.look.title': '分身の外見',
638
677
  'ta.look.species': '恐竜',
639
678
  'ta.look.gait': '歩き方',
@@ -380,6 +380,36 @@ exports.ZH_TW_MESSAGES = {
380
380
  'ta.console.manage': '管理',
381
381
  'ta.console.sandbox': '沙箱',
382
382
  'ta.console.about': '基本資訊',
383
+ 'ta.console.updatesAvailable': '{count} 台 Ta 可以更新到 {version}',
384
+ 'ta.console.updateAll': '全部更新',
385
+ 'ta.console.updateAllConfirm': '把 {count} 台 Ta 更新到 {version}?',
386
+ 'ta.console.updateAllDetail': '一台接一台地更新:先停下,再用新版本啟動,之前在做的事會接著做。有一台起不來時,它會自動回到原來的版本,其餘的不再更新。',
387
+ 'ta.console.updatingProgress': '正在更新 {done}/{total}',
388
+ 'ta.console.update': '更新',
389
+ 'ta.console.updateConfirm': '把 {account} 的 Ta 更新到 {version}?',
390
+ 'ta.console.updateDetail': '會先停下,再用新版本啟動,之前在做的事會接著做;起不來會自動回到原來的版本。',
391
+ 'ta.console.updateWorking': '有 {count} 個對話正在進行,會暫停,啟動後接著做。',
392
+ 'ta.console.rollback': '回到上一版({version})',
393
+ 'ta.console.rollbackConfirm': '把 {account} 的 Ta 回到 {version}?',
394
+ 'ta.console.rollbackDetail': '會用上一版重新啟動,之後不會再自動更新到這個版本,直到手動更新。',
395
+ 'ta.console.version': '版本',
396
+ 'ta.console.updatable': '可更新',
397
+ 'ta.console.updates': '更新',
398
+ 'ta.console.updatesHint': '新啟動的 Ta 都用最新版本;起不來時會自動回到原來的版本。',
399
+ 'ta.console.updateMode': '執行中的 Ta',
400
+ 'ta.console.updateIdle': '閒置時自動更新',
401
+ 'ta.console.updateIdleHint': '沒有對話在進行、10 分鐘沒有動靜時',
402
+ 'ta.console.updateManual': '手動更新',
403
+ 'ta.console.updateManualHint': '在帳號頁點「更新」時',
404
+ 'ta.console.checkUpdates': '檢查新版本',
405
+ 'ta.console.checked': '{count, plural, =0 {所有 Ta 都是最新版本} other {# 台 Ta 可以更新}}',
406
+ 'ta.console.auditUpdate': '更新了',
407
+ 'ta.console.auditUpdateAll': '更新了全部 Ta',
408
+ 'ta.console.auditRollback': '回退了',
409
+ 'ta.console.auditUpdatePolicy': '修改了更新方式',
410
+ 'ta.environment.newVersion': '有新版本 {version}',
411
+ 'ta.environment.newVersionIdle': '閒置時會自動更新;也可以現在更新,正在做的事會暫停後接著做。',
412
+ 'ta.environment.newVersionManual': '現在更新,正在做的事會暫停後接著做。',
383
413
  'ta.access.title': '存取',
384
414
  'ta.access.bind': '用你的帳號登入',
385
415
  'ta.access.bindHint': '允許你登入用的這個帳號,以後在任何裝置上都能用它登入。',
@@ -635,6 +665,15 @@ exports.ZH_TW_MESSAGES = {
635
665
  'ta.assistant.rename': '重新命名',
636
666
  'ta.assistant.prompt': '系統提示詞',
637
667
  'ta.assistant.look': '形象',
668
+ 'ta.picture.title': '我的頭像',
669
+ 'ta.picture.hint': '群聊和好友裡別人看到的你,分身仍是恐龍。',
670
+ 'ta.picture.choose': '從相簿選擇或拍照',
671
+ 'ta.picture.draw': '讓 Ta 畫一個',
672
+ 'ta.picture.reset': '換回恐龍',
673
+ 'ta.picture.drawPlaceholder': '畫成什麼樣?比如:戴耳機的柴犬',
674
+ 'ta.picture.drawSend': '開始畫',
675
+ 'ta.picture.tooLarge': '這張照片壓不到夠小,換一張試試。',
676
+ 'ta.picture.drawPrompt': '給我畫一個頭像,別人在群聊和好友裡看到的就是它:{what}。正方形 256 × 256,主體置中,不要文字;SVG 或 PNG,11 KB 以內。畫好先給我看,等我說好了再用 `ta call @celljs/ta-rooms picture /檔案的絕對路徑` 設成我的頭像;我要改就先改好再給我看。',
638
677
  'ta.look.title': '分身形象',
639
678
  'ta.look.species': '恐龍',
640
679
  'ta.look.gait': '走路',
@@ -1,6 +1,3 @@
1
- import { type TaLanguage } from '@celljs/ta-protocol';
2
- import { JA_MESSAGES } from './messages-ja';
3
- import { ZH_TW_MESSAGES } from './messages-zh-tw';
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;
@@ -1477,11 +1513,12 @@ export declare const EN_MESSAGES: {
1477
1513
  };
1478
1514
  export type MessageId = keyof typeof EN_MESSAGES;
1479
1515
  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>;
1516
+ type Messages = Record<MessageId, string>;
1517
+ /** The messages of a language of the settings (`zh-CN`, `zh-TW`, `ja-JP`), English for another and until loaded. */
1518
+ export declare function messagesOf(language: string): Messages;
1519
+ /** The messages of a language, loaded once; English for a language that fails to load. */
1520
+ export declare function loadMessages(language: string): Promise<Messages>;
1485
1521
  /** A message outside React, in a language of the settings. */
1486
1522
  export declare function message(language: string, id: MessageId): string;
1523
+ export {};
1487
1524
  //# sourceMappingURL=messages.d.ts.map
@@ -1,13 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MESSAGES = exports.ZH_TW_MESSAGES = exports.JA_MESSAGES = exports.ZH_MESSAGES = exports.EN_MESSAGES = void 0;
3
+ exports.ZH_MESSAGES = exports.EN_MESSAGES = void 0;
4
4
  exports.messagesOf = messagesOf;
5
+ exports.loadMessages = loadMessages;
5
6
  exports.message = message;
6
7
  const ta_protocol_1 = require("@celljs/ta-protocol");
7
- const messages_ja_1 = require("./messages-ja");
8
- Object.defineProperty(exports, "JA_MESSAGES", { enumerable: true, get: function () { return messages_ja_1.JA_MESSAGES; } });
9
- const messages_zh_tw_1 = require("./messages-zh-tw");
10
- Object.defineProperty(exports, "ZH_TW_MESSAGES", { enumerable: true, get: function () { return messages_zh_tw_1.ZH_TW_MESSAGES; } });
11
8
  /** The messages of the web client, in ICU format. English is the source and the fallback. */
12
9
  exports.EN_MESSAGES = {
13
10
  'ta.dismiss': 'Dismiss',
@@ -391,6 +388,36 @@ exports.EN_MESSAGES = {
391
388
  'ta.console.manage': 'Manage',
392
389
  'ta.console.sandbox': 'Sandbox',
393
390
  'ta.console.about': 'About',
391
+ 'ta.console.updatesAvailable': '{count, plural, one {# Ta runs} other {# Ta run}} a version older than {version}',
392
+ 'ta.console.updateAll': 'Update all',
393
+ 'ta.console.updateAllConfirm': 'Update {count, plural, one {# Ta} other {# Ta}} to {version}?',
394
+ '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.',
395
+ 'ta.console.updatingProgress': 'Updating {done} of {total}',
396
+ 'ta.console.update': 'Update',
397
+ 'ta.console.updateConfirm': 'Update the Ta of {account} to {version}?',
398
+ '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.',
399
+ 'ta.console.updateWorking': '{count, plural, one {# conversation is} other {# conversations are}} at work: they pause and go on once it starts.',
400
+ 'ta.console.rollback': 'Go back to {version}',
401
+ 'ta.console.rollbackConfirm': 'Take the Ta of {account} back to {version}?',
402
+ 'ta.console.rollbackDetail': 'It restarts on the version before, and stays on it until it is updated by hand.',
403
+ 'ta.console.version': 'Version',
404
+ 'ta.console.updatable': 'Update ready',
405
+ 'ta.console.updates': 'Updates',
406
+ 'ta.console.updatesHint': 'A Ta that starts runs the latest version; one that does not start goes back to the version before by itself.',
407
+ 'ta.console.updateMode': 'Running Ta',
408
+ 'ta.console.updateIdle': 'Update when idle',
409
+ 'ta.console.updateIdleHint': 'Once no conversation is at work and nothing happened for 10 minutes',
410
+ 'ta.console.updateManual': 'Update by hand',
411
+ 'ta.console.updateManualHint': 'When Update is tapped on its account page',
412
+ 'ta.console.checkUpdates': 'Check for a new version',
413
+ 'ta.console.checked': '{count, plural, =0 {Every Ta runs the latest version} one {# Ta can be updated} other {# Ta can be updated}}',
414
+ 'ta.console.auditUpdate': 'updated',
415
+ 'ta.console.auditUpdateAll': 'updated every Ta',
416
+ 'ta.console.auditRollback': 'took back',
417
+ 'ta.console.auditUpdatePolicy': 'changed when Ta updates',
418
+ 'ta.environment.newVersion': 'New version {version}',
419
+ 'ta.environment.newVersionIdle': 'It updates by itself once idle; update now, and what runs pauses and goes on after.',
420
+ 'ta.environment.newVersionManual': 'Update now: what runs pauses and goes on after.',
394
421
  'ta.access.title': 'Access',
395
422
  'ta.access.bind': 'Sign in with your account',
396
423
  'ta.access.bindHint': 'Lets in the account you sign in with, so that it signs you in next time, on any device.',
@@ -646,6 +673,15 @@ exports.EN_MESSAGES = {
646
673
  'ta.assistant.rename': 'Rename',
647
674
  'ta.assistant.prompt': 'System prompt',
648
675
  'ta.assistant.look': 'Look',
676
+ 'ta.picture.title': 'My picture',
677
+ 'ta.picture.hint': 'What others see of you in group chats and among friends. Your double stays a dinosaur.',
678
+ 'ta.picture.choose': 'Choose or take a photo',
679
+ 'ta.picture.draw': 'Have Ta draw one',
680
+ 'ta.picture.reset': 'Back to the dinosaur',
681
+ 'ta.picture.drawPlaceholder': 'What should it be? e.g. a shiba in headphones',
682
+ 'ta.picture.drawSend': 'Draw it',
683
+ 'ta.picture.tooLarge': 'This photo cannot be made small enough. Try another.',
684
+ '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.',
649
685
  'ta.look.title': 'Look of the double',
650
686
  'ta.look.species': 'Dinosaur',
651
687
  'ta.look.gait': 'Walk',
@@ -1868,6 +1904,36 @@ exports.ZH_MESSAGES = {
1868
1904
  'ta.console.manage': '管理',
1869
1905
  'ta.console.sandbox': '沙箱',
1870
1906
  'ta.console.about': '基本信息',
1907
+ 'ta.console.updatesAvailable': '{count} 台 Ta 可以更新到 {version}',
1908
+ 'ta.console.updateAll': '全部更新',
1909
+ 'ta.console.updateAllConfirm': '把 {count} 台 Ta 更新到 {version}?',
1910
+ 'ta.console.updateAllDetail': '一台接一台地更新:先停下,再用新版本启动,之前在做的事会接着做。有一台起不来时,它会自动回到原来的版本,其余的不再更新。',
1911
+ 'ta.console.updatingProgress': '正在更新 {done}/{total}',
1912
+ 'ta.console.update': '更新',
1913
+ 'ta.console.updateConfirm': '把 {account} 的 Ta 更新到 {version}?',
1914
+ 'ta.console.updateDetail': '会先停下,再用新版本启动,之前在做的事会接着做;起不来会自动回到原来的版本。',
1915
+ 'ta.console.updateWorking': '有 {count} 个对话正在进行,会暂停,启动后接着做。',
1916
+ 'ta.console.rollback': '回到上一版({version})',
1917
+ 'ta.console.rollbackConfirm': '把 {account} 的 Ta 回到 {version}?',
1918
+ 'ta.console.rollbackDetail': '会用上一版重新启动,之后不会再自动更新到这个版本,直到手动更新。',
1919
+ 'ta.console.version': '版本',
1920
+ 'ta.console.updatable': '可更新',
1921
+ 'ta.console.updates': '更新',
1922
+ 'ta.console.updatesHint': '新启动的 Ta 都用最新版本;起不来时会自动回到原来的版本。',
1923
+ 'ta.console.updateMode': '运行中的 Ta',
1924
+ 'ta.console.updateIdle': '空闲时自动更新',
1925
+ 'ta.console.updateIdleHint': '没有对话在进行、10 分钟没有动静时',
1926
+ 'ta.console.updateManual': '手动更新',
1927
+ 'ta.console.updateManualHint': '在账号页点“更新”时',
1928
+ 'ta.console.checkUpdates': '检查新版本',
1929
+ 'ta.console.checked': '{count, plural, =0 {所有 Ta 都是最新版本} other {# 台 Ta 可以更新}}',
1930
+ 'ta.console.auditUpdate': '更新了',
1931
+ 'ta.console.auditUpdateAll': '更新了全部 Ta',
1932
+ 'ta.console.auditRollback': '回退了',
1933
+ 'ta.console.auditUpdatePolicy': '修改了更新方式',
1934
+ 'ta.environment.newVersion': '有新版本 {version}',
1935
+ 'ta.environment.newVersionIdle': '空闲时会自动更新;也可以现在更新,正在做的事会暂停后接着做。',
1936
+ 'ta.environment.newVersionManual': '现在更新,正在做的事会暂停后接着做。',
1871
1937
  'ta.access.title': '访问',
1872
1938
  'ta.access.bind': '用你的账号登录',
1873
1939
  'ta.access.bindHint': '允许你登录用的这个账号,以后在任何设备上都能用它登录。',
@@ -2123,6 +2189,15 @@ exports.ZH_MESSAGES = {
2123
2189
  'ta.assistant.rename': '重命名',
2124
2190
  'ta.assistant.prompt': '系统提示词',
2125
2191
  'ta.assistant.look': '形象',
2192
+ 'ta.picture.title': '我的头像',
2193
+ 'ta.picture.hint': '群聊和好友里别人看到的你,分身仍是恐龙。',
2194
+ 'ta.picture.choose': '从相册选择或拍照',
2195
+ 'ta.picture.draw': '让 Ta 画一个',
2196
+ 'ta.picture.reset': '换回恐龙',
2197
+ 'ta.picture.drawPlaceholder': '画成什么样?比如:戴耳机的柴犬',
2198
+ 'ta.picture.drawSend': '开始画',
2199
+ 'ta.picture.tooLarge': '这张照片压不到够小,换一张试试。',
2200
+ 'ta.picture.drawPrompt': '给我画一个头像,别人在群聊和好友里看到的就是它:{what}。正方形 256 × 256,主体居中,不要文字;SVG 或 PNG,11 KB 以内。画好先给我看,等我说好了再用 `ta call @celljs/ta-rooms picture /文件的绝对路径` 设成我的头像;我要改就先改好再给我看。',
2126
2201
  'ta.look.title': '分身形象',
2127
2202
  'ta.look.species': '恐龙',
2128
2203
  'ta.look.gait': '走路',
@@ -2965,16 +3040,41 @@ exports.ZH_MESSAGES = {
2965
3040
  'ta.settings.cwdDescription': '新对话、终端和分身派出的任务在这里打开;已有的对话留在各自的目录:{path}',
2966
3041
  'ta.workingDirectory.changed': '默认目录已改为 {path}',
2967
3042
  };
2968
- /** The messages of each language of Ta, checked by scripts/check-i18n.ts. */
2969
- exports.MESSAGES = {
2970
- 'zh-CN': exports.ZH_MESSAGES,
2971
- 'zh-TW': messages_zh_tw_1.ZH_TW_MESSAGES,
2972
- 'en-US': exports.EN_MESSAGES,
2973
- 'ja-JP': messages_ja_1.JA_MESSAGES,
3043
+ /**
3044
+ * Traditional Chinese and Japanese are chunks of their own, loaded by {@link loadMessages} as the language is chosen
3045
+ * (the Locale of each, through LocaleManager): together they made the first code of the page 170 KB larger.
3046
+ */
3047
+ const LOADERS = {
3048
+ 'zh-TW': () => import('./messages-zh-tw.js').then(module => module.ZH_TW_MESSAGES),
3049
+ 'ja-JP': () => import('./messages-ja.js').then(module => module.JA_MESSAGES),
2974
3050
  };
2975
- /** The messages of a language of the settings (`zh-CN`, `zh-TW`, `ja-JP`), English for another. */
3051
+ const loaded = { 'zh-CN': exports.ZH_MESSAGES, 'en-US': exports.EN_MESSAGES };
3052
+ const loading = new Map();
3053
+ /** The messages of a language of the settings (`zh-CN`, `zh-TW`, `ja-JP`), English for another and until loaded. */
2976
3054
  function messagesOf(language) {
2977
- return ta_protocol_1.TaLanguageUtil.pick(language, exports.MESSAGES);
3055
+ var _a;
3056
+ return (_a = loaded[ta_protocol_1.TaLanguageUtil.of(language)]) !== null && _a !== void 0 ? _a : exports.EN_MESSAGES;
3057
+ }
3058
+ /** The messages of a language, loaded once; English for a language that fails to load. */
3059
+ function loadMessages(language) {
3060
+ const lang = ta_protocol_1.TaLanguageUtil.of(language);
3061
+ const load = LOADERS[lang];
3062
+ if (loaded[lang] || !load) {
3063
+ return Promise.resolve(messagesOf(lang));
3064
+ }
3065
+ let messages = loading.get(lang);
3066
+ if (!messages) {
3067
+ messages = load().then(done => {
3068
+ loaded[lang] = done;
3069
+ return done;
3070
+ }, error => {
3071
+ loading.delete(lang);
3072
+ console.error(`The messages of ${lang} failed to load: ${error instanceof Error ? error.message : error}`);
3073
+ return exports.EN_MESSAGES;
3074
+ });
3075
+ loading.set(lang, messages);
3076
+ }
3077
+ return messages;
2978
3078
  }
2979
3079
  /** A message outside React, in a language of the settings. */
2980
3080
  function message(language, id) {
@@ -48,14 +48,15 @@ function useIntl() {
48
48
  var _a;
49
49
  return (_a = React.useContext(react_intl_1.IntlContext)) !== null && _a !== void 0 ? _a : english();
50
50
  }
51
+ /** By the messages, not the language: those of Japanese and Traditional Chinese are English until loaded. */
51
52
  const intls = new Map();
52
53
  /** The messages of a language outside of React: for what services say, in the words of the page. */
53
54
  function translator(language) {
54
- let intl = intls.get(language);
55
+ const messages = (0, messages_1.messagesOf)(language);
56
+ let intl = intls.get(messages);
55
57
  if (!intl) {
56
- const messages = (0, messages_1.messagesOf)(language);
57
58
  intl = messages === messages_1.EN_MESSAGES ? english() : (0, react_intl_1.createIntl)({ locale: language, messages });
58
- intls.set(language, intl);
59
+ intls.set(messages, intl);
59
60
  }
60
61
  const shape = intl;
61
62
  return (id, values) => shape.formatMessage({ id, defaultMessage: messages_1.EN_MESSAGES[id] }, values);
@@ -97,9 +97,11 @@ let TaSettingsImpl = class TaSettingsImpl {
97
97
  document.head.appendChild(meta);
98
98
  }
99
99
  meta.content = exports.THEME_COLORS[state.theme].main;
100
+ // Even the current one: a language whose messages still load (Japanese, Traditional Chinese) is selected once
101
+ // they are there, unless another is asked for meanwhile.
100
102
  void this.localeManager.get().then(locales => {
101
103
  const locale = locales.find(candidate => candidate.lang === state.language);
102
- if (locale && this.localeManager.current !== locale) {
104
+ if (locale) {
103
105
  this.localeManager.setCurrent(locale);
104
106
  }
105
107
  });