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

Automate L10n extraction locally and in CI #12800

Merged
merged 2 commits into from
Jul 15, 2024
Merged

Automate L10n extraction locally and in CI #12800

merged 2 commits into from
Jul 15, 2024

Conversation

KevinMind
Copy link
Contributor

@KevinMind KevinMind commented Jan 19, 2024

Fixes: mozilla/addons#14848

Testing

PR on origin: Link
PR on fork: TBD

Copy link

codecov bot commented Jan 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.29%. Comparing base (22435e4) to head (3e764fa).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #12800   +/-   ##
=======================================
  Coverage   98.29%   98.29%           
=======================================
  Files         267      267           
  Lines       10600    10600           
  Branches     3221     3221           
=======================================
  Hits        10419    10419           
  Misses        168      168           
  Partials       13       13           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@KevinMind KevinMind force-pushed the localization branch 21 times, most recently from f3a1b22 to 294556f Compare January 19, 2024 19:04
@KevinMind
Copy link
Contributor Author

Generated this PR: #12801

@KevinMind KevinMind force-pushed the localization branch 4 times, most recently from 7644112 to 92daf39 Compare January 19, 2024 19:55
@KevinMind
Copy link
Contributor Author

I've merged all of the scripts into a single zx executable. It extracts and merges locales for the current code base. It is pretty fast 2x the previous set of scripts (<15seconds locally and in CI)

Local Options

  1. Run the locale.mjs script as a pre-commit hook
  2. Run the babel plugin directly in our dev and prod builds

CI options

  1. Run on every PR, failing if locales are not built
  2. Run on pull requests, pre merge (may need queue to do that I'm not sure)
  3. Run on master commits, post merge but pre tag
    a. we can commit directly on master
    b. we could open a PR with the generated locale changes.

All options would work, it's more about the kind of experience we want to have.

@KevinMind KevinMind force-pushed the localization branch 2 times, most recently from 9df4428 to 4b047e0 Compare July 12, 2024 08:17
@KevinMind KevinMind force-pushed the localization branch 5 times, most recently from e891702 to 74b3ca9 Compare July 12, 2024 08:54
@KevinMind KevinMind changed the title tmp: test action Automate L10n extraction locally and in CI Jul 12, 2024
@KevinMind KevinMind requested a review from willdurand July 12, 2024 08:57
docs/i18n.md Show resolved Hide resolved
@KevinMind KevinMind force-pushed the localization branch 3 times, most recently from 82204e9 to 64f0481 Compare July 12, 2024 09:05
@KevinMind KevinMind marked this pull request as ready for review July 12, 2024 09:27
Copy link
Member

@eviljeff eviljeff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+wc

Comment on lines +14 to +23
'Project-Id-Version': 'amo',
'Report-Msgid-Bugs-To': 'EMAIL@ADDRESS',
'POT-Creation-Date': potCreationDate,
'PO-Revision-Date': 'YEAR-MO-DA HO:MI+ZONE',
'Last-Translator': 'FULL NAME <EMAIL@ADDRESS>',
'Language-Team': 'LANGUAGE <[email protected]>',
'MIME-Version': '1.0',
'Content-Type': 'text/plain; charset=utf-8',
'Content-Transfer-Encoding': '8bit',
'plural-forms': 'nplurals=2; plural=(n!=1);',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some of this looks a bit boilerplate-y (e.g. EMAIL@ADDRESS) - does it need updating?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied verbatim from here. I could actually remove the webpack config file while we are here as that is no longer referenced or needed.

@KevinMind KevinMind merged commit 4e1d5f6 into master Jul 15, 2024
11 checks passed
@KevinMind KevinMind deleted the localization branch July 15, 2024 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Automate addons-frontend locales extraction
3 participants