Project

General

Profile

Writing translation » History » Version 15

Jörg Kiekebusch, 04/16/2012 08:16 AM

1 13 Jörg Kiekebusch
h1. Translating VirtueMart 2
2 1 Max Milbers
3 13 Jörg Kiekebusch
h2. In February 2012 we've opened a VirtueMart 2 translation project using the Transifex translation platform.
4 1 Max Milbers
5 13 Jörg Kiekebusch
For information about how to use the system, please read the information provided here: [http://forum.virtuemart.net/index.php?topic=98187.0]
6 1 Max Milbers
7 14 Jörg Kiekebusch
Before you think about starting your own translation, check our translation project on Transifex at: [https://www.transifex.net/projects/p/virtuemart/]
8 13 Jörg Kiekebusch
Maybe a translation for VirtueMart 2 already is available in your language.
9 1 Max Milbers
10 13 Jörg Kiekebusch
From the already existing translations at Transifex, we currently (April 2012) can provide automatically generated language packs at this link:
11
[http://gruz.org.ua/virtuemart-language-files.html]
12 1 Max Milbers
13 13 Jörg Kiekebusch
Additional information can be found in the 'sticky' topics at the top of the Language/Translations VM2 section in the forum:
14
[http://forum.virtuemart.net/index.php?board=129.0]
15 6 Valérie Isaksen
16 13 Jörg Kiekebusch
h2. Setting up your own translation environment
17 2 Jörg Kiekebusch
18 13 Jörg Kiekebusch
If you prefer to set up your own translation environment, there are a few tools which can be very helpful for the translation process.
19 1 Max Milbers
20 13 Jörg Kiekebusch
h3. 1. In the Joomla Extensions Directory (JED) there are a some extensions for creating and editing language files at this location:
21
22
http://extensions.joomla.org/extensions/languages/language-edition
23
However, at the time of writing this, most of these have not yet been updated to work with the free Bing translation api instead of working with the Google translation api, which has become commercial _(you have to pay for the service)_ earlier this year.
24
25
h3. 2. Creating language files using an editor
26
27
You could use for example an editor like Notepad++, which has a lot of useful utilities
28 10 Jörg Kiekebusch
(http://notepad-plus-plus.org/)
29 3 Max Milbers
30 13 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).
31 11 Jörg Kiekebusch
32 13 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. The VirtueMart frontend language files are located in .../language/en-GB. You can open and translate these files with an Editor, configured to store the file encoded as *UTF-8 without BOM!* Rename the file(s) with the language prefix of your language, like de-DE or nl-NL and so on.
33
34
h2. What you have to know and to consider
35
36 4 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.
37 3 Max Milbers
38
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. 
39
40 1 Max Milbers
Lets take the Controller as an example. The default call for storing a message is 
41
JText::sprintf('COM_VIRTUEMART_STRING_SAVED',$this->mainLangKey);
42
43 3 Max Milbers
$this->mainLangKey is JText::_('COM_VIRTUEMART_CONTROLLER_'.strtoupper($this->_cname));
44
45
and $this->_cname is the name of the controller
46
47
So at the end we have something like JText::sprintf('COM_VIRTUEMART_STRING_SAVED','COM_VIRTUEMART_CONTROLLER_PRODUCT');
48
49
COM_VIRTUEMART_STRING_SAVED="%s successfully saved" and 
50
COM_VIRTUEMART_CONTROLLER_PRODUCT="Product(s)"
51
52
the %s means that sprintf places the first parameter, translated here "Product(s)" to %s, so we get "Product(s) successfully saved"
53
54 13 Jörg Kiekebusch
h2. How to create a language pack
55 9 Max Milbers
56 15 Jörg Kiekebusch
please take a look here http://docs.joomla.org/Creating_language_packs_for_extensions_in_Joomla_2.5
57 9 Max Milbers
58 13 Jörg Kiekebusch
When you have questions, write to Jörg (http://dev.virtuemart.net/users/49).