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
path: root/lib/twine
diff options
context:
space:
mode:
authorSebastian Celis <sebastian@sebastiancelis.com>2016-12-15 02:12:37 +0300
committerGitHub <noreply@github.com>2016-12-15 02:12:37 +0300
commit9fc741c26122d90f99c42c8241e6de2ba265a102 (patch)
tree974441cc038ecb281694255d79afc6728aa0a5e2 /lib/twine
parent74d7cb1d85ed1d2b06ce567ab93dd74a0805c7d7 (diff)
parente2c400ea6ddb667b0ef2024b03ecd6137a910817 (diff)
Merge pull request #180 from sebastianludwig/fix-179-android-string-placeholder
Fixed #179 by converting placeholders before escaping @ signs.
Diffstat (limited to 'lib/twine')
-rw-r--r--lib/twine/formatters/android.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/twine/formatters/android.rb b/lib/twine/formatters/android.rb
index 3575505..7996304 100644
--- a/lib/twine/formatters/android.rb
+++ b/lib/twine/formatters/android.rb
@@ -116,6 +116,9 @@ module Twine
def format_value(value)
value = value.dup
+ # convert placeholders (e.g. %@ -> %s)
+ value = convert_placeholders_from_twine_to_android(value)
+
# capture xliff tags and replace them with a placeholder
xliff_tags = []
value.gsub! /<xliff:g.+?<\/xliff:g>/ do
@@ -133,9 +136,6 @@ module Twine
value.sub! 'TWINE_XLIFF_TAG_PLACEHOLDER', xliff_tag
end
- # convert placeholders (e.g. %@ -> %s)
- value = convert_placeholders_from_twine_to_android(value)
-
# replace beginning and end spaces with \u0020. Otherwise Android strips them.
value.gsub(/\A *| *\z/) { |spaces| '\u0020' * spaces.length }
end