From e7215ccba23e95d03f8f490d19c8f52d9ca82c03 Mon Sep 17 00:00:00 2001 From: Dwayne Bailey Date: Thu, 15 Aug 2024 18:41:24 +0100 Subject: [PATCH] Break serialising strings on \n for readabilty --- lib/twine/formatters/apple_plural.rb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/twine/formatters/apple_plural.rb b/lib/twine/formatters/apple_plural.rb index f37f47f..422a5e0 100644 --- a/lib/twine/formatters/apple_plural.rb +++ b/lib/twine/formatters/apple_plural.rb @@ -39,13 +39,19 @@ module Twine def format_plural_keys(key, plural_hash) result = "#{tab(2)}#{key}\n" result += "#{tab(2)}\n" - result += "#{tab(4)}NSStringLocalizedFormatKey\n#{tab(4)}\%\#@value@\n" - 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 += "#{tab(4)}NSStringLocalizedFormatKey\n" + result += "#{tab(4)}\%\#@value@\n" + result += "#{tab(4)}value\n" + result += "#{tab(4)}\n" + result += "#{tab(6)}NSStringFormatSpecTypeKey\n" + result += "#{tab(6)}NSStringPluralRuleType\n" + result += "#{tab(6)}NSStringFormatValueTypeKey\n" + "#{tab(6)}d\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" + result += "\n" + result += "#{tab(4)}\n" + result += "#{tab(2)}\n" end def format_comment(definition, lang)