From 9a2c1a79f339abc95c61f83ba8d1c42dcc96be34 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Sun, 12 Jun 2016 21:06:26 -0500 Subject: [PATCH] i18n: Fix build language packs for the 1.10.x branch Crowdin requires a `branch` argument when requesting the language pack download from their system. --- include/cli/modules/i18n.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/include/cli/modules/i18n.php b/include/cli/modules/i18n.php index 2adb14a90..bf2872c54 100644 --- a/include/cli/modules/i18n.php +++ b/include/cli/modules/i18n.php @@ -79,10 +79,9 @@ class i18n_Compiler extends Module { self::$crowdin_api_url); $args += array('key' => $this->key); - foreach ($args as &$a) - $a = urlencode($a); - unset($a); - $url .= '?' . Format::array_implode('=', '&', $args); + if ($branch = $this->getOption('branch', false)) + $args += array('branch' => $branch); + $url .= '?' . Http::build_query($args); return $this->_http_get($url); } @@ -189,7 +188,7 @@ class i18n_Compiler extends Module { $contents = $zip->getFromIndex($i); if (!$contents) continue; - if (fnmatch('*/messages*.po', $info['name']) !== false) { + if (strpos($info['name'], '/messages.po') !== false) { $po_file = $contents; // Don't add the PO file as-is to the PHAR file continue; @@ -673,7 +672,7 @@ class i18n_Compiler extends Module { $this->stdout->write(sprintf( "'%s' (%s) and '%s' (%s)\n", $orig, $usage, $other_orig, $other_usage - )); + )); } } } -- GitLab