-
Notifications
You must be signed in to change notification settings - Fork 20
Multi language Support
QLog has a multi-language support. The language is set based on the OS environment setting.
Currently, following languages are implemented:
- English
- Czech
- German
- Spanish
The language can also be set manually via OS's locales or input parameters. An example below shows, how the language can be changed manually via Linux OS environment setting:
LANG=cs_CZ.UTF-8 ./qlog
(for Czech Language)
LANG=de_DE.UTF-8 ./qlog
(for German Language)
For Windows platform, set the LANG
environment variable for application or use:
set LANG=cs_CZ.UTF8
qlog.exe
The language can also be set via QLog's input parameters. QLog contains two input parameters to control the language:
-t, --translation <path/QM-filename>
-t
is implemented mainly for translators who want to test their translations that are not part of QLog. Just enter the absolute or relative path and name of the QM file with the translation, and this translation file will then be used by QLog, e.g., -t /home/qloguser/qlog_cs.qm
.
-l, --language <code>
The -l
parameter can set a language. If the parameter is set, then the OS environment setting is ignored, e.g., -l cs
or -l cs_CZ
.
QLog includes built-in translation files. It is also possible to place the translation files outside of QLog. QLog searches the following directories for translation files.
OS Type | Directories |
---|---|
Linux |
application folder/i18n ~/.local/share/hamradio/QLog/i18n /usr/local/share/hamradio/QLog/i18n /usr/share/hamradio/QLog/i18n build-in QLog translation files
|
Linux (flatpak) | effectively only ~/.var/app/io.github.foldynl.QLog/data/hamradio/QLog/i18n
|
Windows |
<APPDIR>/i18n C:/Users/<USER>/AppData/Local/hamradio/QLog/i18n C:/ProgramData/hamradio/QLog/i18n <APPDIR>/data/i18n <APPDIR>/data/hamradio/QLog/i18n
|
MacOS | TODO - must be confirmed<APPDIR>/i18n ~/Library/Application Support/hamradion/QLog/i18n /Library/Application Support/hamradio/QLog/i18n <APPDIR>/../Resources/i18n
|
The external translation files must be named in this format: qlog_<lang code>.qm
, where <lang code>
can be in short or long form, e.g., cs
or cs_CZ
.
Not only language but also date and time format and distance unit are controlled by OS environment settings. If you wish to use a date and time format different from your language's default, please refer to the following examples:
Date in ISO format (YYYY-MM-DD):
LC_TIME=en_SE.UTF-8
The distance unit is controlled via LC_MEASUREMENT
. All Non-metric units are in miles, and the metric unit is in km.
QLog is a community project. Sharing your translations with the community helps us grow and improve together. Therefore, every GitHub pull request (PR) with translation files will be highly appreciated.
Do you have no experience with application development but want to help to translate QLog?
- Send an email to the main developer (OK1MLG) requesting a translation file. Include the language you want to translate.
- The translation file will be send as soon as possible.
- Download and Install Qt Linguist (if you don't already have it). It is available as a QT component or it is a part of your Linux distribution. For Windows users it is possible to install standalone application.
- Open the
.ts
file in it. Translate the strings to your language and save the file. - Test your translation file. Generate
.qm
file via Qt Linguist (File
→Release As...
). Then start QLog with an input parameter-t <path/QM-filename>
- Once you have completed the
.ts
file send back the.ts
file via email.
Do you already have some experience with development?
- Clone the QLog repository
- Modify the QLog.pro file and add the new language to the
TRANSLATIONS
section.
TRANSLATIONS = i18n/qlog_cs.ts \
i18n/qlog_de.ts \
i18n/qlog_es.ts \
i18n/qlog_zh_CN.ts \
i18n/qlog_<<LANG CODE>>.ts
- Generate the Translation Source File. Run
lupdate
to generate.ts
file in thei18n
directory.
lupdate -no-obsolete QLog.pro
- Translate the newly created
ts.
in Qt Linguist - Test your translation file. Generate
.qm
file via Qt Linguist (File
→Release As...
). Then start QLog with an input parameter-t <path/QM-filename>
- Once you have completed the
.ts
file, generate GitHub Pull Request or send back the.ts
file via email to the main developer (OK1MLG).