-
Notifications
You must be signed in to change notification settings - Fork 23
Localization
Localization works as described in the Apple Documentation or this helpful tutorial. Strings files are included in the project and can be exported to and imported from Xliff files if necessary for translation by external translation agencies.
Strings files live in the Translations
directory,
To test localization, you can edit your currently active scheme, and in "Options", set the "Application Language". Don't commit this change please.
Do not put NSLocalizedString
instances directly into your code please. Instead, add the to Strings.swift
. Check if there is already a section there where your strings fit in well, and if not add one. Sections should look like below. Don't forget the tableName parameter.
Localized Strings should use keys that describe a path to where they can be found, like HomePanel.ContextMenu.OpenInNewTab
. Do not use "Open in New Tab" as a key!
// Home Panel Context Menu.
extension Strings {
public static let OpenInNewTabContextMenuTitle = NSLocalizedString("HomePanel.ContextMenu.OpenInNewTab" tableName: "UserAgent", comment: "The title for the Open in New Tab context menu action for sites in Home Panels")
public static let OpenInNewPrivateTabContextMenuTitle = NSLocalizedString("HomePanel.ContextMenu.OpenInNewPrivateTab" tableName: "UserAgent", comment: "The title for the Open in New Private Tab context menu action for sites in Home Panels")
// ...
}
Add your keys and translations to UserAgent.strings
. If you don't speak all available languages, ask a coworker or create a ticket if no one is available.