Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
translator:add_or_update_translation [2021/06/21 23:22] tedfelix [Use Qt Linguist] |
translator:add_or_update_translation [2025/06/09 14:48] (current) tedfelix [Obsolete Strings] |
//Note: You can have multiple versions of Qt installed. Just in case, I've added "QT_SELECT=qt5" to the command above to make sure you are running the correct version of the Qt tools.// | //Note: You can have multiple versions of Qt installed. Just in case, I've added "QT_SELECT=qt5" to the command above to make sure you are running the correct version of the Qt tools.// |
| |
==== Use Qt Linguist ==== | ==== Add a New Translation ==== |
| |
Next, use Qt Linguist to update the ".ts" (translation) file that you'd like to work on. E.g. if I want to work on the Cantonese translation: | Check the data/locale directory to see if a new translation is needed. |
| |
$ QT_SELECT=qt5 linguist data/locale/zh_CN.ts | |
| |
The various translations that we support are in the data/locale directory. | |
| |
You can use the make-ts script (which uses lupdate) to create a new translation. E.g. to make a new Esperanto translation: | You can use the make-ts script (which uses lupdate) to create a new translation. E.g. to make a new Esperanto translation: |
Load the file with linguist and be sure to set the source language to English and the target language appropriately (Esperanto in this case). | Load the file with linguist and be sure to set the source language to English and the target language appropriately (Esperanto in this case). |
| |
Rosegarden won't recognize this new translation at first. Let us know if you are having trouble and we'll work up the remaining steps. | $ QT_SELECT=qt5 linguist data/locale/eo.ts |
| |
| Rosegarden may not recognize this new translation at first. Let us know if you are having trouble and we'll work up the remaining steps. |
| |
| ==== Use Qt Linguist ==== |
| |
| Next, use Qt Linguist to update the ".ts" (translation) file that you'd like to work on. E.g. if I want to work on the Cantonese translation: |
| |
| $ QT_SELECT=qt5 linguist data/locale/zh_CN.ts |
| |
See the {{https://doc.qt.io/qt-5/linguist-translators.html|Qt Linguist manual}} for details. | See the {{https://doc.qt.io/qt-5/linguist-translators.html|Qt Linguist manual}} for details. |
==== Test the Translation ==== | ==== Test the Translation ==== |
| |
Normally, Rosegarden comes up using your default langauge. You can override this using the "LANG" environment variable. To test the French translation: | Normally, Rosegarden comes up using your default language. You can override this using the "LANGUAGE" environment variable. To test the Italian translation: |
| |
| $ LANGUAGE=it_IT.UTF-8 ./build/rosegarden |
| |
| It used to work like this, so if the above doesn't work, try this: |
| |
$ LANG=fr ./build/rosegarden | $ LANG=fr ./build/rosegarden |
* If any special keys such as **Shift**, **Up**, **Down** and so on that should **not** have been translated as **keyboard shortcuts** appear in these strings, then you **should** translate them in this context. As it happens, I found one example of a string where the author used [] instead of () to mark the shortcut. (This particular string is not from the same place as all the rest under discussion here, and it does not have a TRANSLATOR comment, so I think it fitting to mention it here.) In English, this reads: | * If any special keys such as **Shift**, **Up**, **Down** and so on that should **not** have been translated as **keyboard shortcuts** appear in these strings, then you **should** translate them in this context. As it happens, I found one example of a string where the author used [] instead of () to mark the shortcut. (This particular string is not from the same place as all the rest under discussion here, and it does not have a TRANSLATOR comment, so I think it fitting to mention it here.) In English, this reads: |
| |
<code> | <code xml> |
<qt>Use program changes from an external source to manipulate these controls (only valid for the currently-active track) Shift + P]</qt> | <qt>Use program changes from an external source to manipulate these controls (only valid for the currently-active track) Shift + P]</qt> |
</code> | </code> |
| |
In the Spanish translation, "Shift+P" was translated: | In the Spanish translation, "Shift+P" was translated: |
| |
<code> | <code xml> |
<qt>Utilizar cambios de programa de fuente externa para manipular estos controles (sólo pertenece a la pista activada) [Mayúsculas + P]</qt> | <qt>Utilizar cambios de programa de fuente externa para manipular estos controles (sólo pertenece a la pista activada) [Mayúsculas + P]</qt> |
</code> | </code> |
| |
==== Buttons Stuck in English! ==== | ==== Buttons Stuck in English! ==== |
Report produced on Tue, 24 Nov 2009 21:21:17 -0500 | Report produced on Tue, 24 Nov 2009 21:21:17 -0500 |
</code> | </code> |
| |
| ===== Untranslated Strings ===== |
| |
| Due to a quirk in the linguist UI, it's not unusual to have a number of accidentally untranslated strings. These are shown in the "Untranslated" column in the stats. Some of these untranslated strings might be deliberate, so you'll need to examine each one and fix those that need it. There are two scripts you can use to list the untranslated source strings: lookForUntranslatedStrings and ts-untrans. To use: |
| |
| <code bash>scripts/lookForUntranslatedStrings data/locale/de.ts</code> |
| |
| or |
| |
| <code bash>scripts/ts-untrans data/locale/de.ts</code> |
| |
| Use linguist to search for the strings that look like they should be translated and translate them. |
| |
===== Obsolete Strings ===== | ===== Obsolete Strings ===== |
| |
Strings become obsolete when they have translations, but the source text no longer exists. In many cases, this is because the source text was edited in some small way. You can usually find an obsolete translation that comes close to matching an untranslated string, and make a few small changes to get the translation working again. (This happens particularly often when the source strings have missing or broken markup tags like ''</qt>'' and so on, and someone commits a small update to repair this problem.) | Strings become obsolete when they have translations, but the source text no longer exists. In many cases, this is because the source text was edited in some small way. You can usually find an obsolete translation that comes close to matching an untranslated string, and make a few small changes to get the translation working again. (This happens particularly often when the source strings have missing or broken markup tags like ''</qt>'' and so on, and someone commits a small update to repair this problem.) |
| |