Skip to content

Instantly share code, notes, and snippets.

@Stickerbox
Created January 23, 2018 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Stickerbox/b87bba961a1c154b8a1b181ec1930721 to your computer and use it in GitHub Desktop.
Save Stickerbox/b87bba961a1c154b8a1b181ec1930721 to your computer and use it in GitHub Desktop.
import Foundation
// MARK: - Localisation
struct Localised {
{% for enum in types.implementing.Localisable %}
struct {{ enum.name|replace:"SourceryLocaliser.",""|replace:".","_" }} {
{% for case in enum.cases %}
static var {{ case.name }}: String { return NSLocalizedString("{{ enum.name|replace:"SourceryLocaliser.",""}}.{{case.name|capitalize}}", comment: "") }
{% endfor %}
}
{% endfor %}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment