diff --git a/lib/twine/formatters/apple.rb b/lib/twine/formatters/apple.rb index 93ec43c..9220a26 100644 --- a/lib/twine/formatters/apple.rb +++ b/lib/twine/formatters/apple.rb @@ -1,6 +1,8 @@ module Twine module Formatters class Apple < Abstract + include Twine::Placeholders + def format_name 'apple' end @@ -84,6 +86,8 @@ module Twine end def format_value(value) + # Replace Android's %s with iOS %@ + value = convert_placeholders_from_android_to_twine(value) escape_quotes(value) end diff --git a/lib/twine/formatters/apple_plural.rb b/lib/twine/formatters/apple_plural.rb index f7b16c5..301a84d 100644 --- a/lib/twine/formatters/apple_plural.rb +++ b/lib/twine/formatters/apple_plural.rb @@ -1,6 +1,8 @@ module Twine module Formatters class ApplePlural < Apple + include Twine::Placeholders + SUPPORTS_PLURAL = true def format_name @@ -42,7 +44,8 @@ module Twine result += "#{tab(4)}value\n#{tab(4)}\n" result += "#{tab(6)}NSStringFormatSpecTypeKey\n#{tab(6)}NSStringPluralRuleType\n" result += "#{tab(6)}NSStringFormatValueTypeKey\n#{tab(6)}d\n" - result += plural_hash.map{|quantity,value| "#{tab(6)}#{quantity}\n#{tab(6)}#{value}"}.join("\n") + # Replace Android's %s with iOS %@ + result += plural_hash.map{|quantity,value| "#{tab(6)}#{quantity}\n#{tab(6)}#{convert_placeholders_from_android_to_twine(value)}"}.join("\n") result += "\n#{tab(4)}\n#{tab(2)}\n" end