Switch to Gettext translations #2

Closed
opened 2024-11-30 03:00:54 +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 (see *.tr file)
  • Move old translation files away
  • Do German translation and whitebox-check all translations

Configure Repository and Codeberg Translate project component

  • 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. Modname
    2. [slug]
    3. [unchecked]
    4. [unchanged]
    5. English
    6. Git
    7. [repo URL]
    8. main
  • Choose translation file format gettext PO file
  • Create component
    1. License should be detected as MIT
    2. Push URL = Repo URL
    3. Push branch = main
    4. Template for new translations: locale/modname.de.po
  • Manage
    • Translation
      1. Enforced checks
        • Double Space
        • Ellipsis
        • All the “missed/missing” ones
        • All the “starting/trailing” ones
      2. Version control
        • Repository push URL including API key
    • Files
      1. Uncheck “Edit base file”
  • 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
  • Content database
  • Readme
  • Forum post
# 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)

Content Database

  • Create new release
## 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 (see `*.tr` file) * [x] Move old translation files away * [x] Do German translation and whitebox-check all translations ## Configure Repository and Codeberg Translate project component * [x] Add “initial German translation” PO file in Git and push * [x] Add *weblate-bot* as contributor (write permissions) * [x] Add new component in Codeberg Translate translation project 1. Modname 2. [slug] 3. [unchecked] 4. [unchanged] 5. English 6. Git 7. [repo URL] 8. main * [x] Choose translation file format *gettext PO file* * [x] Create component 1. License should be detected as MIT 2. Push URL = Repo URL 3. Push branch = main 4. Template for new translations: locale/modname.de.po * [x] Manage * Translation 1. Enforced checks * Double Space * Ellipsis * All the “missed/missing” ones * All the “starting/trailing” ones 2. Version control * Repository push URL including API key * Files 1. [x] Uncheck “Edit base file” * [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 * [x] Content database * [x] Readme * [x] Forum post ```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) ``` ## Content Database * [x] Create new release
dirk self-assigned this 2024-11-30 03:03:13 +01:00
dirk referenced this issue from a commit 2024-12-02 22:58:42 +01:00
dirk closed this issue 2024-12-02 23:01:51 +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.

Dependencies

No dependencies set.

Reference: dirk/hunger_ng#2
No description provided.