Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/twine.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/twine/formatters/gettext.rb')
-rw-r--r--lib/twine/formatters/gettext.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/twine/formatters/gettext.rb b/lib/twine/formatters/gettext.rb
index d63e944..c0dc1ac 100644
--- a/lib/twine/formatters/gettext.rb
+++ b/lib/twine/formatters/gettext.rb
@@ -18,10 +18,8 @@ module Twine
def determine_language_given_path(path)
path_arr = path.split(File::SEPARATOR)
path_arr.each do |segment|
- match = /(..)\.po$/.match(segment)
- if match
- return match[1]
- end
+ match = /([a-z]{2}(-[A-Za-z]{2})?)\.po$/.match(segment)
+ return match[1] if match
end
return