@@ -51,14 +51,13 @@ export const addUserMessage = (msg: Message) => {
5151 disabled : globalState . modal . isLoading ,
5252 disableCompletedState : true ,
5353 icon : icon ( 14 , edit ) ,
54- label : 'Edit' ,
54+ label : lng ( 'modai.ui.edit' ) ,
5555 onClick : ( msg ) => {
5656 globalState . alertOpen = true ;
5757 confirmDialog ( {
58- title : 'Confirm Edit' ,
59- content :
60- 'Editing this message will delete all responses that came after it. Do you want to proceed?' ,
61- confirmText : 'Edit Message' ,
58+ title : lng ( 'modai.ui.confirm_edit' ) ,
59+ content : lng ( 'modai.ui.confirm_edit_content' ) ,
60+ confirmText : lng ( 'modai.ui.edit_message' ) ,
6261 onCancel : ( ) => {
6362 globalState . alertOpen = false ;
6463 } ,
@@ -138,8 +137,8 @@ export const addAssistantMessage = (msg: Message, config: LocalChatConfig) => {
138137 message : msg ,
139138 disabled : globalState . modal . isLoading ,
140139 icon : icon ( 14 , copy ) ,
141- label : 'Copy' ,
142- completedText : 'Copied!' ,
140+ label : lng ( 'modai.ui.copy' ) ,
141+ completedText : lng ( 'modai.ui.copied' ) ,
143142 onClick :
144143 typeof config . textActions ?. copy === 'function'
145144 ? config . textActions . copy
@@ -154,8 +153,8 @@ export const addAssistantMessage = (msg: Message, config: LocalChatConfig) => {
154153 message : msg ,
155154 disabled : globalState . modal . isLoading ,
156155 icon : icon ( 14 , plus ) ,
157- label : 'Insert' ,
158- completedText : 'Inserted!' ,
156+ label : lng ( 'modai.ui.insert' ) ,
157+ completedText : lng ( 'modai.ui.inserted' ) ,
159158 onClick : config . textActions . insert ,
160159 } ) ,
161160 ) ;
@@ -169,9 +168,9 @@ export const addAssistantMessage = (msg: Message, config: LocalChatConfig) => {
169168 message : msg ,
170169 disabled : globalState . modal . isLoading ,
171170 icon : icon ( 14 , copy ) ,
172- label : 'Copy' ,
173- loadingText : 'Downloading...' ,
174- completedText : 'Copied!' ,
171+ label : lng ( 'modai.ui.copy' ) ,
172+ loadingText : lng ( 'modai.ui.downloading' ) ,
173+ completedText : lng ( 'modai.ui.copied' ) ,
175174 onClick : async ( msg , modal ) => {
176175 const handler =
177176 typeof config . textActions ?. copy === 'function'
@@ -208,9 +207,9 @@ export const addAssistantMessage = (msg: Message, config: LocalChatConfig) => {
208207 message : msg ,
209208 disabled : globalState . modal . isLoading ,
210209 icon : icon ( 14 , plus ) ,
211- label : 'Insert' ,
212- completedText : 'Inserted!' ,
213- loadingText : 'Downloading...' ,
210+ label : lng ( 'modai.ui.insert' ) ,
211+ completedText : lng ( 'modai.ui.inserted' ) ,
212+ loadingText : lng ( 'modai.ui.downloading' ) ,
214213 onClick : async ( msg , modal ) => {
215214 if ( msg . ctx . downloaded === true ) {
216215 insertCb ( msg , modal ) ;
@@ -278,7 +277,7 @@ export const copyToClipboard = async (message: Message) => {
278277 try {
279278 await navigator . clipboard . writeText ( textContent ) ;
280279 } catch {
281- addErrorMessage ( lng ( 'modai.cmp .failed_copy' ) ) ;
280+ addErrorMessage ( lng ( 'modai.error .failed_copy' ) ) ;
282281 }
283282 } else {
284283 try {
@@ -290,7 +289,7 @@ export const copyToClipboard = async (message: Message) => {
290289 document . execCommand ( 'copy' ) ;
291290 document . body . removeChild ( textarea ) ;
292291 } catch {
293- addErrorMessage ( lng ( 'modai.cmp .failed_copy' ) ) ;
292+ addErrorMessage ( lng ( 'modai.error .failed_copy' ) ) ;
294293 }
295294 }
296295} ;
0 commit comments