Creating Language Packs A Language Pack is a compressed file loadable through Module Loader. It is the best solution to add a language to SugarCRM. Indeed, it is easier to maintain and to port to other instances of SugarCRM. There are different ways to create a Language Pack: • You can build a Language Pack using one of the tools available on SugarForge like “SugarCRM Translation Module” or “Sugar Translation Suite”. • You can create it using an existing Language Pack: o Download an existing Language Pack. o Note: Be careful to choose a language pack up to date and which is working. o Uncompress it and be careful to keep the folder architecture. o Rename all the files with a name starting with the language prefix (for example “es_es” if you downloaded the Spanish Language Pack) by replacing the old prefix (“es_es”) with the prefix of your new language. Be careful to not modify the manifest.php file and the name of the folders. o Open each file that you have renamed and translate the strings from English. The strings are defined inside of global arrays and the array syntax does need to be maintained for everything to work. A common problem you will quickly see if the array syntax is off is that the user interface doesn't display at all (just a blank page). o Modify the manifest.php file based on the file changes you made. o Compress back everything in a zip file. o You can now load this Language Pack using Module Loader. • You can create from start to end: o Follow the steps of “Add a Language” above. o When you’re finished and it is working on your test instance, you’ll need to package it to be installed. o Module Loader allows you to apply language packs without needing to add the language to the $languages array in config.php. The Module Loader relies on a file named manifest.php, which should reside alongside the root directory of your language pack ZIP file. o Note: An overview of the manifest file is available in the section 4.3.1. The following is an example manifest.php file, for the Portugese (Brazilian) language pack: <?php $manifest = array ( 'acceptable_sugar_versions' => array ( 'exact_matches' => array ( ), 'regex_matches' => array ( 0 => '5\.0\.0[a-z]?' ), ), 'acceptable_sugar_flavors' => array ( 0 => 'CE', 1 => 'PRO', 2 => 'ENT', ), 'name' => 'Portugese (Brazilian) language pack', 'description' => 'Portugese (Brazilian) language pack', 'author' => 'Your name here!', 'published_date' => '2008-07-29 22:50:00', 'version' => '5.0.0', 'type' => 'langpack', 'icon' => '', 'is_uninstallable' => TRUE, 'copy_files' => array ( 'from_dir' => 'pt_br_500', 'to_dir' => '', 'force_copy' => array ( ), ), ); ?> The following is an example of the file structure of the Portugese (Brazilian) language pack: SugarEnt-5.0.0-lang-pt_br-2008-07-29.zip | |___ manifest.php | |___ pt_br_500 | |___ include | |___language | pt_br.lang.php | |___ modules | |___ Accounts | | | |___ language | pt_br.lang.php | |___ Activities | |___ language | pt_br.lang.php | |___ <other module directories> You’ll need to create a root directory that contains the ./include/ and ./modules/ directories of the language pack. The name of this root directory (i.e. pt_br_500) is what should be used in the from_dir element of the copy_files array in manifest.php. You’ll also need to place your manifest.php alongside this root directory. Then you’ll need to copy all the language files that you created in the steps of “Add a Language” into these directories. Be careful to keep the same directory structure (for examples if the file was in modules/Accounts/language copy/paste it in pt_br_500/modules/Accounts/language). Create a ZIP file containing the root directory and the manifest.php file at the top level. Now your language pack is ready to be installed with the Module Loader!
Copyright 2004-2008 SugarCRM Inc. Product License