Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand Localizable with tableName #7

Closed
mpospese opened this issue Sep 7, 2022 · 0 comments · Fixed by #25
Closed

Expand Localizable with tableName #7

mpospese opened this issue Sep 7, 2022 · 0 comments · Fixed by #25
Assignees

Comments

@mpospese
Copy link
Contributor

mpospese commented Sep 7, 2022

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants