Translation

From MythTV Official Wiki
Jump to: navigation, search

Translation maintainers/contributors

Some languages are maintained by teams or individuals, who are interested in keeping their language of choice up to date. Before contributing translations for a language in MythTV, please try to contact existing contributor(s)/maintainer(s) to join efforts on the translation, as well as avoiding conflicting translation patches.


If you feel like you're already maintaining a language or if you want to maintain a language, please add your contact information in the table below. If you want to help out maintaining a language, but don't want to do it alone, also feel free to leave your contact information in the table below, so other people would be able to contact you to create a team.


Current maintainers:

Language Contact person(s) and/or website Team/individual could use some help? Current status
Bulgarian (bg) Jordan Kanev: "danchokanev TA gmail DOT com" New maintainer, just starting v32 status Master status
Catalan (ca) Rubén Llòria: (rubenlloria TA gmail DOT com) Any help or coordinated effort is most welcome. v32 status Master status
Chinese, Hong Kong (zh_hk) Walter Cheuk: "wwycheuk TA gmail DOT com" The best way to discover errors is actual using v32 status Master status
Chinese, Simplified (zh_cn) Bin: "binnxu TA gmail DOT com" Any help or coordinated effort is most welcome. v32 status Master status
Croatian (hr) Website
Andrej Dundovic' (adundovi AT gmail DOT com)
Any help or coordinated effort is most welcome. v32 status Master status
Czech (cs) Website
Petr Srsen: "srsen75 TA seznam 0 cz"
Zdene(k Toman: "zdenyx TA gmail 0 com"
v32 status Master status
Danish (da) Website
Kenni Lund: "kenni TA mythtv 0 dk"
Please get in contact with me if you want to help with the translation. Any help or coordinated effort is most welcome. v32 status Master status
Dutch (nl) Website
Jos Hoekstra: joshoekstra TA gmx 0 net
Any help or coordinated effort is most welcome. v32 status Master status
English (en_gb) Nick Morrott: "knowledgejunkie TA gmail 0 com"
Stuart Morgan: "stuart@tase.co.uk"
British English != American English v32 status Master status
English (en_us) Inactive, maintainers/contributors needed v32 status Master status
English (en_ca) Inactive, maintainers/contributors needed v32 status Master status
Estonian (et) Inactive, maintainers/contributors needed v32 status Master status
Finnish (fi) Inactive, maintainers/contributors needed v32 status Master status
French (fr) Website
Gilles: "choteau.gilles TA orange 0 fr"
Please let us know if you find any problem v32 status Master status
French (fr_CA) Inactive, maintainers/contributors needed Only MythWeb for now
German (de) Jan Hambrecht: jaham TA gmx 0 net v32 status Master status
Greek (el) Yianni Vidalis: "yiannividalis TA hotmail 0 com" v32 status Master status
Hebrew (he) Ido Roseman: "ido [_] roseman [at} yahoo [dot] com" v32 status Master status
Hungarian (hu) Inactive, maintainers/contributors needed v32 status Master status
Icelandic (is) Inactive, maintainers/contributors needed v32 status Master status
Italian (it) Morris Cavestro , Maintainers <<morriscavestro at yahoo.it Any help or coordinated effort is most welcome. v32 status Master status
Japanese (ja) Inactive, maintainers/contributors needed v32 status Master status
Norwegian Bokmål (nb) Rune Evjen: "rune.evjen TA gmail 0 com" Any help or coordinated effort is most welcome. v32 status Master status
Polish (pl) Warped "warpme [at] o2 [dot] pl I'll start with mythfrontend, so plugins are welcome v32 status Master status
Portuguese (pt) jpmoitinho (using google's mail service...) Help is always welcome. v32 status Master status
Portuguese, Brazilian (pt_br) Luzemário Dantas: luzemario (using Google Mail)
Klaubert Herr: klaubert [_at_ ] gmail [d0t ] com
v32 status Master status
Romanian (ro) Inactive, maintainers/contributors needed v32 status Master status
Russian (ru) Website
Alex Vasilyev: "sandybigboy[at]gmail.com"
Alexander Khvostuyk: "axboct[at]gmail.com"
Comments and suggestions, as well as assistance is welcomed. v32 status Master status
Slovene (sl) Inactive, maintainers/contributors needed v32 status Master status
Spanish, Spain (es_es) Inactive, maintainers/contributors needed Spanish Translation Wiki Page v32 status Master status
Spanish, World (es) Inactive, maintainers/contributors needed Spanish Translation Wiki Page v32 status Master status
Swedish (sv) Roger Mårtensson: "roger.martensson TA gmail 0 com" (currently inactive) More help needed! v32 status Master status
Turkish (tr) Inactive, maintainers/contributors needed v32 status Master status



Translate MythTV

Throughout this page, German (de) translation files will be used as examples.

Checkout the latest development version

Checkout the latest development version by running:

git clone git://github.com/MythTV/mythtv.git

Development of MythTV on Github happens in branches. The main development branch is master. Work to finalise a new release and fixes applied after a release happen in a dedicated "fixes" branch. For MythTV 32.0 (due for release in Spring 2022) work is taking place in the fixes/32 branch. When working on translations for a release, please checkout the relevant fixes branch.


Important.png Note: The first thing you should do before beginning to work on your translation is update the translation files as described below. This will both ensure that the latest translatable strings are available for translation but more importantly that the obsolete ones (the ones which are no longer used in MythTV) are marked as obsolete and as such no longer translatable.

Update translation files

To translate the core part of MythTV (mythfrontend), go to the mythtv/i18n directory. To translate the plugins, go to one of the mythplugins/{plugin-name}/i18n directories. Note that all of the remaining steps on this page will use the mythtv/i18n directory to illustrate how to translate the core part of MythTV. Similar steps should be performed on each of the plugin directories, in order to translate the plugins.

Now, to update the translation files with the latest strings, run the following command:

lupdate -locations absolute translate.pro

This will ensure that all translatable strings in the source code are included in the .ts file, which we will work on later.


Important.png Note: As a side note, lupdate also takes an argument called -no-obsolete, which removes all obsolete strings. This might be tempting to do, but ONLY do it when you're COMPLETELY done with the translation (as in 100%). Let's say that a bunch of source strings are fixed in the MythTV source code; Spelling errors, punctuation, whitespace cleanup, etc. Overall the string is the same, only a character or two have been changed. This change will cause the old previously translated string to become obsolete, and the modified string to become a new string. If you still have the obsolete strings, Qt linguist will suggest the old string when you're translating the new string, allowing you to just press Crtl+[1-5] to fill in the old translation. If you've deleted obsolete strings, you'll have to translate the whole sentence once again. Lots of time can typically be saved by keeping obsolete strings until you're done with all translations.

What to do if the translation file does not already exist

If the translation file for the language you want to translate to does not already exist you must add it to the relevant translate.pro and i18n.pro files before issuing the lupdate command listed above. If there is still space at the end of a line please add it there, otherwise please copy one of the previous lines (as long as it is not the first), remove the existing entries and add your new entry. Please note that in the translate.pro file you must add the .ts file name, while in the i18n.pro file you must add the .qm file name. If you need help, please ask on the translators mailing list.

Once you have done that running lupdate will create a new translation file for your language.

Keeping your translation up-to-date

It's quite possible that between the time you checked-out and the time you will be ready to submit your translation new strings will have been added to MythTV.

To get these new strings you must issue the following commands:

git pull


Important.png Note: This must be done the "root" of your repository (the directory that contains the mythtv and mythplugins directories). You will have to stash any local unsaved changes, or commit them to your local branch before rebasing them on top of any upstream changes that are added. Pleas ensure you do not lose any changes you have made to your .ts file when updating your local checkout.

followed by

lupdate -disable-heuristic number -locations absolute translate.pro

This (lupdate) has to be done for each component you are translating, from the correct i18n directory for the particular component.

This process will add new strings if any have been added since the last time you updated, and possibly mark obsoleted strings which have been removed from the application.

Do the translation

Translate .ts file, e.g. mythfrontend_de.ts (for German)

It is most convenient to use the dedicated Qt Linguist translation tool included in Qt (e.g. on Debian/Ubuntu with Qt5, Linguist is found in the qttools5-dev-tools package; on Fedora it is package qt5-linguist). Using Qt Linguist has the advantage of making finding what's left to translate, changing translation status, making translation comments and a whole lot more significantly quicker and easier than using a text or XML editor.

If that's more convenient to you it is possible to use the Windows version of Qt Linguist to edit the translation files without problems (the proper line termination character will be kept).

linguist mythfrontend_de.ts


Important.png Note: Special care should be taken with strings containing words in CAPITAL LETTERS enclosed in "%" or the pipe character (the little vertical bar). Some of these actually contain text that can be translated, but only do so if you are comfortable doing it and can actually test the end result. These special strings are templates used for displaying information and if the code is not recognized it could very well make some screens at least partially unusable. These should, minimally, be filled in with the exact same information from the source code (Ctrl-B in Qt Linguist).


Important.png Note: Please don't forget to specify a language when Qt Linguist prompts for one (and save the translation file even if it's the only thing you changed). If a language is not provided, lupdate will be unable to apply rules relative to your language (such as the plural rules). Once this is done you will need to run lupdate a second time to see the placeholders for the plural form (or forms, if they are applicable to your language) appear.

Compile and test translation

Compile .ts files into .qm files by running:

lrelease -removeidentical translate.pro

The generated .qm file of your language can now be copied into a running MythTV installation for testing:

cp mythfrontend_de.qm /usr/share/mythtv/i18n/

(destination path depends on your MythTV installation)

After restarting the frontend, you can test your translations. If all is OK you can proceed.

Switching languages

If the user interface is not already displayed in your language, an easy way to switch languages is calling mythfrontend with the -p (or --prompt argument) like so:

mythfrontend -p

It is also possible, and maybe easier, to use the setup from mythfrontend: Setup / Appearance / Localisation / Language and then choose your new language.

Submit updated translations

There are two ways that you can make your updated translations available to other MythTV users. If you are comfortable using git and Github you are very welcome to submit a Pull Request, otherwise please send your work as a patch. Details are in the following sections.


Important.png Note: Please do not submit the binary .qm files created by lrelease via Pull Request or email. These will be generated, as necessary, by the MythTV development team before a release.

Create Pull Request

The MythTV development team welcome Pull Requests (PRs) containing translation updates against the official MythTV repository. There is a dedicated label patch:translation to track them. Please ensure your PR applies cleanly against the branch it was created against, and update if necessary. You can submit your updated translations using a Pull Request at MythTV Pull Requests.

Create a Patch

If you are unable to submit a Pull Request, as an alternative you can send a patch file (a diff) or complete .ts files (compressed if possible) directly to Nick Morrott (knowledgejunkie TA gmail 0 com), who will endeavour to commit them to the repository whilst preserving your contribution details.

If creating new files, then you first need to add them to the local repository:

cd ../..
git add mythtv/i18n/mythfrontend_de.ts

You can now create a patch for your translation:

git diff HEAD --no-prefix mythtv/i18n/mythfrontend_de.ts > german_mythtv_translation.diff

If you translate several files (eg. MythTV and some plugins), please merge all of the translations into one patch, instead of creating several patches.

To do this, just put all files on the same line when creating the patch, for example:

cd ../..
git diff HEAD --no-prefix mythtv/i18n/mythfrontend_de.ts mythplugins/*/i18n/*_de.ts > german_translation.diff

Translate MythTV Web Application

The web application runs on port 6544 on mythbackend.

Throughout this page, German (de) translation files will be used as examples.

Checkout the latest development version

Checkout the latest development version by running:

git clone git://github.com/MythTV/mythtv.git

The translation files are in mythtv/mythtv/html/assets/i18n. The default file is en_US.json. All other files are translated from this file.

The files are prepopulated with translations from Google translate.


Important.png Note: For developers. The developer who adds strings must populate the file with google translations by using the following:

cd mythtv/html
./translation-util.py -t

This adds strings that are present in the default file but missing in other files. There are other options in this program, run ./translation-util.py -h .

Do the translation

You only need to update strings that are incorrect.

The way to update the translations is to open en_US.json and de.json in separate windows, compare entries and update de.json. I have not found any free tool that helps with the operation.

meld

You can use meld to compare en_US.json to de.json. This shows the corresponding Englist and German strings on the left and right next to each other. You can directly update the de.json file in meld. Ignore the character highlighting in meld where it is trying to find character level changes between English and German.

Test the changes

Make sure you have not introduced any syntax errors.

cd mythtv/html
./translation-util.py -t

This will crash if there are errors in any of the translation files.

View the changes

cd mythtv/html
./translation-util.py -t

Changed lines show a - with the previous text and + with the new text. Make sure there are no unexpected changes.

To test the translation, do the following.

Install the latest MythTV code, either by building and installing yourself, or by using the PPA. Copy your updated de.json to /usr/sharace/mythtv/html/assets/i18n , overwriting the de.json that is there. Start mythbackend and run http://<ip address>:6544 , navigate around the page and check the strings. If you make further updates and copy them again, you don't need to restart mythbackend to see them, just click refresh on the web page.

Switching languages

Switching laguages in the web app can be done with the flag icon at the top right hand side of the page. Refresh the page after changing. Some strings will update as soon as you change the language, but others will only update after a refresh of the page.

Submit updated translations

There are two ways that you can make your updated translations available to other MythTV users. If you are comfortable using git and Github you are very welcome to submit a Pull Request, otherwise please send your work as a patch. Details are in the following sections.

Create Pull Request

The MythTV development team welcome Pull Requests (PRs) containing translation updates against the official MythTV repository. There is a dedicated label patch:translation to track them. Please ensure your PR applies cleanly against the branch it was created against, and update if necessary. You can submit your updated translations using a Pull Request at MythTV Pull Requests.

Create a Patch

If you are unable to submit a Pull Request, as an alternative you can send a patch file (a diff) or complete .json files (compressed if possible) directly to Peter Bennett (pb.mythtv TA gmail 0 com), who will endeavour to commit them to the repository whilst preserving your contribution details.

git diff mythtv/html/assets/i18n/de.json > german_web-app_translation.diff

Translate MythWeb

Translation is MythWeb is done differently from MythFrontend or the rest of the plugins.

Checkout the latest development version

Checkout the latest development version by running:

git clone git://github.com/MythTV/mythweb.git

Create or Update translation files

To translate MythWeb, go to of the mythweb/modules/_shared/lang/ directory.

If the translation does not already exist there are two ways you can create it.

Let's say we want to create a new language called Abcd.

Copy an existing translation

You can just copy any existing file (probably English.lang since it will have the least amount of information to delete) and fill it in with the appropriate translations.

cp English.lang Abcd.lang

Create a new file using build_translations.pl

touch Abcd.lang
./build_translations.pl

This will create a translation file with all the necessary source strings.

To create the category file (".cat") it is suggested you copy English.cat like so

cp English.cat Abcd.cat

Update the translation file

To update the translation file with the latest strings, run the following command:

./build_translations.pl

Do the translation

Translate .lang file, e.g. Abcd.lang

You can use any text editor for this.

You must put the translation on the line after the source string (the string enclosed in double quotes (""), indented with spaces or tabs. If your translation spans multiple lines, just make sure that you indent with the same characters as the first line. If you need an example please look at English.lang for examples. Some of the translation strings are shorthand, and are even "translated" in English.lang into more verbose sentences (e.g. info:jumppoints). For these you must check what the "translation" in English.lang is and translation that instead of trying to translate the label name.

Please note that if you leave some strings untranslated they will merely display the source (English) string.

Variables in strings

Some translation strings will contain variables like $1, $2, etc. In the code, certain values will be substituted in for those variables. The variables allow translators to rearrange sentences as they see fit, without having to worry about grammatical differences between languages. Thus, you might see a string like 'You have $1 recordings' translated as 'You have 5 recordings'. Strings with multiple variables can have them rearranged if they would make better sense for your language if they were in a different order.

Translate categories

The .cat file you created earlier contains all the categories MythWeb understand and patterns to recognize them.

The category name enclosed in double quotes ("") must not be modified as MythWeb uses it internally.

The first line after the category name is the name of that category in your language.

The next line after that is the pattern the category name stored in the database must match in order to be considered of that category. These are regular expression and most of them should be relatively easy to understand but if you need any help you can seek help on the translator's mailing list.

Add and test translation

Don't forget to add your language to the $Languages array in mythplugins/mythweb/classes/Translate.php. That way, it will attempt to auto-detect the browser's preferred language, and show up in the mythweb settings language choice menu.

If you need any help to do this please let us know by posting on the translator's mailing list.

Create patch

If creating new files, then you first need to add them to the local repository:

git add modules/_shared/lang/Abcd.lang

You can now create a patch for your translation:

git diff HEAD --no-prefix modules/_shared/lang/Abcd.lang > Abcd_mythweb_translation.diff

These commands assume that you are currently in the directory where MythWeb was checked out (which should be mythweb)

Please note that you can also combine this with the rest of the translation files by simply adding the name of the file, with its path, to the list of the files which should be included in the patch.

Submit the patch

The procedure for submitting the patch is the same as described earlier. Please note that you can (and preferably should) submit it in the same ticket as the rest of the translation files.


Important.png Note: As mentioned earlier if you added a new translation file which did not exist previously please indicate it in the ticket otherwise it might end up not being committed if the committer doesn't notice this.

Checking translation progress

Please use the MythTV Translation Status page to check on the progress of translations. The status pages are regularly updated against the development and current release branches and give details of the translation status of MythFrontend and all plugins for all currently supported languages.

Please note that this doesn't provide any statistics on your MythWeb translation.

Translators mailing list

The official MythTV translators mailing list can be found at Translators Mailing List and archives are available at Gossamer Threads

Translators board on MythTV Forum

The MythTV Official Community Forum has a dedicated Translation & Localisation board where announcements and discussion also takes place.

Locale Configurations

Locale Configurations were added in MythTV 0.24. Translators may be interested in contributing to them although they are not directly tied to translations in any way.

Translatable Third Party Clients

The MythTV Player for Android can be translated as well.