Table of Contents Previous Next

Sugar Developer Guide

Version 5.1


Chapter 4 Customizing Sugar : Adding Multiple Languages : Creating Language Packs

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:
o
o
o
o
o
o
o
o
o
o
o
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!
 

Table of Contents Previous Next

Copyright 2004-2008 SugarCRM Inc.
Product License