Project

General

Profile

Writing translation » History » Revision 11

Revision 10 (Jörg Kiekebusch, 12/29/2011 06:47 PM) → Revision 11/15 (Jörg Kiekebusch, 12/29/2011 06:58 PM)

h1. Writing translation 

 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. 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. 

 Rename the file(s) to the shortcut of your language, like de-DE or nl-NL and so on. 

 Helpful tools for translating language files are: 

 com_missingt_VMversion_0.4.1.v2.zip, which can be downloaded frome here: 
 (http://dev.virtuemart.net/issues/294) 
 The missing_t is compatible Joomla 1.5.x, Joomla 1.6.x and Joomla 1.7.x 

 With this one you can translate directly from the frontend (Joomla 1.5.x and 1.6.x only): 
 (http://www.allforjoomla.com/xplugins/plg-translatehelper) 

 A new translation manager named "Localise" is compatible with Joomla 1.7.x and Joomla 2.5.x 
 (http://extensions.joomla.org/extensions/languages/language-edition/17755) 

 For finetuning your translated language files, an editor like Notepad++ has a lot of useful tools 
 (http://notepad-plus-plus.org/) 

 h1. What you have to know and to consider 

 Be aware that we use for the standard views in the backend a generic system to generate the titles and messages. So you won't find this translation keys by searching for them and missing_t wont help you. 

 But the system is quite easy, when you know how it works. The system is build 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" 


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

 h1. How to create a language pack 

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