Hello,
I want to use Automatic Grammar Agreement to localise a string in my app, let say "three remaining activities". The string "three" is obtained by using a NumberFormatter with a numberStyle set to .spellOut (so I'm not using an Integer)
var formatter: NumberFormatter = NumberFormatter()
formatter.numberStyle = .spellOut
let formattedCount: String = numberFormatter.string(from: count as NSNumber)!
Text("key_with_string_\(formattedCount)")
In my string catalog, I have translated the key key_with_string_%@
like this ^[%@ remaining activity](inflect: true)
, but it does not work.
I've tried to add the integer value used by the number formatter in the key key_with_string_%@_%lld
but it does not work.
- Should Automatic Grammar Agreement work normally just by using the formatted string provided by the NumberFormatter?
- If not, is there a way to specify to use a secondary variable (my count integer) to switch between different categories like one and other automatically?
Thanks ! Axel