Permalink
Browse files

Pass plugin parameter to update_i18n function.

  • Loading branch information...
1 parent bb597b0 commit 8ea57256651a265627102d556ade70f04aa6c076 @cdujeu cdujeu committed Sep 10, 2016
@@ -83,15 +83,20 @@ public static function extractConfStringsFromManifests()
* Browse the i18n libraries and update the languages with the strings missing
* @static
* @param string $createLanguage
+ * @param string $pluginId
* @return void
*/
- public static function updateAllI18nLibraries($createLanguage = "")
+ public static function updateAllI18nLibraries($createLanguage = "", $pluginId = "")
{
// UPDATE EN => OTHER LANGUAGES
$nodes = PluginsService::getInstance(Context::emptyContext())->searchAllManifests("//i18n", "nodes");
/** @var \DOMElement $node */
foreach ($nodes as $node) {
$nameSpace = $node->getAttribute("namespace");
+ if(!empty($pluginId)){
+ $plug = $node->parentNode->parentNode->parentNode->getAttribute("id");
+ if($plug !== $pluginId) continue;
+ }
$path = AJXP_INSTALL_PATH . "/" . $node->getAttribute("path");
if ($nameSpace == "") {
self::updateI18nFiles($path, false, $createLanguage);
@@ -123,7 +123,7 @@ public static function parseApplicationGetParameters(ContextInterface $ctx, $par
if (isSet($parameters["extract"])) {
LocaleExtractor::extractConfStringsFromManifests();
}
- LocaleExtractor::updateAllI18nLibraries((isSet($parameters["create"]) ? $parameters["create"] : ""));
+ LocaleExtractor::updateAllI18nLibraries((isSet($parameters["create"]) ? $parameters["create"] : ""), (isSet($parameters["plugin"]) ? $parameters["plugin"] : ""));
}
if (ConfService::getConf("JS_DEBUG") && isSet($parameters["clear_plugins_cache"])) {
@unlink(AJXP_PLUGINS_CACHE_FILE);

0 comments on commit 8ea5725

Please sign in to comment.