set up weblate translations #1

Closed
opened 2026-02-16 21:51:38 +01:00 by dirk · 0 comments
Owner

Set up translation

  • Configure translator: local S,SN = core.get_translator(modname)
  • Go through all files to use that translator
    • Replace weird placeholder constructs with clean Gettext calls
    • Replace if clauses with pluralization
  • Add -- @TRANSLATORS: information comment where needed
  • Optionally: Move old translation files away
  • Do German translation and whitebox-check all translations

Configure Codeberg Translate project component

  • Make repository publicly available
  • Add “initial German translation” PO file in Git and push
  • Add weblate-bot as contributor (write permissions)
  • Add new component in Codeberg Translate translation project
    1. Component name: the mod’s title
    2. URL slug: the mod’s name (ID)
    3. Source language: English
    4. Source code repository: repository URL
    5. Repository branch: main
  • Choose translation file format gettext PO file
  • Add new translation component
    1. Validate license:as MIT
    2. Push URL = Repo URL + bot access token
    3. Push branch = main
    4. Template for new translations: locale/modname.de.po
    5. Uncheck “Edit base file”
  • Return to Component
    • Operations → Settings → Translation
      1. Translation flags: placeholders:r"@[0-9]"
      2. Enforced checks
        • Double Space
        • Ellipsis
        • All the “missed/missing” ones
        • All the “starting/trailing” ones

Configure Repository

  • Add repo webhook “Forgejo”
    • https://translate.codeberg.org/hooks/gitea/
    • POST
    • json
    • secret (Manage -> Users -> API Access)
    • push
    • *
    • [empty]
    • active
  • Re-open webhook for testing
  • Where old translations exist, migrate them to Codeberg Translate
    • Push changes from Codeberg Translate to the repo
# Translations

Missing your language? Feel free to add it!

[![Translation status](https://translate.codeberg.org/widget/linuxdirks-luanti-mods/COMPONENT/287x66-grey.png)](https://translate.codeberg.org/projects/linuxdirks-luanti-mods/COMPONENT)

## Set up translation * [x] Configure translator: `local S,SN = core.get_translator(modname)` * [x] Go through all files to use that translator * [x] Replace weird placeholder constructs with clean Gettext calls * [x] Replace `if` clauses with pluralization * [x] Add `-- @TRANSLATORS: information` comment where needed * [x] Optionally: Move old translation files away * [x] Do German translation and whitebox-check all translations ## Configure Codeberg Translate project component * [x] Make repository publicly available * [x] Add “initial German translation” PO file in Git and push * [x] Add *weblate-bot* as contributor (write permissions) * [ ] Add new component in Codeberg Translate translation project 1. [x] Component name: the mod’s title 2. [x] URL slug: the mod’s name (ID) 3. [x] Source language: English 4. [x] Source code repository: repository URL 5. [x] Repository branch: `main` * [x] Choose translation file format *gettext PO file* * [x] Add new translation component 1. [x] Validate license:as MIT 2. [x] Push URL = Repo URL + bot access token 3. [x] Push branch = `main` 5. [x] Template for new translations: `locale/modname.de.po` 6. [x] Uncheck “Edit base file” * Return to Component * Operations → Settings → Translation 1. [x] Translation flags: `placeholders:r"@[0-9]"` 2. [x] Enforced checks * [x] Double Space * [x] Ellipsis * [x] All the “missed/missing” ones * [x] All the “starting/trailing” ones ## Configure Repository * [x] Add repo webhook “Forgejo” * `https://translate.codeberg.org/hooks/gitea/` * POST * json * secret (Manage -> Users -> API Access) * push * \* * [empty] * active * [x] Re-open webhook for testing * [x] Where old translations exist, migrate them to Codeberg Translate * [x] Push changes from Codeberg Translate to the repo ## Add link to translation component ```Markdown # Translations Missing your language? Feel free to add it! [![Translation status](https://translate.codeberg.org/widget/linuxdirks-luanti-mods/COMPONENT/287x66-grey.png)](https://translate.codeberg.org/projects/linuxdirks-luanti-mods/COMPONENT) ```
dirk self-assigned this 2026-02-16 21:53:49 +01:00
dirk closed this issue 2026-03-28 23:30:09 +01:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#2 make release-ready
dirk/access_list
Reference
dirk/access_list#1
No description provided.