Let the platform do the work

Language Packs

Overview

Language packs are module-loadable packages that add support for new, localized languages to Sugar.

Creating a Language Pack

To create a language pack, choose a unique language key. This key is specific to your language definitions and should be unique from other language keys in the same instance to avoid conflicts. It is also important that your language key follows the xx_xx format. For demonstrative purposes, we will create a Lorem Ipsum language pack with the language key Lo_Ip.

Application and Module Strings

In the module and application language definitions, there is a combination of $app_list_strings, $mod_strings, and $mod_process_order_strings variables. Your custom language needs to have a definition created to reflect each language key in a standard definition. To do this, duplicate an existing language and simply change the language values within the document and replace the language key in the name of the file with your new key. Be sure to only change the array values and leave the array keys as they are inside of each file.

Note: Should you miss an index, it will default to English. 

The first step is to identify all of the application and module language files. While language files may vary from version to version due to new features, the stock language paths are generally as follows:

  • ./include/language/xx_xx.lang.php
  • ./include/SugarObjects/implements/assignable/language/xx_xx.lang.php
  • ./include/SugarObjects/implements/email_address/language/xx_xx.lang.php
  • ./include/SugarObjects/implements/team_security/language/xx_xx.lang.php
  • ./include/SugarObjects/templates/basic/language/xx_xx.lang.php
  • ./include/SugarObjects/templates/company/language/xx_xx.lang.php
  • ./include/SugarObjects/templates/company/language/application/xx_xx.lang.php
  • ./include/SugarObjects/templates/file/language/xx_xx.lang.php
  • ./include/SugarObjects/templates/file/language/application/xx_xx.lang.php
  • ./include/SugarObjects/templates/issue/language/xx_xx.lang.php
  • ./include/SugarObjects/templates/issue/language/application/xx_xx.lang.php
  • ./include/SugarObjects/templates/person/language/xx_xx.lang.php
  • ./include/SugarObjects/templates/sale/language/xx_xx.lang.php
  • ./include/SugarObjects/templates/sale/language/application/xx_xx.lang.php
  • ./install/language/xx_xx.lang.php
  • ./modules/Accounts/language/xx_xx.lang.php
  • ./modules/ACL/language/xx_xx.lang.php
  • ./modules/ACLActions/language/xx_xx.lang.php
  • ./modules/ACLFields/language/xx_xx.lang.php
  • ./modules/ACLRoles/language/xx_xx.lang.php
  • ./modules/Activities/language/xx_xx.lang.php
  • ./modules/ActivityStream/Activities/language/xx_xx.lang.php
  • ./modules/Administration/language/xx_xx.lang.php
  • ./modules/Audit/language/xx_xx.lang.php
  • ./modules/Bugs/language/xx_xx.lang.php
  • ./modules/Calendar/language/xx_xx.lang.php
  • ./modules/Calls/language/xx_xx.lang.php
  • ./modules/CampaignLog/language/xx_xx.lang.php
  • ./modules/Campaigns/language/xx_xx.lang.php
  • ./modules/CampaignTrackers/language/xx_xx.lang.php
  • ./modules/Cases/language/xx_xx.lang.php
  • ./modules/Charts/language/xx_xx.lang.php
  • ./modules/Configurator/language/xx_xx.lang.php
  • ./modules/Connectors/language/xx_xx.lang.php
  • ./modules/Contacts/language/xx_xx.lang.php
  • ./modules/Contracts/language/xx_xx.lang.php
  • ./modules/ContractTypes/language/xx_xx.lang.php
  • ./modules/Currencies/language/xx_xx.lang.php
  • ./modules/CustomQueries/language/xx_xx.lang.php
  • ./modules/DataSets/language/xx_xx.lang.php
  • ./modules/DocumentRevisions/language/xx_xx.lang.php
  • ./modules/Documents/language/xx_xx.lang.php
  • ./modules/DynamicFields/language/xx_xx.lang.php
  • ./modules/EAPM/language/xx_xx.lang.php
  • ./modules/EmailAddresses/language/xx_xx.lang.php
  • ./modules/EmailMan/language/xx_xx.lang.php
  • ./modules/EmailMarketing/language/xx_xx.lang.php
  • ./modules/Emails/language/xx_xx.lang.php
  • ./modules/EmailTemplates/language/xx_xx.lang.php
  • ./modules/Employees/language/xx_xx.lang.php
  • ./modules/ExpressionEngine/language/xx_xx.lang.php
  • ./modules/Expressions/language/xx_xx.lang.php
  • ./modules/Feedbacks/language/xx_xx.lang.php
  • ./modules/Filters/language/xx_xx.lang.php
  • ./modules/ForecastManagerWorksheets/language/xx_xx.lang.php
  • ./modules/Forecasts/language/xx_xx.lang.php
  • ./modules/ForecastWorksheets/language/xx_xx.lang.php
  • ./modules/Groups/language/xx_xx.lang.php
  • ./modules/Help/language/xx_xx.lang.php
  • ./modules/History/language/xx_xx.lang.php
  • ./modules/Holidays/language/xx_xx.lang.php
  • ./modules/Home/language/xx_xx.lang.php
  • ./modules/Import/language/xx_xx.lang.php
  • ./modules/InboundEmail/language/xx_xx.lang.php
  • ./modules/KBDocuments/language/xx_xx.lang.php
  • ./modules/KBTags/language/xx_xx.lang.php
  • ./modules/LabelEditor/language/xx_xx.lang.php
  • ./modules/Leads/language/xx_xx.lang.php
  • ./modules/MailMerge/language/xx_xx.lang.php
  • ./modules/Manufacturers/language/xx_xx.lang.php
  • ./modules/Meetings/language/xx_xx.lang.php
  • ./modules/MergeRecords/language/xx_xx.lang.php
  • ./modules/ModuleBuilder/language/xx_xx.lang.php
  • ./modules/Notes/language/xx_xx.lang.php
  • ./modules/Notifications/language/xx_xx.lang.php
  • ./modules/OAuthKeys/language/xx_xx.lang.php
  • ./modules/OAuthTokens/language/xx_xx.lang.php
  • ./modules/Opportunities/language/xx_xx.lang.php
  • ./modules/OptimisticLock/language/xx_xx.lang.php
  • ./modules/PdfManager/language/xx_xx.lang.php
  • ./modules/pmse_Business_Rules/language/xx_xx.lang.php
  • ./modules/pmse_Emails_Templates/language/xx_xx.lang.php
  • ./modules/pmse_Inbox/language/xx_xx.lang.php
  • ./modules/pmse_Project/language/xx_xx.lang.php
  • ./modules/ProductBundleNotes/language/xx_xx.lang.php
  • ./modules/ProductBundles/language/xx_xx.lang.php
  • ./modules/ProductCategories/language/xx_xx.lang.php
  • ./modules/Products/language/xx_xx.lang.php
  • ./modules/ProductTemplates/language/xx_xx.lang.php
  • ./modules/ProductTypes/language/xx_xx.lang.php
  • ./modules/Project/language/xx_xx.lang.php
  • ./modules/ProjectTask/language/xx_xx.lang.php
  • ./modules/ProspectLists/language/xx_xx.lang.php
  • ./modules/Prospects/language/xx_xx.lang.php
  • ./modules/Quotas/language/xx_xx.lang.php
  • ./modules/Quotes/language/xx_xx.lang.php
  • ./modules/Relationships/language/xx_xx.lang.php
  • ./modules/Releases/language/xx_xx.lang.php
  • ./modules/ReportMaker/language/xx_xx.lang.php
  • ./modules/Reports/language/xx_xx.lang.php
  • ./modules/RevenueLineItems/language/xx_xx.lang.php
  • ./modules/Roles/language/xx_xx.lang.php
  • ./modules/SavedSearch/language/xx_xx.lang.php
  • ./modules/Schedulers/language/xx_xx.lang.php
  • ./modules/SchedulersJobs/language/xx_xx.lang.php
  • ./modules/Shippers/language/xx_xx.lang.php
  • ./modules/SNIP/language/xx_xx.lang.php
  • ./modules/Studio/language/xx_xx.lang.php
  • ./modules/Styleguide/language/xx_xx.lang.php
  • ./modules/SugarFavorites/language/xx_xx.lang.php
  • ./modules/Sync/language/xx_xx.lang.php
  • ./modules/Tasks/language/xx_xx.lang.php
  • ./modules/TaxRates/language/xx_xx.lang.php
  • ./modules/TeamNotices/language/xx_xx.lang.php
  • ./modules/Teams/language/xx_xx.lang.php
  • ./modules/TimePeriods/language/xx_xx.lang.php
  • ./modules/Trackers/language/xx_xx.lang.php
  • ./modules/UpgradeWizard/language/xx_xx.lang.php
  • ./modules/Users/language/xx_xx.lang.php
  • ./modules/UserSignatures/language/xx_xx.lang.php
  • ./modules/WebLogicHooks/language/xx_xx.lang.php
  • ./modules/WorkFlow/language/xx_xx.lang.php
  • ./modules/WorkFlowActions/language/xx_xx.lang.php
  • ./modules/WorkFlowActionShells/language/xx_xx.lang.php
  • ./modules/WorkFlowAlerts/language/xx_xx.lang.php
  • ./modules/WorkFlowAlertShells/language/xx_xx.lang.php
  • ./modules/WorkFlowTriggerShells/language/xx_xx.lang.php

Dashlet Strings

Dashlet strings are mostly specific to BWC dashboards. Within each dashlet language definition is a $dashletStrings variable. Create a definition to mimic each dashlet file to reflect the new language. To do this, duplicate an existing language of your choice and change the language key in the path. Be sure to only change the array values and leave the array keys as they are inside of each file.

The dashlet paths are listed below:

  • ./modules/Calendar/Dashlets/CalendarDashlet/CalendarDashlet.xx_xx.lang.php
  • ./modules/Charts/Dashlets/CampaignROIChartDashlet/CampaignROIChartDashlet.xx_xx.lang.php
  • ./modules/Charts/Dashlets/MyModulesUsedChartDashlet/MyModulesUsedChartDashlet.xx_xx.lang.php
  • ./modules/Charts/Dashlets/MyOpportunitiesGaugeDashlet/MyOpportunitiesGaugeDashlet.xx_xx.lang.php
  • ./modules/Charts/Dashlets/MyPipelineBySalesStageDashlet/MyPipelineBySalesStageDashlet.xx_xx.lang.php
  • ./modules/Charts/Dashlets/MyTeamModulesUsedChartDashlet/MyTeamModulesUsedChartDashlet.xx_xx.lang.php
  • ./modules/Charts/Dashlets/OpportunitiesByLeadSourceByOutcomeDashlet/OpportunitiesByLeadSourceByOutcomeDashlet.xx_xx.lang.php
  • ./modules/Charts/Dashlets/OpportunitiesByLeadSourceDashlet/OpportunitiesByLeadSourceDashlet.xx_xx.lang.php
  • ./modules/Charts/Dashlets/OutcomeByMonthDashlet/OutcomeByMonthDashlet.xx_xx.lang.php
  • ./modules/Charts/Dashlets/PipelineBySalesStageDashlet/PipelineBySalesStageDashlet.xx_xx.lang.php
  • ./modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.xx_xx.lang.php
  • ./modules/Home/Dashlets/InvadersDashlet/InvadersDashlet.xx_xx.lang.php
  • ./modules/Home/Dashlets/JotPadDashlet/JotPadDashlet.xx_xx.lang.php
  • ./modules/Home/Dashlets/RSSDashlet/RSSDashlet.xx_xx.lang.php
  • ./modules/SugarFavorites/Dashlets/SugarFavoritesDashlet/SugarFavoritesDashlet.xx_xx.lang.php
  • ./modules/TeamNotices/Dashlets/TeamNoticesDashlet/TeamNoticesDashlet.xx_xx.lang.php
  • ./modules/Trackers/Dashlets/TrackerDashlet/TrackerDashlet.xx_xx.lang.php

Templates

Sugar also contains templates that are used when emailing users. Duplicate an existing language template and change the language text as needed. This time, you will need to leave the language keys exactly as they are in the file.

The template paths are listed below:

  • ./include/language/xx_xx.notify_template.html

Configuration

Once you have your language definitions ready, you will need to tell Sugar a new language should be listed for users. For development purposes, you can add $sugar_config['languages']['Lo_Ip'] = 'Lorem Ipsum'; to your config_override.php. It is important to note that this language configuration will automatically be set for you during the installation of a module loadable language package. 

Module Loadable Packages

Once you have the new language files ready, create an installer package so the files can be installed to a new instance. To do this, create an empty directory and move the files into it, mimicking the folder structures shown above. Once that is completed, create a manifest.php in the root of the new directory with a $manifest['type'] of "langpack". An example manifest file is shown below this section. For more information on building manifests, please visit the introduction to the manifest page.

Note: Sugar Sell Essentials customers do not have the ability to upload custom file packages to Sugar using Module Loader.

Example Manifest File

  <?php

$manifest = array (
  'acceptable_sugar_versions' => 
  array (
    'regex_matches' => 
    array (
      '13.0.*',
    ),
  ),
  'acceptable_sugar_flavors' => 
  array (
    'PRO',
    'ENT',
    'ULT',
  ),
  'readme' => '',
  'key' => 1454474352,
  'author' => 'SugarCRM',
  'description' => 'Installs an example Lorem Ipsum language pack',
  'icon' => '',
  'is_uninstallable' => true,
  'name' => 'Lorem Ipsum Language Pack',
  'published_date' => '2018-02-03 00:00:00',
  'type' => 'langpack',
  'version' => 1454474352,
  'remove_tables' => '',
);

?>

Once your manifest is completed, you will need to zip up the contents of your new folder. An example of a language pack installer can be downloaded here. When your language pack is ready, it can be installed through the module loader. The installation will automatically add your new language to the $sugar_config['languages'] array in your config.php. After installation. it is highly recommended to navigate to the Sugar Administration page, click on "Repairs", and execute the following repair tools:

  • Quick Repair and Rebuild
  • Rebuild Javascript Languages

The new language should now be available for use in your Sugar instance. If you do not see the language listed, please clear your browser cache and refresh the page.