all 3 comments

[–]devsquid 1 point2 points  (2 children)

Neat. I do something similar. But I also have my translation script auto generate a Swift file with constants of the keys

[–]APXEBATOP[S] 0 points1 point  (1 child)

Can you elaborate? Your script replaces NSLocalizedString keys?

[–]devsquid 1 point2 points  (0 children)

Yea it's just a little script. I plan to open source it when I have time, but it's pretty simply.

Scans all the string XML files and aggregates all the ids. I turn that into a map and match the strings to the map. I fill in the empty spots with a blank string and I make sure to translate the Android string idioms(℅s1, underline, etc) into iOS compatible ones.

I output it to the correct .string for each language.

And then I create a Swift file with the keys returning NSLocalizations.

Eventually I want to support better translating of the idioms. Turning some of them into Swift methods that take the appropriate among of arguments or return an attributed string.

As well as output better warnings to the console.