Closed JulesMoorhouse closed 2 years ago
Hi @JulesMoorhouse, that's an interesting approach!
StringsLint relies on simple pattern matching on text, so (I guess) it's too naive to reliably work with your approach.
Maybe you can modify it so at least it recognizes all cases of the enum Strings
as "used keys". It's not perfect but better than nothing I guess.
Thanks @dral3x .
I take it you mean…
case settingsAcknowledgements = “settingsAcknowledgements”
?
Exactly @JulesMoorhouse
I suppose I really need to generate my enums based on my strings file to be safe.
I know this is unrelated but are you aware of a templating tool that o could run as a build phase?
Thanks.
The easiest option is SwiftGen https://github.com/SwiftGen/SwiftGen If that's not enough, you can try Sourcery https://github.com/krzysztofzablocki/Sourcery for more customized code generation.
Thanks that’s awesome.
Hi,
I love the idea of
StringsLint
, however it doesn't work out of the tin for me. I use enums and rawValue instead of hard coding my LocalizedStringKeys.I'm guessing this will be too complicated for the
StringsLint
to pick up?Or maybe there's a configuration setting I can use ?
Thanks in advance.
Jules.