-
Notifications
You must be signed in to change notification settings - Fork 154
Open
Description
It would be great to have an option to use Section Header as namespace for a key for strings.
Example desired output:
"Login.loginButton" = "Login";
"Login.emailAddressFieldHeader" = "Email Address";
"Login.passwordFieldHeader" = "Password";
"Login.forgotPassword" = "Forgot your password?";
Currently to get the desired output, Twine file format looks like this :
[[Login]]
[Login.loginButton]
en = Login
[Login.emailAddressFieldHeader]
en = Email Address
[Login.passwordFieldHeader]
en = Password
[Login.forgotPassword]
en = Forgot your password?
Feature requested would instead add the section header as a namespace for the key. Twine file format would look like this :
[[Login]]
[loginButton]
en = Login
[emailAddressFieldHeader]
en = Email Address
[passwordFieldHeader]
en = Password
[forgotPassword]
en = Forgot your password?
This is especially useful when Twine / Localizable strings are used with SwiftGen or other code generation tools. Example output of SwiftGen when we use namespaces :
internal enum Login {
/// Login
internal static let loginButton = L10n.tr("Localizable", "Login.loginButton")
/// Email Address
internal static let emailAddressFieldHeader = L10n.tr("Localizable", "Login.emailAddressFieldHeader")
/// Forgot your password?
internal static let forgotPassword = L10n.tr("Localizable", "Login.forgotPassword")
/// Reset Password
internal static let forgotPasswordButton = L10n.tr("Localizable", "Login.forgotPasswordButton")
/// Enter the email associated with your SHOEBOX QuickTest account. If found, we’ll send you instructions on how to reset your password.
internal static let forgotPasswordSubheader = L10n.tr("Localizable", "Login.forgotPasswordSubheader")
}
Coledunsby, danielmgauthier and SWeidlingerKolyall
Metadata
Metadata
Assignees
Labels
No labels