Language ExportΒΆ

vtlib provides API to export language pack as a zip (package) file which can used for importing through Module Manger.

require_once('vtlib/Vtiger/Module.php');
require_once('vtlib/Vtiger/Language.php');
$language = new Vtiger_Language();
$language->export('<LanguagePrefix>', '<DESTINATION DIR>', '<ZIPFILE NAME>', <DIRECT DOWNLOAD>);

<LanguageCode_CountryCode>

LanguagePrefix (LanguageCode_CountryCode) of Language to be exported (packaged)

<DESTINATION DIR>

(Optional: Default=test/vtlib) Directory where the zipfile output should be created.

<ZIPFILE NAME>

(Optional: Default=modulename-timestamp.zip) Zipfile name to use for the output file.

<DIRECT DOWNLOAD>

(Optional: Default=false) If true, the zipfile created will be streamed for download and zipfile will be deleted after that.

Example

require_once('vtlib/Vtiger/Module.php');
require_once('vtlib/Vtiger/Language.php');
$language = new Vtiger_Language();
$language->export(
      'en_us',
      'test/vtlib',
      'en_us-Export.zip',
      true
);

Note

Please make sure test/vtlib directory exists under vtigercrm root directory and is writeable.