Skip to content

Expand Localizable with tableName #7

Closed
@mpospese

Description

@mpospese

Let's expand our Localizable protocol to include tableName support.

  1. add static var tableName: String? to Localizable
  2. add a default implementation of tableName to return nil
  3. expand String.localized to add table tableName: String? = nil second parameter and pass that to the internal call to NSLocalizedString.
  4. 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.

  1. make sure all public interfaces are fully documented with documentation comments
  2. make sure new code paths are fully covered with unit tests (see String+LocalizedTests.swift)
  3. 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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions