summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2012-05-17 18:33:59 +0200
committerThomas Bruederli <thomas@roundcube.net>2012-05-17 19:05:24 +0200
commit35a35d13702441a467e93d0f96e6f5240eeff5e6 (patch)
tree617c15925eaf3e9e4287dec71f2836d8bc53a2af /bin
parent8526ac991e8560b1cbf2c4b1a644a0f8e8228e76 (diff)
Get language code from filename if not specified in the .po file itself (#1488478)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/importgettext.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/importgettext.sh b/bin/importgettext.sh
index cc01c3382..d29a318bd 100755
--- a/bin/importgettext.sh
+++ b/bin/importgettext.sh
@@ -99,6 +99,10 @@ function import_file($fn)
$language = '';
$translator = '';
+ // get language code from file name
+ if (preg_match('/-([a-z_]+).po$/i', $fn, $m))
+ $language = expand_langcode($m[1]);
+
$is_header = true;
$msgid = null;
$msgstr = '';