Created
January 23, 2018 10:33
-
-
Save Stickerbox/b87bba961a1c154b8a1b181ec1930721 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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