Project

General

Profile

Writing translation » History » Revision 14

Revision 13 (Jörg Kiekebusch, 04/12/2012 09:19 PM) → Revision 14/15 (Jörg Kiekebusch, 04/12/2012 10:43 PM)

h1. Translating VirtueMart 2 

 h2. In February 2012 we've opened a VirtueMart 2 translation project using the Transifex translation platform. 

 For information about how to use the system, please read the information provided here: [http://forum.virtuemart.net/index.php?topic=98187.0] 

 Before you think about starting your own translation, check our translation project on at Transifex at: [https://www.transifex.net/projects/p/virtuemart/] 
 Maybe a translation for VirtueMart 2 already is available in your language. 

 From the already existing translations at Transifex, we currently (April 2012) can provide automatically generated language packs at this link: 
 [http://gruz.org.ua/virtuemart-language-files.html] 

 Additional information can be found in the 'sticky' topics at the top of the Language/Translations VM2 section in the forum: 
 [http://forum.virtuemart.net/index.php?board=129.0] 

 h2. Setting up your own translation environment 

 If you prefer to set up your own translation environment, there are a few tools which can be very helpful for the translation process. 

 h3. 1. In the Joomla Extensions Directory (JED) there are a some extensions for creating and editing language files at this location: 

 http://extensions.joomla.org/extensions/languages/language-edition 
 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. 

 h3. 2. Creating language files using an editor 

 You could use for example an editor like Notepad++, which has a lot of useful utilities 
 (http://notepad-plus-plus.org/) 

 The translation is quite simple. We now use the normal language file system of joomla (http://docs.joomla.org/Creating_a_language_definition_file). 

 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. 

 h2. What you have to know and to consider 

 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. 

 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.  

 Lets take the Controller as an example. The default call for storing a message is  
 JText::sprintf('COM_VIRTUEMART_STRING_SAVED',$this->mainLangKey); 

 $this->mainLangKey is JText::_('COM_VIRTUEMART_CONTROLLER_'.strtoupper($this->_cname)); 

 and $this->_cname is the name of the controller 

 So at the end we have something like JText::sprintf('COM_VIRTUEMART_STRING_SAVED','COM_VIRTUEMART_CONTROLLER_PRODUCT'); 

 COM_VIRTUEMART_STRING_SAVED="%s successfully saved" and  
 COM_VIRTUEMART_CONTROLLER_PRODUCT="Product(s)" 

 the %s means that sprintf places the first parameter, translated here "Product(s)" to %s, so we get "Product(s) successfully saved" 

 h2. How to create a language pack 

 please take a look here http://docs.joomla.org/Creating_language_packs_for_extensions_in_Joomla_1.6 


 When you have questions, write to Jörg (http://dev.virtuemart.net/users/49).