I'm developing a fully programmatically app (not sure if it matters) and get to the point where I want to localize it.
Most of my strings are look like this:
Code Block swift cell.label.text = localized("Hello world")
where localized() is just a wrapper around NSLocalizedString():
Code Block swift func localized(_ string: String) -> String { return NSLocalizedString(string, comment: "") }
So, I added desirable languages to my project and created *.strings file, but when I do
Code Block bash find ./ -name "*.swift" -exec echo {} \; -exec genstrings -s localized -a -o Resources/en.lproj {} \;
I get a lot of errors:
Code Block genstrings: error: bad entry in file ./bla-bla/myfile.swift (line = 30): Argument is not a literal string.
So, it seems that genstrings doesn't work with wrappers, though the man states:
Am I missing something? Is there any way to generate a strings file except looking for some better tools on GitHub/creating my own?Recognizes routine() as equivalent to NSLocalizedString(). For example, -s MyLocalString will catch calls to MyLocalString(), MyLocalStringFromTable(), and so on.
s routine [-s routine ...]