@@ -75,8 +75,7 @@ const LANGUAGES = {
7575 'action.copy_not_supported' : 'Copy not supported in this environment' ,
7676 'action.action_failed' : 'Action failed. Please try again.' ,
7777 'action.cannot_share' : 'Cannot share:' ,
78-
79- // System messages
78+ // System messages
8079 'system.security_warning' : '⚠️ This link uses an old format. Room data is not encrypted.' ,
8180 'system.file_send_failed' : 'Failed to send files:' ,
8281 'system.joined' : 'joined the conversation' ,
@@ -85,6 +84,30 @@ const LANGUAGES = {
8584 'system.private_message_failed' : 'Cannot send private message to' ,
8685 'system.private_file_failed' : 'Cannot send private file to' ,
8786 'system.user_not_connected' : 'User might not be fully connected.' ,
87+ // Help page
88+ 'help.title' : 'User Guide' ,
89+ 'help.back_to_login' : 'Back to Login' ,
90+ 'help.usage_guide' : 'User Guide' ,
91+ 'help.what_is_nodecrypt' : '🔐 What is NodeCrypt?' ,
92+ 'help.what_is_nodecrypt_desc' : 'NodeCrypt is an open-source end-to-end encrypted chat system with a database-free architecture. All messages are encrypted locally on your device, and servers and intermediaries cannot decrypt any of your chat content.' ,
93+ 'help.how_to_start' : '🚀 How to Start?' ,
94+ 'help.step_username' : 'Username' ,
95+ 'help.step_username_desc' : 'Choose a nickname' ,
96+ 'help.step_node_name' : 'Node Name' ,
97+ 'help.step_node_name_desc' : 'Create or join an existing node' ,
98+ 'help.step_password' : 'Node Password' ,
99+ 'help.step_password_desc' : 'Ensure node independence when room names are the same' ,
100+ 'help.step_join' : 'Click "Join Room"' ,
101+ 'help.step_join_desc' : 'Start end-to-end encrypted chatting' ,
102+ 'help.security_features' : '🔑 Security Features' ,
103+ 'help.e2e_encryption' : 'End-to-End Encryption' ,
104+ 'help.e2e_encryption_desc' : 'Messages can only be decrypted by you and the recipient' ,
105+ 'help.no_history' : 'No History Records' ,
106+ 'help.no_history_desc' : 'New users cannot see historical messages' ,
107+ 'help.password_protection' : 'Password Protection' ,
108+ 'help.password_protection_desc' : 'Room password participates in the encryption process' ,
109+ 'help.anonymous_communication' : 'Anonymous Communication' ,
110+ 'help.anonymous_communication_desc' : 'No need to register real identity' ,
88111 }
89112 } ,
90113 zh : {
@@ -158,8 +181,7 @@ const LANGUAGES = {
158181 'action.copy_not_supported' : '此环境不支持复制功能' ,
159182 'action.action_failed' : '操作失败,请重试。' ,
160183 'action.cannot_share' : '无法分享:' ,
161-
162- // System messages
184+ // System messages
163185 'system.security_warning' : '⚠️ 此链接使用旧格式,房间数据未加密。' ,
164186 'system.file_send_failed' : '文件发送失败:' ,
165187 'system.joined' : '加入了对话' ,
@@ -168,6 +190,31 @@ const LANGUAGES = {
168190 'system.private_message_failed' : '无法发送私信给' ,
169191 'system.private_file_failed' : '无法发送私密文件给' ,
170192 'system.user_not_connected' : '用户可能未完全连接。' ,
193+
194+ // Help page
195+ 'help.title' : '使用说明' ,
196+ 'help.back_to_login' : '返回登录' ,
197+ 'help.usage_guide' : '使用说明' ,
198+ 'help.what_is_nodecrypt' : '🔐 什么是 NodeCrypt?' ,
199+ 'help.what_is_nodecrypt_desc' : 'NodeCrypt 是一个开源的端到端加密聊天系统,采用无数据库架构设计。所有消息在您的设备上本地加密,服务器和中间人无法解密您的任何聊天内容。' ,
200+ 'help.how_to_start' : '🚀 如何开始?' ,
201+ 'help.step_username' : '用户名' ,
202+ 'help.step_username_desc' : '选择一个昵称' ,
203+ 'help.step_node_name' : '节点名称' ,
204+ 'help.step_node_name_desc' : '创建或加入现有节点' ,
205+ 'help.step_password' : '节点密码' ,
206+ 'help.step_password_desc' : '确保房间号相同时节点的独立性' ,
207+ 'help.step_join' : '点击"加入房间"' ,
208+ 'help.step_join_desc' : '开始端到端加密聊天' ,
209+ 'help.security_features' : '🔑 安全特性' ,
210+ 'help.e2e_encryption' : '端到端加密' ,
211+ 'help.e2e_encryption_desc' : '消息仅您和接收者可解密' ,
212+ 'help.no_history' : '无历史记录' ,
213+ 'help.no_history_desc' : '新用户无法看到历史消息' ,
214+ 'help.password_protection' : '密码保护' ,
215+ 'help.password_protection_desc' : '房间密码参与加密过程' ,
216+ 'help.anonymous_communication' : '匿名通信' ,
217+ 'help.anonymous_communication_desc' : '无需注册真实身份' ,
171218 }
172219 }
173220} ;
@@ -323,11 +370,30 @@ export function updateStaticTexts() {
323370 settingsBtn . title = t ( 'action.settings' , 'Settings' ) ;
324371 settingsBtn . setAttribute ( 'aria-label' , t ( 'action.settings' , 'Settings' ) ) ;
325372 }
326-
327- // Update back button title
373+ // Update back button title
328374 const backBtn = document . getElementById ( 'settings-back-btn' ) ;
329375 if ( backBtn ) {
330376 backBtn . title = t ( 'action.back' , 'Back' ) ;
331377 backBtn . setAttribute ( 'aria-label' , t ( 'action.back' , 'Back' ) ) ;
332378 }
379+
380+ // Update all elements with data-i18n attribute
381+ // 更新所有具有data-i18n属性的元素
382+ const i18nElements = document . querySelectorAll ( '[data-i18n]' ) ;
383+ i18nElements . forEach ( element => {
384+ const key = element . getAttribute ( 'data-i18n' ) ;
385+ if ( key ) {
386+ element . textContent = t ( key , element . textContent || key ) ;
387+ }
388+ } ) ;
389+
390+ // Update all elements with data-i18n-title attribute
391+ // 更新所有具有data-i18n-title属性的元素
392+ const i18nTitleElements = document . querySelectorAll ( '[data-i18n-title]' ) ;
393+ i18nTitleElements . forEach ( element => {
394+ const key = element . getAttribute ( 'data-i18n-title' ) ;
395+ if ( key ) {
396+ element . title = t ( key , element . title || key ) ;
397+ }
398+ } ) ;
333399}
0 commit comments