feat(i18n)/add main languages support#635
Open
Namelessman-Tom wants to merge 7 commits intogoogle-ai-edge:mainfrom
Open
feat(i18n)/add main languages support#635Namelessman-Tom wants to merge 7 commits intogoogle-ai-edge:mainfrom
Namelessman-Tom wants to merge 7 commits intogoogle-ai-edge:mainfrom
Conversation
…anslations - Migrate all hardcoded UI strings to string resources for internationalization - Add Chinese (zh) translations for all new string resources - Update 14 Kotlin files to use stringResource() instead of hardcoded strings New string resources added: - GM4 related: promo_gm4_title, promo_gm4_content, gm4_intro_*, gm4_try_today, etc. - Error messages: error_unsupported_file_type, error_unsupported_model_type, error_web_only_model, etc. - UI labels: retry, read_more, import_model, view_licenses, clear_history_*, etc. - Dialog texts: delete_script_confirmation, live_camera_session_ended, etc. Files modified: - HomeScreen.kt: GM4 intro texts, error dialogs, feature labels - ErrorDialog.kt: Dialog title and button - PromoBannerGm4.kt: Banner title, content and buttons - ModelImportDialog.kt: Cancel and Import buttons - GlobalModelManager.kt: Error dialogs - PromptTemplatesPanel.kt: Placeholder text - SettingsDialog.kt: Buttons and labels - TextInputHistorySheet.kt: Clear history dialog - MessageInputText.kt: Menu items - DownloadAndTryButton.kt: Error dialogs - ChatView.kt: Session ended message - AddOrEditSkillBottomSheet.kt: Delete confirmation dialog - SkillTesterBottomSheet.kt: Input field labels - ExampleCustomTaskScreen.kt: Text color label This change enables proper internationalization support and makes the app ready for additional language translations.
Migrate rest of hardcoded UI strings to string resource files for better internationalization support. This change enables easier maintenance and future localization efforts. Changes: - Add 20+ new string resources in values/strings.xml - Add Chinese translations in values-zh/strings.xml - Replace hardcoded strings with stringResource() calls in: * SettingsDialog.kt (settings, theme, token management) * ModelImportDialog.kt (import dialog titles) * GlobalModelManager.kt (import messages, error messages) * PromoScreenGm4.kt (Gemma 4 promo content) * HomeScreen.kt (model count labels) * ModelList.kt (API documentation links) * NewReleaseNotification.kt (release notification) * MessageInputText.kt (camera action) * ConfigDialog.kt (cancel button) * GalleryAppTopBar.kt (done button)
Migrate remaining hardcoded UI strings to string resource files for better internationalization support. This change enables easier maintenance and future localization efforts. Changes: - Add 60+ new string resources in values/strings.xml - Add Chinese translations in values-zh/strings.xml - Replace hardcoded strings with stringResource() calls in: * AgentChatScreen.kt (agent skills description with link) * GemmaTermsOfUseDialog.kt (Gemma ToS content with link) * MobileActionsChallengeDialog.kt (instructions with bold text and link) * BenchmarkResultsViewer.kt (benchmark labels and units) * ConfigDialog.kt (localized label helper function) - Add labelResId field to ConfigKey and SkillTryOutChip data classes - Update all ConfigKeys with string resource IDs for localized display - Update ExampleCustomTaskScreen.kt with localized config labels
Author
Author
Author
|
A community version with Chinese support was released in Release 1.0.11-i18n-community |
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


The
feat(i18n)branch aims to implement internationalization for the main languages of the application in this repository.In this PR, we have accomplished the following:
Textcomponents or UI purposes tostring.xml(added 200+ lines), facilitating future workvalues-zh/string.xml), implementing Chinese translations for the app's UI textIt's worth noting that to cover all places that should be internationalized as completely as possible and to facilitate internationalization work, we had to first migrate strings that were originally hardcoded in the code. This resulted in modifications to multiple code locations rather than elegantly adding just a
string.xmlfile. Although this work barely changed any code logic or functionality (only modifying tostringResourcecalls andcontext.getStringcalls), this may cause many small-scale impacts to other contributors' workspaces in the repository. However, for the sake of standardization and maintainability, such changes are worthwhile and important.This PR only added support for Chinese, but has laid the foundation for the project's internationalization. Contributors are welcome to continue internationalization work on this branch:
model_allowlist.json, which requires program support for loading files in corresponding languages or other localization solutions