This manual is deprecated. Please visit https://groupoffice.readthedocs.io for the latest documentation.

Difference between revisions of "Translate Group-Office"

From Group-Office Groupware and CRM Documentation
Jump to: navigation, search
(Contributing your translation)
(Files location)
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
You can translate Group-Office by copying all en.inc.php files to nl.inc.php and en.js files to nl.js. In case you are translating to the Dutch (nl) language. Look up your ISO language code here:
+
Example: You can translate Group-Office by copying all en.php files to de.php. In this case you are translating to the German (de) language. Look up your ISO language code here:
  
http://people.w3.org/rishida/utils/subtags/index.php?searchtype=4&searchtext=notext&submit=Display
+
http://www.loc.gov/standards/iso639-2/php/code_list.php
  
 
The core language files are located in:
 
The core language files are located in:
  
 
<pre>
 
<pre>
language/*/en.inc.php
+
language/*/en.php
language/*/en.js
+
 
</pre>
 
</pre>
  
Line 13: Line 12:
  
 
<pre>
 
<pre>
modules/*/language/en.inc.php
+
modules/*/language/en.php
modules/*/language/en.js
+
 
</pre>
 
</pre>
  
You must remove these lines from the *.js files:
+
<b>Important!</b> Make sure you save your files in <b>UTF-8</b> encoding! Otherwise Group-Office will display garbage when you use non-ascii characters.
  
<pre>
+
You must add your language to language/languages.inc.php to enable it in Group-Office.
Ext.namespace('GO.<module>');
+
GO.<module>.lang={};
+
</pre>
+
  
In the *.inc.php files you must uncomment this lines:
+
<b>Important!</b> If the language is not loaded after you've reloaded the browser, then run "http://my.groupoffice.net/?r=maintenance/upgrade" once to clear the servercache.
<pre>
+
require_once($GO_LANGUAGE->get_fallback_language_file('<module>'));
+
</pre>
+
  
If you don't do this the language won't fall back on English if a string doesn't exist.
+
==Contributing your translation==
 +
It would be great if you would let other people of the Group-Office community benefit from your translation. If you send it to info@intermesh.nl, your language will be put into the main distribution.
  
<b>Important!</b>Make sure you save your files in <b>UTF-8</b> encoding! Otherwise Group-Office will display garbage when you use non-ascii characters.
+
===Check differences between languages===
 +
We created a script that checks differences between two languages. This way it's easy to add missing strings when a new version of Group-Office appears. When you're logged in as admin, you can run it from the browser:
  
You must add your language to language/languages.inc.php and language/Languages.js to enable it in Group-Office.
+
http://my.groupoffice.net/?r=maintenance/checkLanguage&lang1=en&lang2=de
  
==Contributing your translation==
+
The above URL will show a comparison between English (lang1) and German (lang2).
It would be great if you would let other people of the Group-Office community benefit from your translation. If you send it to mailto:info@intermesh.nl, your language will be put into the main distribution.
+
  
==Check differences between languages==
+
===Extract language files from Group-Office===
We created a script that checks differences between English and your language. This way it's easy to add missing strings when a new version of Group-Office appears. You can get it here:
+
  
http://group-office.svn.sourceforge.net/viewvc/group-office/trunk/scripts/check_lang.php
+
You can extract all the language files from Group-Office by logging in as admin and running the following URL in the browser:
  
Put it in the root of your Group-Office folder and open it in the browser:
+
http://my.groupoffice.net/?r=maintenance/zipLanguage&lang=en
  
http://your.host/groupoffice/check_lang.php?lang1=en&lang2=nl
+
This URL will save all English language files in a zip file called "en.zip" which you can download. It can be easily unpacked to the Group-Office root.
  
This will compare english with dutch.
+
==Holidays==
  
==Extract language files from Group-Office==
+
===Files location===
 +
Holidays are defined in separate files.
  
If you are on Linux you can extract all the language files from Group-Office with this script:
+
These files are located in:  
 +
<pre>
 +
language/holidays/*.php
 +
</pre>
  
http://group-office.svn.sourceforge.net/viewvc/group-office/trunk/scripts/getlang.sh?view=log
+
===Add custom holidays===
 +
When you want to change the holidays inside you GO installation then you can add your own custom holiday file here.
  
Put it anywhere and use it like this:
+
The easiest way to do that is by copying an existing holiday file and give it a logical name.
  
<pre>
+
Then add your "custom" holiday changes to that new holiday file and save it.
./getlang.sh /path/to/groupoffice en
+
</pre>
+
  
This will save all english language files in a folder "en" at the current working directory.
+
After that, login to your GO installation and go to "Settings->Regional Settings->Bank holidays" and choose your "new" file.

Latest revision as of 09:49, 25 February 2016

Example: You can translate Group-Office by copying all en.php files to de.php. In this case you are translating to the German (de) language. Look up your ISO language code here:

http://www.loc.gov/standards/iso639-2/php/code_list.php

The core language files are located in:

language/*/en.php

and for the modules:

modules/*/language/en.php

Important! Make sure you save your files in UTF-8 encoding! Otherwise Group-Office will display garbage when you use non-ascii characters.

You must add your language to language/languages.inc.php to enable it in Group-Office.

Important! If the language is not loaded after you've reloaded the browser, then run "http://my.groupoffice.net/?r=maintenance/upgrade" once to clear the servercache.

Contributing your translation

It would be great if you would let other people of the Group-Office community benefit from your translation. If you send it to info@intermesh.nl, your language will be put into the main distribution.

Check differences between languages

We created a script that checks differences between two languages. This way it's easy to add missing strings when a new version of Group-Office appears. When you're logged in as admin, you can run it from the browser:

http://my.groupoffice.net/?r=maintenance/checkLanguage&lang1=en&lang2=de

The above URL will show a comparison between English (lang1) and German (lang2).

Extract language files from Group-Office

You can extract all the language files from Group-Office by logging in as admin and running the following URL in the browser:

http://my.groupoffice.net/?r=maintenance/zipLanguage&lang=en

This URL will save all English language files in a zip file called "en.zip" which you can download. It can be easily unpacked to the Group-Office root.

Holidays

Files location

Holidays are defined in separate files.

These files are located in:

language/holidays/*.php

Add custom holidays

When you want to change the holidays inside you GO installation then you can add your own custom holiday file here.

The easiest way to do that is by copying an existing holiday file and give it a logical name.

Then add your "custom" holiday changes to that new holiday file and save it.

After that, login to your GO installation and go to "Settings->Regional Settings->Bank holidays" and choose your "new" file.