thor fixups and component/locale standardization#121
Merged
movermeyer merged 3 commits intomainfrom Apr 19, 2022
Merged
Conversation
cb08daa to
64ff691
Compare
thor fixups and component name standardizationthor fixups and component/locale standardization
5c9ecdb to
85206fd
Compare
trishrempel
approved these changes
Apr 19, 2022
`method_options` has been renamed `options` Load the defaults from the actual code
Before, it wasn't clear how to specify a name that was multiple words. You could specify `CountryCodes`, `country-codes`, or `country_codes` and all would work. Standardize on capital case arbitrarily. Also, throughout the code use `Symbol`s for the component names.
Before, it wasn't clear whether a user should provide CLDR-style locales (e.g., `en_US`) or `ruby-i18n`-style locales (e.g., `en-US`).
85206fd to
4aa7b47
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are you trying to accomplish?
thorhas changed the way that you specify options. I've refreshed our use ofthorto match.As part of this, I standardize the names used to refer to components and locales on the command line (and internally in the codebase).
What approach did you choose and why?
I arbitrarily picked the capital-case of the module names.
Before, you could specify
CountryCodes,country-codes, orcountry_codesand all would work. There was no need to support this flexibility, so I picked one style to enforce. Now, onlyCountryCodesis valid.I also arbitrarily picked the
ruby-i18nversion of locales codes (en-USinstead ofen_US)Before, it was expecting CLDR versions of locale codes (e.g.,
en_US).Standardizing on this format allowed me to remove some unnecessary calls to
to_i18n.Since
type: arrayvalues don't yet getenumvalidation fromthor, this validation of the inputs had to be done inruby-cldr.What should reviewers focus on?
🤷
There is only one change to the output of
thor cldr:export, which was incorrectly outputting the wrong locale code:The impact of these changes
thor cldr:export.ruby-cldrversion of the locale codes when they usethor cldr:export.thor help cldr:export, the printout is much nicer, and relies on defaults that come from the constants actually used by the code.Testing
thor cldr:exportSee the new help docs with: