-
-
Save kmoll/ac2018c11727e3a69880 to your computer and use it in GitHub Desktop.
This file contains 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 | |
/** | |
* Import translations | |
*/ | |
function hook_update_7001() { | |
my_module_import_po_file('pt-pt'); | |
} | |
function my_module_import_po_file($language) { | |
$path = drupal_get_path('module', 'mymodule'); | |
$poFile = $path . '/translations/' . $language . '-mymodule-7.x-1.0.po'; | |
$file = new stdClass; | |
$file->uri = $poFile; | |
$file->filename = basename($poFile); | |
_locale_import_po($file, $language, LOCALE_IMPORT_OVERWRITE, 'default'); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment