0

Is there a way to generate properties from comments, rather than localization keys using SwiftGen?

Here's an example for better illustration of what I mean:

Lozalizable.strings:

...
/* file_detail.button.download */
"T00014" = "Download";
...

Strings+Generated.swift:

internal enum L10n {
    internal enum FileDetail {
        internal enum Button {
            /// Download
            internal static let download = L10n.tr("Localizable", "T00014")
        }
    }
}
Lachtan
  • 4,803
  • 6
  • 28
  • 34

1 Answers1

0

You can write a self-written solution for this. If you want to use a comment instead of a key, write your .stencil for this and use it in SwiftGen. Some days before, I wrote my solution for localization, where I wrote a .stencil file you could check for inspiration.

https://github.com/idapgroup/xcode-localization-parser