refactor: enhance localization support in chat and voice input features

- Integrated localization for various dialog messages and UI elements in the chat and voice input components.
- Updated the confirmation dialog to utilize localized strings for delete messages, improving user experience across different languages.
- Enhanced voice input sheet to reflect localized text for status updates, action buttons, and prompts, ensuring consistency in user interactions.
- Improved the file attachment widget to display the attachment label in a localized manner, enhancing accessibility for users in different regions.
- Streamlined localization management by centralizing string retrieval, promoting maintainability and clarity in the codebase.
This commit is contained in:
cogwheel0
2025-10-05 00:05:58 +05:30
parent 072453d588
commit 8629e1e039
14 changed files with 455 additions and 66 deletions

View File

@@ -127,12 +127,24 @@
"onboardQuickBullet2": "Neuer Chat starten oder Modelle oben verwalten"
,
"addAttachment": "Anhang hinzufügen",
"attachmentLabel": "Anhang",
"tools": "Werkzeuge",
"voiceInput": "Spracheingabe",
"voice": "Sprache",
"voiceStatusListening": "Hört zu…",
"voiceStatusRecording": "Nimmt auf…",
"voiceHoldToTalk": "Zum Sprechen halten",
"voiceAutoSend": "Automatisch senden",
"voiceTranscript": "Transkript",
"voicePromptSpeakNow": "Jetzt sprechen…",
"voicePromptTapStart": "Tippe auf \"Starten\", um zu beginnen",
"voiceActionStop": "Stopp",
"voiceActionStart": "Starten",
"messageInputLabel": "Nachrichteneingabe",
"messageInputHint": "Nachricht eingeben",
"messageHintText": "Nachricht...",
"stopGenerating": "Generierung stoppen",
"codeCopiedToClipboard": "Code in die Zwischenablage kopiert.",
"send": "Senden",
"sendMessage": "Nachricht senden",
"file": "Datei",
@@ -289,6 +301,9 @@
"appCustomization": "App-Anpassung",
"appCustomizationSubtitle": "Personalisieren, wie Namen und UI angezeigt werden",
"quickActionsDescription": "Wähle bis zu zwei Schnellzugriffe, die neben dem Eingabefeld angepinnt werden",
"chatSettings": "Chat",
"sendOnEnter": "Mit Enter senden",
"sendOnEnterDescription": "Enter sendet (Soft-Tastatur). Cmd/Ctrl+Enter ebenfalls verfügbar",
"display": "Anzeige",
"realtime": "Echtzeit",
"transportMode": "Transportmodus",

View File

@@ -273,10 +273,52 @@
,
"addAttachment": "Add attachment",
"@addAttachment": {"description": "Button to add an attachment (file/photo)."},
"attachmentLabel": "Attachment",
"@attachmentLabel": {
"description": "Label shown beside attachment chips in messages."
},
"tools": "Tools",
"@tools": {"description": "Header for a tools/actions section."},
"voiceInput": "Voice input",
"@voiceInput": {"description": "Label for voice input feature."},
"voice": "Voice",
"@voice": {"description": "Title for the voice input bottom sheet."},
"voiceStatusListening": "Listening…",
"@voiceStatusListening": {
"description": "Indicates the app is actively listening during voice input."
},
"voiceStatusRecording": "Recording…",
"@voiceStatusRecording": {
"description": "Indicates the app is recording audio for speech recognition."
},
"voiceHoldToTalk": "Hold to talk",
"@voiceHoldToTalk": {
"description": "Toggle label for hold-to-talk mode in voice input."
},
"voiceAutoSend": "Auto-send",
"@voiceAutoSend": {
"description": "Toggle label for automatically sending the final transcript."
},
"voiceTranscript": "Transcript",
"@voiceTranscript": {
"description": "Label above the transcribed voice input text."
},
"voicePromptSpeakNow": "Speak now…",
"@voicePromptSpeakNow": {
"description": "Placeholder prompting the user to start speaking."
},
"voicePromptTapStart": "Tap Start to begin",
"@voicePromptTapStart": {
"description": "Placeholder instructing the user to tap Start to begin recording."
},
"voiceActionStop": "Stop",
"@voiceActionStop": {
"description": "Button label to stop voice recording."
},
"voiceActionStart": "Start",
"@voiceActionStart": {
"description": "Button label to start voice recording."
},
"messageInputLabel": "Message input",
"@messageInputLabel": {"description": "Accessibility label for the message input."},
"messageInputHint": "Type your message",
@@ -287,6 +329,10 @@
"@stopGenerating": {"description": "Action to stop the assistant's response generation."},
"send": "Send",
"@send": {"description": "Primary action to send a message."},
"codeCopiedToClipboard": "Code copied to clipboard.",
"@codeCopiedToClipboard": {
"description": "Snack bar message confirming code was copied."
},
"sendMessage": "Send message",
"@sendMessage": {"description": "Semantic label for sending a message."},
"file": "File",
@@ -580,6 +626,14 @@
"@appCustomizationSubtitle": {"description": "Subtitle shown under App Customization tile and page header."},
"quickActionsDescription": "Pick up to two shortcuts to pin near the composer",
"@quickActionsDescription": {"description": "Helper text explaining quick action pill selection in customization."},
"chatSettings": "Chat",
"@chatSettings": {"description": "Section header for chat-related customization options."},
"sendOnEnter": "Send on Enter",
"@sendOnEnter": {"description": "Toggle title for sending messages when pressing Enter."},
"sendOnEnterDescription": "Enter sends (soft keyboard). Cmd/Ctrl+Enter also available",
"@sendOnEnterDescription": {
"description": "Explanation of how the Send on Enter toggle behaves."
},
"display": "Display",
"@display": {"description": "Section header for visual and layout related settings."},
"realtime": "Realtime",

View File

@@ -127,12 +127,24 @@
"onboardQuickBullet2": "Lancez Nouveau chat ou gérez les modèles depuis la barre"
,
"addAttachment": "Ajouter une pièce jointe",
"attachmentLabel": "Pièce jointe",
"tools": "Outils",
"voiceInput": "Entrée vocale",
"voice": "Voix",
"voiceStatusListening": "Écoute…",
"voiceStatusRecording": "Enregistrement…",
"voiceHoldToTalk": "Maintenir pour parler",
"voiceAutoSend": "Envoi automatique",
"voiceTranscript": "Transcription",
"voicePromptSpeakNow": "Parlez maintenant…",
"voicePromptTapStart": "Appuyez sur \"Démarrer\" pour commencer",
"voiceActionStop": "Arrêter",
"voiceActionStart": "Démarrer",
"messageInputLabel": "Saisie du message",
"messageInputHint": "Saisissez votre message",
"messageHintText": "Message...",
"stopGenerating": "Arrêter la génération",
"codeCopiedToClipboard": "Code copié dans le presse-papiers.",
"send": "Envoyer",
"sendMessage": "Envoyer le message",
"file": "Fichier",
@@ -289,6 +301,9 @@
"appCustomization": "Personnalisation de l'app",
"appCustomizationSubtitle": "Personnalisez l'affichage des noms et de l'UI",
"quickActionsDescription": "Choisissez jusqu'à deux raccourcis à épingler près du champ de saisie",
"chatSettings": "Discussion",
"sendOnEnter": "Envoyer avec Entrée",
"sendOnEnterDescription": "Entrée envoie (clavier logiciel). Cmd/Ctrl+Entrée aussi disponible",
"display": "Affichage",
"realtime": "Temps réel",
"transportMode": "Mode de transport",

View File

@@ -127,12 +127,24 @@
"onboardQuickBullet2": "Avvia Nuova chat o gestisci i modelli dalla barra"
,
"addAttachment": "Aggiungi allegato",
"attachmentLabel": "Allegato",
"tools": "Strumenti",
"voiceInput": "Input vocale",
"voice": "Voce",
"voiceStatusListening": "In ascolto…",
"voiceStatusRecording": "Registrazione…",
"voiceHoldToTalk": "Tieni premuto per parlare",
"voiceAutoSend": "Invio automatico",
"voiceTranscript": "Trascrizione",
"voicePromptSpeakNow": "Parla ora…",
"voicePromptTapStart": "Tocca \"Avvia\" per iniziare",
"voiceActionStop": "Stop",
"voiceActionStart": "Avvia",
"messageInputLabel": "Input messaggio",
"messageInputHint": "Scrivi il tuo messaggio",
"messageHintText": "Messaggio...",
"stopGenerating": "Interrompi generazione",
"codeCopiedToClipboard": "Codice copiato negli appunti.",
"send": "Invia",
"sendMessage": "Invia messaggio",
"file": "File",
@@ -289,6 +301,9 @@
"appCustomization": "Personalizzazione app",
"appCustomizationSubtitle": "Personalizza la visualizzazione dei nomi e dell'UI",
"quickActionsDescription": "Scegli fino a due scorciatoie da fissare vicino al campo di input",
"chatSettings": "Chat",
"sendOnEnter": "Invia con Invio",
"sendOnEnterDescription": "Invio invia (tastiera software). Cmd/Ctrl+Invio disponibile",
"display": "Schermo",
"realtime": "Tempo reale",
"transportMode": "Modalità di trasporto",

View File

@@ -804,6 +804,12 @@ abstract class AppLocalizations {
/// **'Add attachment'**
String get addAttachment;
/// Label shown beside attachment chips in messages.
///
/// In en, this message translates to:
/// **'Attachment'**
String get attachmentLabel;
/// Header for a tools/actions section.
///
/// In en, this message translates to:
@@ -816,6 +822,66 @@ abstract class AppLocalizations {
/// **'Voice input'**
String get voiceInput;
/// Title for the voice input bottom sheet.
///
/// In en, this message translates to:
/// **'Voice'**
String get voice;
/// Indicates the app is actively listening during voice input.
///
/// In en, this message translates to:
/// **'Listening…'**
String get voiceStatusListening;
/// Indicates the app is recording audio for speech recognition.
///
/// In en, this message translates to:
/// **'Recording…'**
String get voiceStatusRecording;
/// Toggle label for hold-to-talk mode in voice input.
///
/// In en, this message translates to:
/// **'Hold to talk'**
String get voiceHoldToTalk;
/// Toggle label for automatically sending the final transcript.
///
/// In en, this message translates to:
/// **'Auto-send'**
String get voiceAutoSend;
/// Label above the transcribed voice input text.
///
/// In en, this message translates to:
/// **'Transcript'**
String get voiceTranscript;
/// Placeholder prompting the user to start speaking.
///
/// In en, this message translates to:
/// **'Speak now…'**
String get voicePromptSpeakNow;
/// Placeholder instructing the user to tap Start to begin recording.
///
/// In en, this message translates to:
/// **'Tap Start to begin'**
String get voicePromptTapStart;
/// Button label to stop voice recording.
///
/// In en, this message translates to:
/// **'Stop'**
String get voiceActionStop;
/// Button label to start voice recording.
///
/// In en, this message translates to:
/// **'Start'**
String get voiceActionStart;
/// Accessibility label for the message input.
///
/// In en, this message translates to:
@@ -846,6 +912,12 @@ abstract class AppLocalizations {
/// **'Send'**
String get send;
/// Snack bar message confirming code was copied.
///
/// In en, this message translates to:
/// **'Code copied to clipboard.'**
String get codeCopiedToClipboard;
/// Semantic label for sending a message.
///
/// In en, this message translates to:
@@ -1584,6 +1656,24 @@ abstract class AppLocalizations {
/// **'Pick up to two shortcuts to pin near the composer'**
String get quickActionsDescription;
/// Section header for chat-related customization options.
///
/// In en, this message translates to:
/// **'Chat'**
String get chatSettings;
/// Toggle title for sending messages when pressing Enter.
///
/// In en, this message translates to:
/// **'Send on Enter'**
String get sendOnEnter;
/// Explanation of how the Send on Enter toggle behaves.
///
/// In en, this message translates to:
/// **'Enter sends (soft keyboard). Cmd/Ctrl+Enter also available'**
String get sendOnEnterDescription;
/// Section header for visual and layout related settings.
///
/// In en, this message translates to:

View File

@@ -405,12 +405,45 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get addAttachment => 'Anhang hinzufügen';
@override
String get attachmentLabel => 'Anhang';
@override
String get tools => 'Werkzeuge';
@override
String get voiceInput => 'Spracheingabe';
@override
String get voice => 'Sprache';
@override
String get voiceStatusListening => 'Hört zu…';
@override
String get voiceStatusRecording => 'Nimmt auf…';
@override
String get voiceHoldToTalk => 'Zum Sprechen halten';
@override
String get voiceAutoSend => 'Automatisch senden';
@override
String get voiceTranscript => 'Transkript';
@override
String get voicePromptSpeakNow => 'Jetzt sprechen…';
@override
String get voicePromptTapStart => 'Tippe auf \"Starten\", um zu beginnen';
@override
String get voiceActionStop => 'Stopp';
@override
String get voiceActionStart => 'Starten';
@override
String get messageInputLabel => 'Nachrichteneingabe';
@@ -426,6 +459,9 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get send => 'Senden';
@override
String get codeCopiedToClipboard => 'Code in die Zwischenablage kopiert.';
@override
String get sendMessage => 'Nachricht senden';
@@ -829,6 +865,16 @@ class AppLocalizationsDe extends AppLocalizations {
String get quickActionsDescription =>
'Wähle bis zu zwei Schnellzugriffe, die neben dem Eingabefeld angepinnt werden';
@override
String get chatSettings => 'Chat';
@override
String get sendOnEnter => 'Mit Enter senden';
@override
String get sendOnEnterDescription =>
'Enter sendet (Soft-Tastatur). Cmd/Ctrl+Enter ebenfalls verfügbar';
@override
String get display => 'Anzeige';

View File

@@ -400,12 +400,45 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get addAttachment => 'Add attachment';
@override
String get attachmentLabel => 'Attachment';
@override
String get tools => 'Tools';
@override
String get voiceInput => 'Voice input';
@override
String get voice => 'Voice';
@override
String get voiceStatusListening => 'Listening…';
@override
String get voiceStatusRecording => 'Recording…';
@override
String get voiceHoldToTalk => 'Hold to talk';
@override
String get voiceAutoSend => 'Auto-send';
@override
String get voiceTranscript => 'Transcript';
@override
String get voicePromptSpeakNow => 'Speak now…';
@override
String get voicePromptTapStart => 'Tap Start to begin';
@override
String get voiceActionStop => 'Stop';
@override
String get voiceActionStart => 'Start';
@override
String get messageInputLabel => 'Message input';
@@ -421,6 +454,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get send => 'Send';
@override
String get codeCopiedToClipboard => 'Code copied to clipboard.';
@override
String get sendMessage => 'Send message';
@@ -822,6 +858,16 @@ class AppLocalizationsEn extends AppLocalizations {
String get quickActionsDescription =>
'Pick up to two shortcuts to pin near the composer';
@override
String get chatSettings => 'Chat';
@override
String get sendOnEnter => 'Send on Enter';
@override
String get sendOnEnterDescription =>
'Enter sends (soft keyboard). Cmd/Ctrl+Enter also available';
@override
String get display => 'Display';

View File

@@ -410,12 +410,45 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get addAttachment => 'Ajouter une pièce jointe';
@override
String get attachmentLabel => 'Pièce jointe';
@override
String get tools => 'Outils';
@override
String get voiceInput => 'Entrée vocale';
@override
String get voice => 'Voix';
@override
String get voiceStatusListening => 'Écoute…';
@override
String get voiceStatusRecording => 'Enregistrement…';
@override
String get voiceHoldToTalk => 'Maintenir pour parler';
@override
String get voiceAutoSend => 'Envoi automatique';
@override
String get voiceTranscript => 'Transcription';
@override
String get voicePromptSpeakNow => 'Parlez maintenant…';
@override
String get voicePromptTapStart => 'Appuyez sur \"Démarrer\" pour commencer';
@override
String get voiceActionStop => 'Arrêter';
@override
String get voiceActionStart => 'Démarrer';
@override
String get messageInputLabel => 'Saisie du message';
@@ -431,6 +464,9 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get send => 'Envoyer';
@override
String get codeCopiedToClipboard => 'Code copié dans le presse-papiers.';
@override
String get sendMessage => 'Envoyer le message';
@@ -837,6 +873,16 @@ class AppLocalizationsFr extends AppLocalizations {
String get quickActionsDescription =>
'Choisissez jusqu\'à deux raccourcis à épingler près du champ de saisie';
@override
String get chatSettings => 'Discussion';
@override
String get sendOnEnter => 'Envoyer avec Entrée';
@override
String get sendOnEnterDescription =>
'Entrée envoie (clavier logiciel). Cmd/Ctrl+Entrée aussi disponible';
@override
String get display => 'Affichage';

View File

@@ -402,12 +402,45 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get addAttachment => 'Aggiungi allegato';
@override
String get attachmentLabel => 'Allegato';
@override
String get tools => 'Strumenti';
@override
String get voiceInput => 'Input vocale';
@override
String get voice => 'Voce';
@override
String get voiceStatusListening => 'In ascolto…';
@override
String get voiceStatusRecording => 'Registrazione…';
@override
String get voiceHoldToTalk => 'Tieni premuto per parlare';
@override
String get voiceAutoSend => 'Invio automatico';
@override
String get voiceTranscript => 'Trascrizione';
@override
String get voicePromptSpeakNow => 'Parla ora…';
@override
String get voicePromptTapStart => 'Tocca \"Avvia\" per iniziare';
@override
String get voiceActionStop => 'Stop';
@override
String get voiceActionStart => 'Avvia';
@override
String get messageInputLabel => 'Input messaggio';
@@ -423,6 +456,9 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get send => 'Invia';
@override
String get codeCopiedToClipboard => 'Codice copiato negli appunti.';
@override
String get sendMessage => 'Invia messaggio';
@@ -826,6 +862,16 @@ class AppLocalizationsIt extends AppLocalizations {
String get quickActionsDescription =>
'Scegli fino a due scorciatoie da fissare vicino al campo di input';
@override
String get chatSettings => 'Chat';
@override
String get sendOnEnter => 'Invia con Invio';
@override
String get sendOnEnterDescription =>
'Invio invia (tastiera software). Cmd/Ctrl+Invio disponibile';
@override
String get display => 'Schermo';