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

Bug: Missing i18n tasks/scripts #2957

Closed
5 tasks done
strarsis opened this issue Jan 21, 2022 · 2 comments · Fixed by #2958
Closed
5 tasks done

Bug: Missing i18n tasks/scripts #2957

strarsis opened this issue Jan 21, 2022 · 2 comments · Fixed by #2958
Labels

Comments

@strarsis
Copy link
Contributor

strarsis commented Jan 21, 2022

Terms

Description

What's wrong?

The i18n related tasks/scripts are missing.

What have you tried?

I tried to invoke the i18n related tasks/scripts (e.g. yarn translate:pot), but the tasks/scripts weren't found.
I also looked for them in the package.json and searched for a similar functionality in the new build tool (bud) that may replace it. Also searched for these i18n related tasks/scripts in the Sage 10 repository.

What insights have you gained?

The i18n related tasks/scripts were removed by this still recent PR:
https://github.com/roots/sage/pull/2643/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L20-L22

Possible solutions

Re-add the i18n related tasks/scripts.
Add the i18n functionality to bud (only if this really would make sense).

Temporary workarounds

Manually copy and re-add these i18n related tasks/scripts from the commit prior to the PR that removed these tasks/scripts.

{
  [...]
  "scripts": {
    [...]
    "translate": "npm run translate:pot && npm run translate:js",
    "translate:pot": "wp i18n make-pot . ./resources/lang/sage.pot --ignore-domain --include=\"app,resources\"",
    "translate:js": "wp i18n make-json ./resources/lang --pretty-print"
  },
  [...]
}

Steps To Reproduce

  1. Create a Sage 10 theme from latest commit.
  2. Install all dependencies.
  3. Invoke the i18n related tasks/scripts, e.g. yarn translate:pot or npm run translate:pot.
    Note that the tasks/scripts don't exist.
    Optionally inspect the package.json scripts field.

Expected Behavior

The i18n related tasks/scripts can be invoked to generate POT/MO files.

Actual Behavior

The i18n related tasks/scripts don't exist (anymore).

Relevant Log Output

yarn translate:pot
yarn run v1.22.17
error Command "translate:pot" not found.

Versions

WSL 2 (Ubuntu 20.04.3 LTS on Windows 10 x64)

@strarsis strarsis added the bug label Jan 21, 2022
@retlehs
Copy link
Member

retlehs commented Jan 22, 2022

👍 those scripts were accidentally removed when bud was merged

a PR would be appreciated to get those re-added!

ref #2672

@strarsis
Copy link
Contributor Author

@retlehs: #2958

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants