Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
translator:add_or_update_translation [2021/05/10 00:44]
tedfelix [Environment]
translator:add_or_update_translation [2025/06/09 14:48] (current)
tedfelix [Obsolete Strings]
Line 1: Line 1:
 ====== Translating Rosegarden ====== ====== Translating Rosegarden ======
 +
 +===== Quick Start =====
 +
 +To work on a translation, you'll need to perform the following steps:
 +
 +  * Build Rosegarden
 +  * Update the .ts Files
 +  * Use Qt Linguist
 +  * Test your translation
 +  * Submit your updated translation for inclusion in Rosegarden.
 +
 +Details follow...
 +
 +==== Build Rosegarden ====
 +
 +You will only be able to test your translations if you can build Rosegarden from source.
 +
 +When doing translations, you'll want to keep up with the latest changes, so it is recommended that you follow the instructions related to using git.  Source snapshots can be used instead if you prefer.
 +
 +Follow the steps on the [[dev:building_rosegarden_from_source|Building Rosegarden from Source]] page to build Rosegarden.
 +
 +==== Update the .ts Files ====
 +
 +Before you start translating, you'll want to make sure all the latest strings and their locations are up-to-date in the ".ts" (translation) files.  Once you have the source, use the make-ts script to update the .ts files to match the code.
 +
 +  $ QT_SELECT=qt5 scripts/make-ts
 +
 +//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.//
 +
 +==== Add a New Translation ====
 +
 +Check the data/locale directory to see if a new translation is needed.
 +
 +You can use the make-ts script (which uses lupdate) to create a new translation.  E.g. to make a new Esperanto translation:
 +
 +  $ QT_SELECT=qt5 scripts/make-ts data/locale/eo.ts
 +
 +Load the file with linguist and be sure to set the source language to English and the target language appropriately (Esperanto in this case).
 +
 +  $ 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.
 +
 +==== Test the 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
 +
 +==== Submit Your Updated Translation ====
 +
 +Once you are finished working on a translation, send the updated .ts file to us.  Compress it with xz or bzip if you can.  Then post it to the patches tracker:
 +
 +https://sourceforge.net/p/rosegarden/patches/
 +
 +You can also send a diff if you prefer.  "git diff" can make one.  Here's how to make a diff file for the Finnish translation:
 +
 +  $ git diff data/locale/fi.ts >fi.ts.diff
 +
 +And you can compress it with xz:
 +
 +  $ xz fi.ts.diff
 +
 +That will give you an ''fi.ts.diff.xz'' file to send to us.
 +
 +===== Introduction =====
 +
 Rosegarden tries to be friendly toward translators, and in fact many of our developers also double as translators.  The more languages we can offer, the better. Rosegarden tries to be friendly toward translators, and in fact many of our developers also double as translators.  The more languages we can offer, the better.
  
Line 121: Line 200:
   * 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! ====
Line 184: Line 263:
 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.)
  
 
 
translator/add_or_update_translation.1620607456.txt.gz · Last modified: 2022/05/06 16:07 (external edit)
Recent changes RSS feed Creative Commons License Valid XHTML 1.0 Valid CSS Driven by DokuWiki