Skip to content

feat(transifex): Let apps keep languages they maintain in the repository - #1007

Open
luflow wants to merge 2 commits into
nextcloud:masterfrom
luflow:feat/keep-languages
Open

luflow wants to merge 2 commits into
nextcloud:masterfrom
luflow:feat/keep-languages

Conversation

@luflow

@luflow luflow commented Oct 2, 2026

Copy link
Copy Markdown

For #1006.

What this does

Commit 1 – keep languages. An app can add .tx/keep-languages with one language code per line:

de
de_DE

The sync then takes l10n/<language>.js|json for those languages from git again instead of overwriting or deleting them. All other languages sync as before. Apps without the file are not affected.

Commit 2 – lock those languages on Transifex. After tx push -s, lockLanguages.sh tags the source strings of the resource with locked_<language> (Preventing Translation Edits), so translators are not asked to work on a language that is never shipped.

  • Only strings missing the tag are sent, existing tags are kept.
  • A failure is logged and does not abort the sync.
  • Tags are only added, never removed.

The commits are separate on purpose, so the second one can be dropped or changed.

Testing

  • Commit 1: ran the changed branch loop under dash against throwaway repositories. The same test fails against master.
  • Commit 2: not tested against Transifex. I have no access to the API with a token that may set tags.

Open questions

  • Is the bot's token allowed to set tags? The help article says only admins and project maintainers can.
  • Is locked_de_DE the right tag for a regional code? The article only shows locked_it.

If this is fine, I will send a paragraph for the developer manual to nextcloud/documentation.

luflow added 2 commits October 2, 2026 15:55
An app can list languages in .tx/keep-languages, one code per line. The l10n files of those languages are taken from git again after the conversion, so the sync neither overwrites nor deletes them. Apps without the file are not affected.

Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
Tags the source strings of the resource with locked_<language> for every language in .tx/keep-languages, so translators are not asked to work on languages the repository maintains itself. A failure does not abort the sync.

Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
@luflow
luflow marked this pull request as ready for review October 2, 2026 14:00
@luflow
luflow requested a review from nickvergessen October 2, 2026 14:00
@nickvergessen

Copy link
Copy Markdown
Member

Don't really have the headspace at the moment to dive into this.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants