diff options
author | Sebastian Celis <sebastian@sebastiancelis.com> | 2017-08-04 16:10:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-04 16:10:46 +0300 |
commit | 7f2d75a1ca4bfac803abdc53032eb9ae83c510cc (patch) | |
tree | c38c4ded5eb557e8da70ffc145fe611d01eab55a | |
parent | cd28717f92ce20106bc822f5c9e11a83657dcb23 (diff) | |
parent | e1984e06c0532eba25a5d31ebf82b77558a3cb21 (diff) |
Merge pull request #202 from jporsay/master
Android output folders should have an "r" preceding the region code
-rw-r--r-- | lib/twine/formatters/android.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/twine/formatters/android.rb b/lib/twine/formatters/android.rb index 0108de8..b9dba3e 100644 --- a/lib/twine/formatters/android.rb +++ b/lib/twine/formatters/android.rb @@ -32,7 +32,7 @@ module Twine # The language is defined by a two-letter ISO 639-1 language code, optionally followed by a two letter ISO 3166-1-alpha-2 region code (preceded by lowercase "r"). # see http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources match = /^values-([a-z]{2}(-r[a-z]{2})?)$/i.match(segment) - + return match[1].sub('-r', '-') if match end end @@ -41,7 +41,7 @@ module Twine end def output_path_for_language(lang) - "values-#{lang}" + "values-#{lang}".gsub(/-(\p{Lu})/, '-r\1') end def set_translation_for_key(key, lang, value) |