You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's expand our Localizable protocol to include tableName support.
add static var tableName: String? to Localizable
add a default implementation of tableName to return nil
expand String.localized to add table tableName: String? = nil second parameter and pass that to the internal call to NSLocalizedString.
expand the default implementation of Localizable.localized to pass Self.tableName to String.localized(bundle:tableName:)
(Basically everywhere we're using bundle in conjunction with Localizable, we should also use tableName.
make sure all public interfaces are fully documented with documentation comments
make sure new code paths are fully covered with unit tests (see String+LocalizedTests.swift)
for testing let's add a new Settings.strings file under Tests/YCoreUITests/Assets/Strings/en.lproj and add 3 string values to it. Declare a new SettingsConstants enum which overrides tableName to find to the right strings file. Test that all the values in this enum load properly.
The text was updated successfully, but these errors were encountered:
Let's expand our Localizable protocol to include tableName support.
static var tableName: String?
toLocalizable
tableName
to returnnil
String.localized
to addtable tableName: String? = nil
second parameter and pass that to the internal call toNSLocalizedString
.Localizable.localized
to passSelf.tableName
toString.localized(bundle:tableName:)
(Basically everywhere we're using
bundle
in conjunction withLocalizable
, we should also usetableName
.String+LocalizedTests.swift
)Settings.strings
file underTests/YCoreUITests/Assets/Strings/en.lproj
and add 3 string values to it. Declare a newSettingsConstants
enum which overrides tableName to find to the right strings file. Test that all the values in this enum load properly.The text was updated successfully, but these errors were encountered: