Translations (Hosted Weblate)
Flow
- Instance: https://hosted.weblate.org/projects/modern-apps/ — one
component per app module, file mask <module>/src/main/res/values-*/strings.xml, source template <module>/src/main/res/values/strings.xml.
- Components read branch
mainof
https://git.maproj.org/Modern-Apps.git, commit translations on Weblate's local main, and push to the translate branch (push_branch=translate, merge_style=rebase, push_on_commit=true). Linked components share the repository of their link target, so one repository error locks every component in the group.
- Translations reach the apps when
translateis merged intomain
in this repo. Until that merge happens, Weblate's rebased translation commits are not ancestors of the remote translate tip, so its hourly push is rejected as non-fast-forward. Merging translate promptly is part of the flow, not an optional cleanup.
Merging translations
Merge origin/translate (or cherry-pick the pending commits from the Weblate git exporter, https://hosted.weblate.org/git/modern-apps/calendar/) into main. Resolve per key, in this order:
- A key deleted from the English source is deleted from every
locale; a translator edit to such a key is dropped, never reintroduced (it would be an orphan ExtraTranslation).
- A key whose English text changed keeps the main-side source; the
translation is retranslated against it in Weblate.
- Otherwise the translator's value wins.
- End-of-file appends on both sides keep both additions; do not
duplicate a key main already carries elsewhere in the file.
Lock recovery
A MergeFailure alert auto-locks all linked components and leaves Weblate's clone mid-rebase. Recovery, in the Weblate UI for one repository-holding component (Calendar covers the calendar-linked group; Backup covers its group):
- Integrate the pending translation commits into
mainas above,
so nothing translators did is lost.
- Repository maintenance → Reset. This discards Weblate's local
commits and mid-rebase state and re-syncs from main. Do not retry the rebase first: it replays the same commits onto the same conflict.
- Unlock the component; the linked components unlock with it.
- Confirm the
MergeFailure/RepositoryOutdatedalerts clear
and a repository push succeeds.
Server-side settings (Weblate project admin)
- With
merge_style=rebaseand a separatetranslatepush branch,
enable force push for the component VCS (git_force_push) so a rebased push to translate succeeds between merges into main; without it every rebase after main moves is a non-fast-forward rejection and pending commits pile up until one conflicts.
- Keep
push_on_commiton so translated strings are committed in
Weblate immediately; the pending-commit list is the recovery source when a lock happens.