Project

General

Profile

Writing translation » History » Version 12

Jörg Kiekebusch, 12/30/2011 10:07 AM

1 1 Max Milbers
h1. Writing translation
2
3 2 Jörg Kiekebusch
The translation is quite simple. We now use the normal language file system of joomla (http://docs.joomla.org/Creating_a_language_definition_file).
4 1 Max Milbers
5 2 Jörg Kiekebusch
Just look in the backend and frontend language folders of joomla. The main backend VirtueMart language file "en-GB.com_virtuemart.ini" is located in ...administrator/language/en-GB. Open and translate this file with an Editor (i.e. Notepad++) configured to store the file encoded as UTF-8 without BOM! The VirtueMart frontend language files are located in .../language/en-GB.
6 1 Max Milbers
7 2 Jörg Kiekebusch
Rename the file(s) to the shortcut of your language, like de-DE or nl-NL and so on.
8
9
Helpful tools for translating language files are:
10
11 6 Valérie Isaksen
com_missingt_VMversion_0.4.1.v2.zip, which can be downloaded frome here:
12 2 Jörg Kiekebusch
(http://dev.virtuemart.net/issues/294)
13 10 Jörg Kiekebusch
The missing_t is compatible Joomla 1.5.x, Joomla 1.6.x and Joomla 1.7.x
14 2 Jörg Kiekebusch
15 10 Jörg Kiekebusch
With this one you can translate directly from the frontend (Joomla 1.5.x and 1.6.x only):
16 1 Max Milbers
(http://www.allforjoomla.com/xplugins/plg-translatehelper)
17
18 10 Jörg Kiekebusch
A new translation manager named "Localise" is compatible with Joomla 1.7.x and Joomla 2.5.x
19
(http://extensions.joomla.org/extensions/languages/language-edition/17755)
20 3 Max Milbers
21 11 Jörg Kiekebusch
For finetuning your translated language files, an editor like Notepad++ has a lot of useful tools
22
(http://notepad-plus-plus.org/)
23
24 3 Max Milbers
h1. What you have to know and to consider
25
26 12 Jörg Kiekebusch
Be aware that we use a generic system to generate the titles and messages for the standard views in the backend. So you won't find these translation keys by searching for them and missing_t won't help you.
27 3 Max Milbers
28 12 Jörg Kiekebusch
But the system is quite easy, when you know how it works. The system is built for the controllers, models, tables, and the title of a view. 
29 3 Max Milbers
30 4 Jörg Kiekebusch
Lets take the Controller as an example. The default call for storing a message is 
31 3 Max Milbers
JText::sprintf('COM_VIRTUEMART_STRING_SAVED',$this->mainLangKey);
32
33
$this->mainLangKey is JText::_('COM_VIRTUEMART_CONTROLLER_'.strtoupper($this->_cname));
34
35
and $this->_cname is the name of the controller
36
37
So at the end we have something like JText::sprintf('COM_VIRTUEMART_STRING_SAVED','COM_VIRTUEMART_CONTROLLER_PRODUCT');
38
39
COM_VIRTUEMART_STRING_SAVED="%s successfully saved" and 
40
COM_VIRTUEMART_CONTROLLER_PRODUCT="Product(s)"
41
42
the %s means that sprintf places the first parameter, translated here "Product(s)" to %s, so we get "Product(s) successfully saved"
43
44
45 8 Valérie Isaksen
When you have questions, write to Jörg (http://dev.virtuemart.net/users/49).
46 9 Max Milbers
47
h1. How to create a language pack
48
49
please take a look here http://docs.joomla.org/Creating_language_packs_for_extensions_in_Joomla_1.6