While the helpers are helpful in getting you up and running in 95% of use cases, they are not always exactly what everybody wants. In my use case, I still have a UIKit application that does custom localizations, so the generated String.init(localizable:locale:) method is not actually useful to me because I need to resolve the language in a different way.
It would be good in my project if I could just generate the definitions, and then write my own String.init(localizable:) method that works exactly how I need it instead of using the generated one.
While I'm aware that I could still do this by just creating a method with a different name, the concern that I have with leaving the default String.init(localizable:) method is that it makes things confusing and risks potentially using the wrong method. It would be better to eliminate it entirely.
The code generated by xcstrings-tool can be broken down into two categories:
Definitions
https://github.com/liamnichols/xcstrings-tool/blob/ca65df3b231944d6041a55d446bd6b78d1413575/Tests/XCStringsToolTests/__Snapshots__/GenerateTests/testGenerate.Localizable.swift#L50-L124
Helpers
https://github.com/liamnichols/xcstrings-tool/blob/ca65df3b231944d6041a55d446bd6b78d1413575/Tests/XCStringsToolTests/__Snapshots__/GenerateTests/testGenerate.Localizable.swift#L211-L219
https://github.com/liamnichols/xcstrings-tool/blob/ca65df3b231944d6041a55d446bd6b78d1413575/Tests/XCStringsToolTests/__Snapshots__/GenerateTests/testGenerate.Localizable.swift#L222-L233
https://github.com/liamnichols/xcstrings-tool/blob/ca65df3b231944d6041a55d446bd6b78d1413575/Tests/XCStringsToolTests/__Snapshots__/GenerateTests/testGenerate.Localizable.swift#L336-L411
While the helpers are helpful in getting you up and running in 95% of use cases, they are not always exactly what everybody wants. In my use case, I still have a UIKit application that does custom localizations, so the generated
String.init(localizable:locale:)
method is not actually useful to me because I need to resolve the language in a different way.It would be good in my project if I could just generate the definitions, and then write my own
String.init(localizable:)
method that works exactly how I need it instead of using the generated one.While I'm aware that I could still do this by just creating a method with a different name, the concern that I have with leaving the default
String.init(localizable:)
method is that it makes things confusing and risks potentially using the wrong method. It would be better to eliminate it entirely.