Development Guides Home >> Guide to Locales

Guide to Locales - Distribute a Custom Locale

Introduction

This guide explains how to distribute a custom locale from one server to another. In the following examples, German (de) is the customized locale to distribute.

Not all locales are available by default. You can view the system's locales in the /var/cpanel/locale directory. These files possess the .cdb extension.

Distribute a custom locale

Log in to the source server

SSH in to the source server as the root user.

Run the /usr/local/cpanel/scripts/locale_export script

Run the following command, where de represents the locale that you wish to export:

/usr/local/cpanel/scripts/locale_export --locale=de

This command creates the /var/cpanel/locale/export/de.xlf file.

To view additional options for this script, run the /usr/local/cpanel/scripts/locale_export --help command.

Use the scp command to copy the file to the target server

For example, use the following command to distribute the de.xlf file to the server.example.com server:

scp /var/cpanel/locale/export/de.xlf root@server.example.com:/var/cpanel/locale/export/de.xlf

This command copies the locale file to the /var/cpanel/locale/export/de.xlf file on the server.example.com server.

Note:

To distribute the custom locale to multiple target servers, run the command for each target server. Replace server.example.com with the name of the target server.

Log in to the target server

SSH in to the target server as the root user.

Run the /usr/local/cpanel/scripts/locale_import script to import the locale

Run the following command, where de represents the locale that you wish to import:

/usr/local/cpanel/scripts/locale_import --locale=de

To view additional options for this script, run the /usr/local/cpanel/scripts/locale_import --help command.

Recommended tips and tricks

  • You may wish to set up a cron job to automate this process. For more information, read our Cron Jobs documentation.
  • You can use FTP to distribute the locale file to your servers. For more information, read our FTP Accounts documentation.