Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Pass plugin parameter to update_i18n function.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Sep 10, 2016
1 parent bb597b0 commit 8ea5725
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/RichClient.php
Expand Up @@ -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);
Expand Down

0 comments on commit 8ea5725

Please sign in to comment.