diff --git a/apps/lib/l10n/app_zh_hant.arb b/apps/lib/l10n/app_zh_hant.arb index d3b8388..de44944 100644 --- a/apps/lib/l10n/app_zh_hant.arb +++ b/apps/lib/l10n/app_zh_hant.arb @@ -1,9 +1,6 @@ { "@@locale": "zh_Hant", "appTitle": "覓爻籤問", - "welcomeLogin": "歡迎登入", - "loginSubtitle": "請使用信箱登入", - "loginSubtitleEmail": "請使用信箱登入", "emailHint": "請輸入信箱地址", "codeHint": "請輸入驗證碼", "sendCode": "取得驗證碼", @@ -11,9 +8,6 @@ "retryAfter": "{seconds}秒後重試", "@retryAfter": { "placeholders": { - "seconds": { - "type": "int" - } } }, "login": "登入", @@ -28,19 +22,11 @@ "legalDocumentLoadFailedPathPrefix": "路徑", "legalDocumentLoadFailedErrorPrefix": "錯誤", "disclaimer": "免責聲明", - "icp": "粵ICP備2025428416號-1A", - "invalidPhone": "請輸入正確的手機號碼", "invalidEmail": "請輸入正確的信箱地址", "invalidCode": "請輸入6位驗證碼", "agreementRequired": "請先勾選協議", - "codeSent": "驗證碼已傳送,請注意查收", - "loginSuccess": "登入成功", - "helloUser": "您好,{name}", "@helloUser": { "placeholders": { - "name": { - "type": "String" - } } }, "startJourney": "開始您的卦象之旅", @@ -53,15 +39,7 @@ "homeTab": "首頁", "profileTab": "我的", "notify": "訊息通知", - "featurePending": "該功能暫未接入資料", "logout": "登出", - "defaultUserName": "用戶", - "historyQuestion1": "今年轉崗是否合適?", - "historyQuestion2": "最近感情是否能推進?", - "historyQuestion3": "本季度投資節奏如何?", - "guaName1": "天雷無妄", - "guaName2": "澤火革", - "guaName3": "風地觀", "welcomeDialogTitle": "歡迎使用覓爻籤問", "welcomeParagraph1": "你好,歡迎來到覓爻籤問,這是一個借助於AI解讀傳統六爻卦象的平臺,為用戶了解中國傳統易學文化提供一個窗口。", "welcomeParagraph2": "六爻卦象源於《周易》深邃的哲學體系,是古人探索世界執行規律的一種獨特方法。古人認為宇宙萬物相互關聯,在您起卦時,您的心念與時空資訊會凝結 成卦象的方式呈現出來。", @@ -71,15 +49,9 @@ "scrollHint": "請向下捲動閱讀全部內容", "understood": "我已了解", "readAllFirst": "請先閱讀完整內容", - "signBest": "上上籤", - "signGood": "中上籤", - "signNormal": "中下籤", - "signBad": "下下籤", "language": "語言", "settingsTitle": "設定", "settingsSectionGeneral": "偏好設定", - "settingsSectionQuickAccess": "一級選單", - "settingsSectionAccount": "帳戶操作", "settingsSectionPrivacy": "隱私設定", "settingsSectionNotification": "通知設定", "settingsAccountAndDataTitle": "帳號資料", @@ -89,34 +61,19 @@ "settingsNotificationVibration": "允許振動", "settingsSectionAbout": "關於", "settingsGeneralTitle": "通用設定", - "settingsGeneralSubtitle": "語言:{currentLanguage},其餘欄位按 profiles.settings 結構預留", "@settingsGeneralSubtitle": { "placeholders": { - "currentLanguage": { - "type": "String" - } } }, "settingsPrivacyAndNotificationTitle": "隱私與通知", - "settingsPrivacyAndNotificationSubtitle": "分組管理 privacy 與 notification 佔位設定", "settingsLegalCenterTitle": "關於與協議", - "settingsLegalCenterSubtitle": "查看關於我們、隱私政策與服務條款", "settingsCoinCenterTitle": "點數中心", - "settingsCoinCenterSubtitle": "目前餘額 {balance} 點數,查看套餐與儲值入口", "@settingsCoinCenterSubtitle": { "placeholders": { - "balance": { - "type": "int" - } } }, "settingsCoinHeroSubtitle": "點數可用於後續起卦與相關服務消費", "settingsAiLanguage": "AI 回覆語言", - "settingsAiLanguageHint": "該欄位將對齊 profiles.settings.preferences.ai_language,後續接入真實偏好設定。", - "settingsTimezone": "時區", - "settingsTimezoneHint": "該欄位將對齊 profiles.settings.preferences.timezone,後續提供時區選擇。", - "settingsCountry": "國家/地區", - "settingsCountryHint": "該欄位將對齊 profiles.settings.preferences.country,後續提供國家或地區選擇。", "settingsPrivacyProfileVisibility": "資料可見性", "settingsPrivacyPersonalization": "個人化推薦", "settingsPrivacyHistoryVisibility": "歷史記錄展示", @@ -125,46 +82,27 @@ "settingsNotificationActivity": "活動提醒", "settingsNotificationResult": "結果提醒", "settingsNotificationHint": "這些選項會落到 profiles.settings.notification 下,目前先提供介面佔位。", - "settingsVersion": "目前版本", - "settingsVersionHint": "版本資訊和更多設定說明會在後續接入真實資料。", - "settingsTapToView": "點擊查看", "settingsComingSoon": "即將上線", "settingsPlaceholderState": "已佔位 {count} 項設定", "@settingsPlaceholderState": { "placeholders": { - "count": { - "type": "int" - } } }, "settingsCurrentValue": "目前值", - "settingsVersionLabel": "設定版本", - "settingsLogoutSubtitle": "登出目前登入帳戶", "settingsLogoutDialogTitle": "確認登出?", "settingsLogoutDialogBody": "登出後需要重新登入才能繼續使用目前帳戶。", "settingsDeleteAccountTitle": "刪除帳號", - "settingsDeleteAccountSubtitle": "永久刪除帳號及相關個人資料", - "settingsDeleteAccountWarningTitle": "刪除前請確認", "settingsDeleteAccountWarningBody": "刪除帳號後,個人資料、歷史記錄、點數資訊等相關資料將被永久刪除,且不可恢復。", "settingsDeleteAccountReRegisterNotice": "重要提示:同一信箱刪除後重新註冊,已消耗積分不會重置或返還。", - "settingsDeleteAccountScopeProfile": "個人資料和帳號資訊會被刪除", - "settingsDeleteAccountScopeHistory": "歷史解卦記錄會被刪除", - "settingsDeleteAccountScopePoints": "點數帳戶與流水記錄會被刪除", "settingsDeleteAccountDialogTitle": "確認永久刪除帳號?", "settingsDeleteAccountDialogBody": "此操作無法撤銷。確認後將立即發起刪除。", "settingsDeleteAccountAction": "確認刪除帳號", - "settingsDeleteAccountProcessing": "正在刪除...", "settingsDeleteAccountWaitAction": "請等待 {seconds} 秒後確認刪除", "@settingsDeleteAccountWaitAction": { "placeholders": { - "seconds": { - "type": "int" - } } }, "settingsCancel": "取消", - "settingsLogoutConfirmHint": "再次點擊確認登出", - "settingsLogoutConfirmAction": "再次點擊確認登出", "settingsEditProfileAction": "編輯", "settingsEditProfileTitle": "編輯個人資訊", "settingsAvatar": "頭像", @@ -173,19 +111,14 @@ "settingsDisplayNameRequired": "請輸入暱稱後再保存", "settingsBio": "個人簡介", "settingsBioHint": "一句話介紹你自己", - "settingsAvatarPickerHint": "支援 PNG / JPG / WEBP,建議上傳清晰正方形頭像", "settingsAvatarChooseFromAlbum": "從相簿選擇頭像", "settingsAvatarUploading": "上傳中...", - "settingsAvatarUploadSuccess": "頭像上傳成功", "settingsAvatarPickPermissionHint": "無法開啟相簿,請在系統設定中允許照片存取權限", "settingsLanguageSection": "介面語言", "settingsCoinBalanceLabel": "目前點數", "settingsCoinBalanceValue": "{balance} 點數", "@settingsCoinBalanceValue": { "placeholders": { - "balance": { - "type": "int" - } } }, "settingsCoinCenterDescription": "", @@ -199,20 +132,12 @@ "settingsCoinAmount": "{amount} 點數", "@settingsCoinAmount": { "placeholders": { - "amount": { - "type": "int" - } } }, "english": "英文", - "chinese": "中文", "traditionalChinese": "繁體中文", - "dialogConfirm": "確定", "agreementSeparator": "、", "agreementAnd": "和", - "aboutUsContent": "你好,歡迎來到覓爻籤問,這是一個借助於AI解讀傳統六爻卦象的平臺,為用戶了解中國傳統易學文化提供一個窗口。\n\n六爻卦象源於《周易》深邃的哲學體系,是古人探索世界執行規律的一種獨特方法。古人認為宇宙萬物相互關聯,在您起卦時,您的心念與時空資訊會凝結 成卦象的方式呈現出來。得到卦象後,再結合《易經》中的爻辭和某些特定規律,如五行生剋、干支沖合等,分析各要素間的發展趨勢,最終斷定出事物可能的走向。\n\n覓爻籤問就是基於這樣的思路而開發出來的平臺,它的核心價值在於幫助您跳出局限思維,從事物全域和演變趨勢的角度看清現況的矛盾 、潛在機會和風險點,為您的判斷和行動提供多一個維度的參考資訊,讓您能更理性、更周全地做決定。用AI解鎖古老智慧,讓覓爻籤問成為您探索趨勢、明晰方向的現代助手吧!\n\n特別提醒\n卦象解讀結果均由AI生成,僅供娛樂參考,切不可作為商業、醫療等專業領域的決策依據。理性看待卦象,自由掌握人生。\n\n粵ICP備2025428416號-1A", - "privacyContent": "尊敬的用戶:\n歡迎使用覓爻籤問 APP(以下簡稱「覓爻」)。我們深知您的隱私對您至關重要,因此非常重視保護您的個人資訊。本隱私政策將向您說明我們在您使用服務時如何收集、使用、儲存和共享您的個人資訊,以及您如何存取和管理這些資訊。\n\n一、我們收集哪些您的個人資訊\n1. 您主動提供的資訊:帳號註冊資訊、個人資料資訊、解卦相關資訊。\n2. 我們自動收集的資訊:裝置資訊、日誌資訊。\n\n二、我們如何使用您的個人資訊\n1. 提供和優化服務:利用您提供的卦象問題、解卦方式等資訊生成解卦結果,並持續優化演算法。\n2. 帳號管理和服務運營:用於登入驗證、帳號安全監測、服務改進。\n3. 與您溝通和聯繫:用於服務通知、用戶回饋與客服支援。\n\n三、我們如何儲存您的個人資訊\n1. 儲存地點:原則上儲存於中華人民共和國境內。\n2. 儲存期限:僅在符合法律要求及實現服務目的所必需的最短時間範圍內儲存,超期後刪除或匿名化處理。\n\n四、我們如何共享您的個人資訊\n除以下情況外,我們不會與第三方共享您的個人資訊:獲得您的明確同意;與服務提供商合作;法律要求或保護合法權益;涉及企業收購、合併或破產。\n\n五、您的權利\n您有權存取、更正、刪除個人資訊,也可以申請註銷帳號。帳號註銷後,相關資料可能無法恢復。\n\n六、未成年人保護\n如果您是未滿 14 週歲的未成年人,請在父母或法定監護人的指導下使用服務,並確保事先獲得其同意。\n\n七、您的個人資訊安全\n我們採取合理的安全措施和技術手段,保護您的個人資訊免遭未經授權的存取、公開披露、使用、修改、損壞或丟失,包括加密、存取控制、安全審計和監控等措施。\n\n八、本隱私政策的更新\n我們可能會根據業務發展、法律法規變化或服務調整適時更新本隱私政策,並通過顯著方式通知重大變更。\n\n九、如何聯繫我們\n如果您對本隱私政策有任何疑問、意見或建議,可通過信箱 xuyunlong@xunmee.com 與我們聯繫。\n\n洵覓科技(深圳)有限公司\n2025年6月1日", - "termsContent": "第一章 總則\n1. 歡迎使用覓爻籤問 APP。覓爻由洵覓科技(深圳)有限公司開發、運營和維護,旨在為用戶提供實際、有趣的解卦體驗。\n2. 用戶在使用覓爻服務之前,應仔細閱讀並充分理解本服務條款。通過下載、安裝、註冊、登入或使用等任一方式開始使用覓爻,即表示用戶已充分理解並完全接受本服務條款。\n3. 如用戶不同意本服務條款的任何內容,請不要進行後續操作。\n\n第二章 服務說明\n覓爻提供基於人工智慧技術的解卦服務,包括手動起卦、自動起卦等基礎功能。因系統維護、故障、不可抗力或其他合理原因導致的服務中斷或暫停,不視為違約。\n\n第三章 用戶帳號與資訊安全\n用戶應確保註冊資格合法,提供真實、準確、完整、有效的資料,並妥善保管帳號及身份驗證資訊。覓爻會按照隱私政策收集、使用和保護必要的個人資訊。\n\n第四章 智慧財產權聲明\n覓爻整體內容及相關商標、標識、網域名稱等智慧財產權均受法律保護。未經書面許可,用戶不得複製、修改、出租、出借、出售、傳播或通過反向工程、反編譯、反彙編等方式取得原始碼。\n\n第五章 用戶行為規範\n用戶不得發布違法違規內容,不得侵犯他人合法權益,不得破壞服務正常執行,不得進行未經授權的商業活動。對於違反規範的行為,覓爻有權採取警告、限制功能、封禁帳號等措施,並保留追究法律責任的權利。\n\n第六章 法律責任與免責條款\n如果用戶違反本服務條款導致洵覓科技或關聯公司遭受損失,用戶應承擔賠償責任。解卦結果僅供參考,不能作為實際決策的唯一依據;因依賴解卦結果產生的後果,由用戶自行承擔風險。\n\n第七章 爭議解決\n本服務條款適用中華人民共和國法律。因本服務條款引起的爭議,應先友好協商;協商不成的,任一方有權向洵覓科技公司註冊地有管轄權的人民法院提起訴訟。\n\n第八章 其他條款\n覓爻可以通過聯繫方式、系統訊息、站內信、公告等方式向用戶送達通知。若用戶需要聯繫洵覓科技,可通過信箱 xuyunlong@xunmee.com 提交請求或回饋。\n\n洵覓科技(深圳)有限公司\n2025年6月1日", "disclaimerContent": "免責聲明內容展示佔位。", "toastLabelInfo": "提示", "toastLabelSuccess": "成功", @@ -235,15 +160,10 @@ "divinationQuestionInputPrompt": "請輸入您想佔卜的問題", "divinationQuestionInputHint": "請描述您的問題,描述越詳細解卦越準確", "divinationStartButton": "開始起卦", - "divinationCoinBalance": "目前可用銅幣:{balance} 枚", "@divinationCoinBalance": { "placeholders": { - "balance": { - "type": "int" - } } }, - "divinationRefreshBalance": "重新整理餘額", "divinationRecommendManual": "推薦使用手動起卦,解卦更準確!準備三枚一樣的銅錢或硬幣,點擊這裡查看手動起卦教程。", "divinationMethodTipTitle": "起卦方式說明", "divinationMethodTipAuto": "自動起卦:不需要銅錢或硬幣,按照引導完成搖卦。", @@ -285,7 +205,6 @@ "autoCoinFaceZi": "字", "autoCoinFaceHua": "花", "divinationIAcknowledge": "我知道了", - "divinationClose": "關閉", "divinationModify": "修改", "questionTypeCareer": "事業", "questionTypeLove": "情感", @@ -302,12 +221,6 @@ "divinationCostDialogBody": "本次解卦將消耗 {cost} 點數,目前可用 {balance} 點數。是否繼續?", "@divinationCostDialogBody": { "placeholders": { - "cost": { - "type": "int" - }, - "balance": { - "type": "int" - } } }, "divinationCostDialogConfirm": "確認解卦", @@ -315,14 +228,10 @@ "toastContentCopiedWithTitle": "{title}已複製", "@toastContentCopiedWithTitle": { "placeholders": { - "title": { - "type": "String" - } } }, "resultScreenTitle": "解卦結果", "resultAIAnalysis": "AI解卦", - "resultShare": "分享", "resultBasicInfo": "基本資訊", "resultHexagramDetail": "卦象詳情", "resultConclusion": "解卦結論", @@ -347,19 +256,8 @@ "followUpScreenTitle": "繼續追問", "followUpEmpty": "暫無訊息", "followUpQuotaUsed": "本次會話追問次數已用完", - "followUpInputHint": "輸入您想繼續追問的問題", - "followUpHoldToSpeak": "按住說話", - "followUpRecording": "鬆開發送", - "followUpRecordingHint": "上滑取消", - "followUpTranscribing": "語音轉文字中...", - "followUpGenerating": "正在生成回覆...", - "followUpStepWorker": "正在分析卦象並生成回覆", - "followUpStepGeneric": "正在處理:{stepName}", "@followUpStepGeneric": { "placeholders": { - "stepName": { - "type": "String" - } } }, "errorAudioUnsupportedFormat": "音頻格式不支援,請使用 wav", @@ -400,8 +298,6 @@ "termRiChen": "日辰", "termYuePo": "月破", "termRiChong": "日沖", - "guaNameSimplifiedChars": "风泽观讼师谦随蛊临贲剥复无颐恒壮晋损渐归丰兑涣节济", - "guaNameTraditionalChars": "風澤觀訟師謙隨蠱臨賁剝復無頤恆壯晉損漸歸豐兌渙節濟", "manualScreenTitle": "手動起卦", "manualSelectTime": "選擇起卦時間", "manualSpecifyYaoCombo": "指定銅錢字花組合", @@ -424,63 +320,69 @@ "autoShakeCountdown": "{seconds} 秒後自動停止", "@autoShakeCountdown": { "placeholders": { - "seconds": { - "type": "int" - } } }, "autoShakeRemaining": "您還需搖 {count} 次", "@autoShakeRemaining": { "placeholders": { - "count": { - "type": "int" - } } }, "autoShakeComplete": "點擊頁面底部開始解卦", - "autoTryShakePhone": "您也可以試試搖晃手機來起卦", - "autoSimBalance": "目前可用銅幣:{balance} 枚", "@autoSimBalance": { "placeholders": { - "balance": { - "type": "int" - } } }, - "autoGuideTitle": "自動起卦教程", - "autoGuideInstruction": "搖晃手機或點擊按鈕,連續搖 6 次即可形成完整卦象。", "dateTab": "日期", "timeTab": "時間", "confirm": "確認", + "dialogConfirm": "確定", "cancel": "取消", - "coinFaceGuideTitle": "字花對照說明", - "coinFaceGuideDescription": "左側為花面,右側為字面。", "settingsInviteTitle": "我的邀請", - "settingsInviteSubtitle": "邀請好友,共同獲得獎勵", "settingsInviteMyCode": "我的邀請碼", "settingsInviteCopySuccess": "邀請碼已複製", - "settingsInviteCopied": "已複製", "settingsInviteCopy": "複製", "settingsInviteStats": "已邀請:{count} 位好友", "@settingsInviteStats": { "placeholders": { - "count": { - "type": "int" - } } }, "settingsInviteBindCode": "綁定邀請碼", - "settingsInviteBindHint": "輸入好友的邀請碼", "settingsInviteBindPlaceholder": "6位邀請碼", "settingsInviteBindButton": "綁定", "settingsInviteBindSuccess": "邀請碼綁定成功", - "settingsInviteBindFailed": "邀請碼綁定失敗", - "settingsInviteGenerateTitle": "產生我的邀請碼", "settingsInviteGenerateButton": "產生我的邀請碼", "settingsInviteGenerateSuccess": "邀請碼產生成功", "settingsInviteEmptyTitle": "邀請好友,獲得獎勵", "settingsInviteEmptyDescription": "每成功邀請一位好友註冊,您將獲得積分獎勵", "settingsInviteInputLabel": "輸入邀請碼(選填)", "settingsInviteInputHint": "輸入邀請碼綁定您的邀請人", - "settingsInviteInvalidCode": "請輸入有效的6位邀請碼" + "settingsInviteInvalidCode": "請輸入有效的6位邀請碼", + "notifyCenterTitle": "通知", + "notifyMarkAllRead": "全部已讀", + "notifyLoadFailed": "載入失敗", + "notifyRetry": "重試", + "notifyEmpty": "暫無通知", + "timeJustNow": "剛剛", + "timeMinutesAgo": "{minutes}分鐘前", + "@timeMinutesAgo": { + "placeholders": { + } + }, + "timeHoursAgo": "{hours}小時前", + "@timeHoursAgo": { + "placeholders": { + } + }, + "timeDaysAgo": "{days}天前", + "@timeDaysAgo": { + "placeholders": { + } + }, + "resultFocusPoints": "斷卦要點", + "wuXingMu": "木", + "wuXingHuo": "火", + "wuXingTu": "土", + "wuXingJin": "金", + "wuXingShui": "水", + "retry": "重試" } diff --git a/apps/lib/shared/utils/locale_selector.dart b/apps/lib/shared/utils/locale_selector.dart new file mode 100644 index 0000000..290ee2c --- /dev/null +++ b/apps/lib/shared/utils/locale_selector.dart @@ -0,0 +1,34 @@ +import 'package:flutter/material.dart'; + +/// Locale-aware name selector for terminology fields. +/// +/// Selects the appropriate field based on user locale: +/// - zh-Hant (Traditional Chinese) → uses `_hant` suffix fields +/// - zh (Simplified Chinese) or en (English) → uses base fields +class LocaleNameSelector { + const LocaleNameSelector._(this._isHant); + + final bool _isHant; + + /// Creates a selector from the given [locale]. + factory LocaleNameSelector.fromLocale(Locale locale) { + final isHant = locale.scriptCode == 'Hant'; + return LocaleNameSelector._(isHant); + } + + /// Creates a selector from the given [context]. + factory LocaleNameSelector.of(BuildContext context) { + final locale = Localizations.localeOf(context); + return LocaleNameSelector.fromLocale(locale); + } + + /// Selects between simplified and traditional Chinese name. + /// + /// Returns [nameHant] for zh-Hant locale, [name] otherwise. + String name(String name, String nameHant) { + return _isHant ? nameHant : name; + } + + /// Returns true if the current locale uses Traditional Chinese. + bool get isTraditionalChinese => _isHant; +} diff --git a/backend/src/core/divination/terminology.py b/backend/src/core/divination/terminology.py new file mode 100644 index 0000000..1afb167 --- /dev/null +++ b/backend/src/core/divination/terminology.py @@ -0,0 +1,50 @@ +"""简繁术语映射表。 + +用于将简体中文术语转换为繁体中文版本。 +""" + +# 六亲简体 → 繁体 +LIU_QIN_HANT = { + "子孙": "子孫", + "妻财": "妻財", +} + +# 六神简体 → 繁体(只有"龙"需要转换,其他单字简繁相同) +LIU_SHOU_HANT = { + "龙": "龍", +} + +# 卦名常见简体 → 繁体 +# 六十四卦中需要转换的字符:为→為、贲→賁、颐→頤、离→離、无→無、壮→壯、晋→晉 +GUA_NAME_HANT = { + "为": "為", + "贲": "賁", + "颐": "頤", + "离": "離", + "无": "無", + "壮": "壯", + "晋": "晉", +} + + +def to_hant(text: str, mapping: dict[str, str]) -> str: + """将文本中的字符根据映射表转换为繁体。""" + result = text + for simplified, traditional in mapping.items(): + result = result.replace(simplified, traditional) + return result + + +def liu_shou_to_hant(single_char: str) -> str: + """将六神单字转换为繁体。""" + return LIU_SHOU_HANT.get(single_char, single_char) + + +def liu_qin_to_hant(relation: str) -> str: + """将六亲转换为繁体。""" + return to_hant(relation, LIU_QIN_HANT) + + +def gua_name_to_hant(name: str) -> str: + """将卦名转换为繁体。""" + return to_hant(name, GUA_NAME_HANT)