From ae4bad986b505ccbb6c95e2415035ea5aef81b48 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Thu, 17 May 2012 12:33:59 -0400
Subject: [PATCH] Get language code from filename if not specified in the .po file itself (#1488478)

---
 bin/importgettext.sh |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/bin/importgettext.sh b/bin/importgettext.sh
index cc01c33..d29a318 100755
--- a/bin/importgettext.sh
+++ b/bin/importgettext.sh
@@ -99,6 +99,10 @@
 	$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 = '';

--
Gitblit v1.9.1