-
Notifications
You must be signed in to change notification settings - Fork 9
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
Introduce Locale helper models #296
base: trunk
Are you sure you want to change the base?
Conversation
Generated by 🚫 Danger |
Codecov Report
@@ Coverage Diff @@
## develop #296 +/- ##
===========================================
+ Coverage 51.64% 52.72% +1.08%
===========================================
Files 108 111 +3
Lines 4533 4637 +104
===========================================
+ Hits 2341 2445 +104
Misses 2192 2192
Continue to review full report at Codecov.
|
class Locales | ||
################### | ||
## Constants | ||
ALL_KNOWN_LOCALES = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WIP: To be completed with ios:
and app_store:
values for each locale; we'll also need to double-check all the tuples to ensure we defined the correct ones.
4f3ed7f
to
c44e44d
Compare
c44e44d
to
61147cf
Compare
I'm actually unsure if we use/need list of locale codes in the iOS Fastfiles like we do in the Android ones 🤔 at least yet? A quick look seem to indicate that we don't really rely on any hardcoded list for iOS, since when post-processing locales we just iterate over folder names in But I still think it would be nice to have those ios/app store locale codes in that list even if we don't yet really use them in our Fastfile, so that when we get the opportunity work on the "Improve Localization tooling" project (paaHJt-sd-p2) and likely migrate that Swift script into a fastlane action by then, we'd have those locale codes ready to be used. Another point: unlike android's @mokagio Thoughts? |
Sorry about closing the PR I went to click the text area but hit the close button 😮💨 |
Sorry for taking so long to reply!
+1 there's value in having them there for sure.
I like this idea very much. |
Still requires: - Completing the list of ALL_KNOWN_LOCALES - Enabling from_ios and from_app_store family of tests once we have the values
…ting point + enable missing corresponding specs
When run with a modern git version which supports `--initial-branch`, git init was run twice due to using `|` instead of expected `||` in the shell commands
…sed for each key/context + Split locale.rb and locales.rb
Per ruby conventions, as they might raise on invalid/unknown values
8dfc9ed
to
8204b59
Compare
This PR introduces the
Locales
model class in the release toolkit. Its intent is to work way more easily with locale codes in ourFastfiles
, by replacing huge constant lists like those 65 lines in WPAndroid'sFastfile
with way shorter and nicer lines like:This will return an
Array<Locale>
whereLocale
is a struct with 5 fields containing the locale codes for each space (glotpress, android, google_play, ios, app_store).A
Locale
can also be converted into aHash
for retro-compatibility with the existing toolkit actions that expect such aHash
(even though in the future we might want to support both aHash
and aLocale
for those actions, but that's for a separate story)This means we will be able to replace those WCAndroid 18 lines with just this – using
.map(&:to_h)
to convert it from anArray<Locale>
to anArray<Hash>
for compatibility with existing actions:Draft State
We still need to
ALL_KNOWN_LOCALES
: add the missing values forios
andapp_store
keys, then ensure all the codes are correct for all the various keys, and that we are not missing any known locale.from_ios
andfrom_app_store
family of tests once we have the values inALL_KNOWN_LOCALES
@mokagio I've added you as preliminary reviewer, feel free to take a first look (especially at the
Locales
class API and at the tests) and provide initial feedback. I'll add the whole Owl team as final reviewers once ☝️ is completed and I undraft the PR.