How to translate My Money

From MTHWiki

(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by Ogixidoni (Talk); changed back to last version by Wikiadmin)
Line 1: Line 1:
-
=[http://ecacoraqosy.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
 
==Translating My Money into other languages==
==Translating My Money into other languages==
Line 43: Line 42:
For example, this is a fragment from the default US English file:
For example, this is a fragment from the default US English file:
-
<code><pre>
+
<code><pre>
# Buttons
# Buttons
#
#
button.ok=Ok
button.ok=Ok
button.cancel=Cancel
button.cancel=Cancel
-
button.previous=&lt;&lt; Previous
+
button.previous=<< Previous
-
button.next=Next &gt;&gt;
+
button.next=Next >>
-
&lt;/pre&gt;&lt;/code&gt;
+
</pre></code>
To translate this to French simply change the translated text, for example:
To translate this to French simply change the translated text, for example:
-
&lt;code&gt;&lt;pre&gt;
+
<code><pre>
# Buttons
# Buttons
#
#
button.ok=Ok
button.ok=Ok
button.cancel=Annuler
button.cancel=Annuler
-
button.previous=&lt;&lt; Précedent
+
button.previous=<< Précedent
-
button.next=Suivant &gt;&gt;
+
button.next=Suivant >>
-
&lt;/pre&gt;&lt;/code&gt;
+
</pre></code>
Please ignore lines starting with #, those are comments.
Please ignore lines starting with #, those are comments.
Line 76: Line 75:
The file look like the following:
The file look like the following:
-
&lt;code&gt;&lt;pre&gt;
+
<code><pre>
-1,905,Expense Categories,,
-1,905,Expense Categories,,
-1,2,,Alimony,
-1,2,,Alimony,
Line 86: Line 85:
900,901,, ,Interest Paid
900,901,, ,Interest Paid
900,9,, ,Service Charge
900,9,, ,Service Charge
-
&lt;/pre&gt;&lt;/code&gt;
+
</pre></code>
When translating the file please don't change the keys, such as -1, 905, etc. Simply translate the text.
When translating the file please don't change the keys, such as -1, 905, etc. Simply translate the text.
Line 109: Line 108:
Please open the system console and type:
Please open the system console and type:
-
&lt;code&gt;&lt;pre&gt;
+
<code><pre>
I18n.diffLanguagePacks( ResourceBundle.getBundle( Constants.DEFAULT_I18N_FILE, I18n.getDefaultLocale()),
I18n.diffLanguagePacks( ResourceBundle.getBundle( Constants.DEFAULT_I18N_FILE, I18n.getDefaultLocale()),
-
ResourceBundle.getBundle( Constants.DEFAULT_I18N_FILE,new Locale( &quot;es&quot; ) ),new OutputStreamWriter( console.getOut()) );
+
ResourceBundle.getBundle( Constants.DEFAULT_I18N_FILE,new Locale( "es" ) ),new OutputStreamWriter( console.getOut()) );
-
&lt;/pre&gt;&lt;/code&gt;
+
</pre></code>
All on one line, as illustrated below:
All on one line, as illustrated below:
Line 129: Line 128:
In this example there are 18 keys left that are still needed to be translated.
In this example there are 18 keys left that are still needed to be translated.
-
To compare English against other language please change '''Locale''' in the diff command, for example to check against French you can use '''Locale(&quot;fr&quot;)'''
+
To compare English against other language please change '''Locale''' in the diff command, for example to check against French you can use '''Locale("fr")'''

Revision as of 13:38, 24 November 2010

Contents

Translating My Money into other languages

Translating My Money into a new language is actually quite easy

All of language resources are kept in just 2 files

  1. install-dir\config\mymoney_localized_en_US.properties and
  2. install-dir\config\mymoney_localized_categories_en_US.csv

So for for example, on Windows these files would be found in

  1. C:\Program Files\MTH\My Money\config\

On a Mac these files are inside of the MyMoney.app application bundle and on Linux they are in /usr/share/MyMoney-2.0/config

The File Naming Convention

We follow ISO 639 for Language Codes and ISO 3166 for Country Codes.

The file name is a combination of mymoney_language_Country, so a UK English files will be named mymoney_en_UK and French will be mymoney_fr_FR


Translating/Correcting an Existing Language

Please use Money Translation Utility (Help-Translation Utility Menu) to translate an existing language pack.

Simply select the language to be translated and click Edit

Image:Translationutility.png

Locate missing text (highlighted in red), double click on its definition, type in the translation. When done please hit Submit button which will send the translated file to MTH Software.


Adding a new language to My Money

Open install-dir\config\mymoney_localized_en_US.properties' into any text editor that supports your language.

This .properties file is just a text file that has name=value pairs,

For example, this is a fragment from the default US English file:

# Buttons
#
button.ok=Ok
button.cancel=Cancel
button.previous=<< Previous
button.next=Next >>

To translate this to French simply change the translated text, for example:

# Buttons
#
button.ok=Ok
button.cancel=Annuler
button.previous=<< Précedent
button.next=Suivant >>

Please ignore lines starting with #, those are comments.

Once done simply save the file with the new name, for example mymoney_localized_fr_FR.properties

If you would like to quickly test your file then please switch My Money into French locale through Properties/Languages, save changes and restart the application, your file should be picked up as a default language file now.

Translating Money Default Categories

Similar to the properties file mymoney_localized_categories_en_US.csv is simply a text file. You can open it up in any text editor or Excel.

The file look like the following:

-1,905,Expense Categories,,
-1,2,,Alimony,
-1,3,,Automobile,
3,4,,  ,Car Payment
3,5,,  ,Gasoline
-1,6,,  ,Maintenance
-1,900,,Bank Charges,
900,901,,  ,Interest Paid
900,9,,  ,Service Charge

When translating the file please don't change the keys, such as -1, 905, etc. Simply translate the text. If you are editing with Excel please make sure that the file is saved back with as CSV, not Excel binary format.

To get the newly translated Categories into database you will need to change the locale and then create a new database. Currently there is no way to update Categories inside of a existing database, except going and changing them manually one by one through Edit Category

If you are done and would like us to include your version in the next build please email us your files for review. Please mention the platform you're working on and the language you have translated the file to.

We will double check your translation and will include it in the next build of My Money.


Advanced -- Translation diff: Quickly comparing translated files to each other

To see how the newly translated file compares to English you can run a diff function from the system console

Please open the system console and type:

I18n.diffLanguagePacks( ResourceBundle.getBundle( Constants.DEFAULT_I18N_FILE, I18n.getDefaultLocale()),
ResourceBundle.getBundle( Constants.DEFAULT_I18N_FILE,new Locale( "es" ) ),new OutputStreamWriter( console.getOut()) );

All on one line, as illustrated below:

Image:Diff.PNG


In this example we are finding the difference between default translation (English) and Spanish

Press enter and the diff command will run a quick analysis of what is missing in the Spanish translation


Image:Diff1.PNG


In this example there are 18 keys left that are still needed to be translated.

To compare English against other language please change Locale in the diff command, for example to check against French you can use Locale("fr")

Personal tools