Created
March 24, 2015 09:21
-
-
Save timmillwood/8e65ea63dece5ce1f33c to your computer and use it in GitHub Desktop.
Importing a po file in hook update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add pt translations | |
*/ | |
function hook_update_7001() { | |
$path = drupal_get_path('module', 'mymodule'); | |
$poFile = $path . '/translations/pt-pt-mymodule-7.x-1.0.po'; | |
$file = new stdClass; | |
$file->uri = $poFile; | |
$file->filename = basename($poFile); | |
_locale_import_po($file, 'pt-pt', LOCALE_IMPORT_OVERWRITE, 'default'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment