Skip to content

feat: Add on-the-fly multi-language translation, settings language selector, and dynamic app localization - #1

Merged
Darkmintis merged 7 commits into
Darkmintis:mainfrom
DocteurWu:feature/auto-translation-and-fr-locale
Sep 2, 2026
Merged

feat: Add on-the-fly multi-language translation, settings language selector, and dynamic app localization#1
Darkmintis merged 7 commits into
Darkmintis:mainfrom
DocteurWu:feature/auto-translation-and-fr-locale

Conversation

@DocteurWu

@DocteurWu DocteurWu commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Description

This PR introduces automatic on-the-fly translation for non-Latin and foreign language repositories (such as Chinese, Japanese, Korean, Cyrillic, Arabic, etc.) with a configurable multi-language selector in Settings, as well as full French localization for Git Store.

Key Changes

  • Translation Settings & Persistence:
    • New TRANSLATION section in Settings with an on/off switch for automatic translation.
    • Language selector dialog supporting System Default, French, English, Spanish, German, Italian, Portuguese, Russian, Chinese (Simplified/Traditional), Japanese, Korean, Arabic, Turkish, Dutch, and Polish.
    • Persisted via DataStore (TranslationRepository).
  • TranslationService:
    • Lightweight, asynchronous translation service with in-memory caching (ConcurrentHashMap) and Markdown section parsing.
    • Dynamically uses the selected target language.
  • Repository Cards & Lists:
    • Foreign/Chinese repository descriptions are automatically translated to the user's chosen language with an interactive toggle to view the original text.
  • Details Screen:
    • App header description auto-translation with original/translated toggle.
    • Interactive Translate README button allowing users to translate entire Markdown documentation into their target language on demand.
    • Release notes auto-translation in the What's New section.
  • Full French Localization: Comprehensive
    es/values-fr/strings.xml covering the entire UI.

Testing

  • Built and verified on Android device.
  • Unit tests added for translation language resolution and non-Latin character detection.

…lector, and dynamic app localization

- Introduce TranslationService with non-blocking Google/MyMemory translation and in-memory cache
- Add auto-translation for non-Latin and foreign repository descriptions with interactive VO toggles
- Add on-demand Markdown README translation button in the details view
- Add Translation section in Settings with auto-translate switch and multi-language picker
- Support dynamic app-wide locale switching via CompositionLocalProvider
- Provide localized string resources for French, Spanish, German, Japanese, Russian, and Chinese
@DocteurWu
DocteurWu force-pushed the feature/auto-translation-and-fr-locale branch from 5ca86a4 to bfd1cfb Compare August 31, 2026 08:52
@DocteurWu DocteurWu changed the title feat: Add automatic translation for foreign repo descriptions, README, release notes and full French localization feat: Add on-the-fly multi-language translation, settings language selector, and dynamic app localization Aug 31, 2026
@Darkmintis Darkmintis added the enhancement New feature or request label Aug 31, 2026
@Darkmintis

Copy link
Copy Markdown
Owner

Thanks for this PR - first external contribution to Git Store, much appreciated!

@Darkmintis

Copy link
Copy Markdown
Owner

Pushed a fix while testing: removed the unofficial clients5.google.com translate endpoint (not the official Google Cloud API - unreliable and not suitable for a shipped app). Translation now uses MyMemory only.

…down

Persist successful translations, chunk long queries, filter API error text,
and translate readme blocks instead of line-by-line to avoid rate limits and UI jank.
Default auto-translate off, detect content language instead of script heuristics,
and only offer languages with complete app string resources.
…tates

Replace the language dialog with a compact dropdown, localize toggle labels,
surface unavailable translations gracefully, and defer readme auto-translate
so scrolling stays smooth.
Fill all six locale files to match English and add a sync script with
curated overrides for maintaining translations going forward.
…trings

Remove in-session failure cache that blocked manual retries, and fix
failed_to_open placeholders in German and Spanish.
@Darkmintis

Copy link
Copy Markdown
Owner

Thanks @DocteurWu - great foundation for translation and localization. I tested on device and pushed a few maintainer fixes to feature/auto-translation-and-fr-locale:

MyMemory only - removed unofficial Google Translate; added chunking, disk cache, API error filtering, and block-based readme translation (fixes lag + rate-limit error text leaking into UI)
Neutral defaults - auto-translate off by default; language detection by content language, not script heuristics
Settings UX - compact inline language dropdown; localized toggle labels
Locales - completed fr, de, es, ja, ru, zh (279 strings each); picker limited to languages we actually ship
Edge cases - “Translation unavailable” on failure with retry; original text always shown when translation can't run
Tested on Android 13 - scrolling readme with auto-translate is smooth, translations cache correctly. Planning to merge once CI passes.

@Darkmintis
Darkmintis merged commit 679ff01 into Darkmintis:main Sep 2, 2026
2 checks passed
@DocteurWu

Copy link
Copy Markdown
Contributor Author

Thanks @Darkmintis! Glad I could contribute to Git Store.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants