Skip to content

Latest commit

 

History

History

translations

Contribute resource translation

This document explains how to contribute translation resources.
Target readers are non-developers/developers contributors.

translation tasks

  1. add new translation setting
  • add TRANSLATIONS to .pro
  • add .qm to resource
  1. Update (lupdate)
  2. Translate (linguist)
  3. Release (lrelease)

If you are non-developers, please read non-developer section below of this document.


requirement: install Qt development environment and Git

Before starting this task, create a new branch e.g. localize-(locale)
NOTE: (locale) is a place-holder, replace to your actual locale.

1. Add new translation

This is an initial task, need only once per 1 translation.

  1. add TRANSLATIONS += $$PWD/(locale).ts to translations/translations.pri
  2. add <file alias="(locale).qm">../../translations/(locale).qm</file> to ./src/resources/jamtaba.qrc

2. Update translation

invoke lupdate ./PROJECTS/Jamtaba.pro command to update/generate .ts file

3. Translate

open the updated/generated ./translations/(locale).ts file by Qt Linguist

4. Release

.ts file is a source code for message translation.
need to compile them into .qm binary file which Qt application can load.

4.1 Qt Linguist

run "Release" operation in Qt Linguist, will generate .qm file
NOTE: this will generate only current opened file.

4.2 or command line tool

invoke lrelease PROJECTS/Jamtaba.pro
NOTE: this command will generate all translation files listed in TRANSLATIONS

5. Make PR(Pull Request)

As general GitHub workflow, create PR.


non-developer contributors here assume they are not install Qt development environment.

  1. ask developers to generate/update ./translations/(locale).ts file
  2. edit ./translations/(locale).ts by text editor (which support utf-8 encoding)
  3. ask developers to do release tasks.

How to make Pull Request

We need the (locale).ts file which you had modified. How you can send the file, we use GitHub Pull Request as the workflow.

how to make PR (WITHOUT console)

editing status: writing for non-developers

  1. Update your forked repo's master branch (XXX: how to do this ?)
  2. Create branch on GitHub, with branch name 'translate-v(version)-(locale)' e.g: translate-v2.14.0-ja_JP NOTE the version is development version https://github.com/blog/1377-create-and-delete-branches
  3. upload (locale).ts file into ./translations directory.
  4. Create Pull Request

Q&A

  • why use GitHub? can't just send the .ts file via E-mail?
    • GitHub system will automatically record who's contributed.
  • What is "Locale" ?
    • It's a pair of language code and country code
  • how to find the locale string