Difference between revisions of "Translation"

From MythTV Official Wiki
Jump to: navigation, search
(Update translation files: lupdate command updated.)
(Refactor a bit to avoid having to specify 'i18n' all the time. Add 'make install' step.)
Line 5: Line 5:
 
== Checkout the svn version ==
 
== Checkout the svn version ==
 
<code>svn co http://svn.mythtv.org/svn/trunk/mythtv</code>
 
<code>svn co http://svn.mythtv.org/svn/trunk/mythtv</code>
 +
 +
Go to the <code>mythtv/i18n</code> directory. All remaining steps will be done in this directory.
  
 
== Update translation files ==
 
== Update translation files ==
Go to the mythtv directory and run
+
 
<code>lupdate i18n/translate.pro</code>. This will ensure that all translatable strings in the source code are included in the <code>.ts</code> file we will work on later. <code>.ts</code> files are stored in the i18n directory.
+
Run <code>lupdate translate.pro</code>. This will ensure that all translatable strings in the source code are included in the <code>.ts</code> file we will work on later.
  
 
== Translate ==
 
== Translate ==
  
Translate .ts file in the directory: i18n
+
Translate .ts file, e.g. mythfrontend_de.ts
eg: i18n/mythfrontend_de.ts
+
  
 
You can use any editor for this, but it is most convenient to use the tool Linguist included in Qt (on Debian, this is found in the qt3-linguist package).
 
You can use any editor for this, but it is most convenient to use the tool Linguist included in Qt (on Debian, this is found in the qt3-linguist package).
<code>linguist i18n/mythfrontend_de.ts</code>
+
 
 +
<code>linguist mythfrontend_de.ts</code>
  
 
== Compile translation ==
 
== Compile translation ==
<code>lrelease</code>
 
  
After this you can test your translations in the Frontend. If all is OK you can proceed.
+
<code>lrelease translate.pro
 +
 
 +
make install</code>
 +
 
 +
After restarting the frontend, you can test your translations. If all is OK you can proceed.
  
 
== Create Diff ==
 
== Create Diff ==
<code>svn diff i18n/mythfrontend_de.ts >translation.diff</code>
+
 
 +
<code>svn diff mythfrontend_de.ts > translation.diff</code>
  
 
== Submit the Patch ==
 
== Submit the Patch ==

Revision as of 21:07, 16 November 2007

I use as an example the German translation file. Dont forget to use it also for the plugins.

Note that the text shown in the menu screens are not generally located as described below, but are instead defined in XML files, e.g. mythtv/programs/mythfrontend/mainmenu.xml.

Checkout the svn version

svn co http://svn.mythtv.org/svn/trunk/mythtv

Go to the mythtv/i18n directory. All remaining steps will be done in this directory.

Update translation files

Run lupdate translate.pro. This will ensure that all translatable strings in the source code are included in the .ts file we will work on later.

Translate

Translate .ts file, e.g. mythfrontend_de.ts

You can use any editor for this, but it is most convenient to use the tool Linguist included in Qt (on Debian, this is found in the qt3-linguist package).

linguist mythfrontend_de.ts

Compile translation

lrelease translate.pro

make install

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

Create Diff

svn diff mythfrontend_de.ts > translation.diff

Submit the Patch

Submit the Diff to Oscar, via the URL: http://svn.mythtv.org/trac/newticket

Summary: [PATCH i18n] german translation