My goal is to have separate translations files for my main app and Siri Extension.
I have in my swiftgen.yml file:
strings:
inputs: SiriExtension/Errors/en.lproj/Errors.strings
outputs:
templateName: flat-swift4
output: SiriExtension/Errors/Errors.swift
parameters:
enumName: SiriError
strings:
inputs: MainApp/Resources/en.lproj/Localizable.strings
outputs:
templateName: flat-swift4
output: MainApp/Constants/Strings.swift
Despite including both of the strings commands in the file, only one is executed.
swiftgen config lint prints:
> 1 entry for command strings:
$ swiftgen strings --templateName flat-swift4 --output MainApp/Constants/Strings.swift MainApp/Resources/en.lproj/Localizable.strings
What am I doing wrong?
Check the Configuration File Format documentation, for multiple invocations of the same command, you'll want something like:
strings:
- inputs: SiriExtension/Errors/en.lproj/Errors.strings
outputs:
templateName: flat-swift4
output: SiriExtension/Errors/Errors.swift
parameters:
enumName: SiriError
- inputs: MainApp/Resources/en.lproj/Localizable.strings
outputs:
templateName: flat-swift4
output: MainApp/Constants/Strings.swift
OK sorry, I must have missed it somehow.
Now the file is being generated, but the enum name is still the default L10n (I set the config file exactly as you wrote).
I found the problem, it should be params instead of parameters.
Most helpful comment
Check the Configuration File Format documentation, for multiple invocations of the same command, you'll want something like: