Skip to content

Commit

Permalink
build: use translation tools from pkg/lib
Browse files Browse the repository at this point in the history
Use the html2po and manifest2po tools that we already check out from
cockpit repo pkg/lib.

These tools switched to a new argument parser library (`argparse`) in
cockpit-project/cockpit#16271, so add it to our package.json and drop
`stdio`.

Drop our old copies.

I checked the result of building `po/starter-kit.pot` before and after
the change, and aside from the timestamp, it's identical.

Cherry-picked from cockpit-podman commit bf53f801b17ba6.
  • Loading branch information
martinpitt committed Jun 30, 2022
1 parent 54cd5e8 commit 6e1fd84
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 463 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ po/$(PACKAGE_NAME).js.pot:
--keyword=gettext:1,1t --keyword=gettext:1c,2,2t \
--keyword=ngettext:1,2,3t --keyword=ngettext:1c,2,3,4t \
--keyword=gettextCatalog.getString:1,3c --keyword=gettextCatalog.getPlural:2,3,4c \
--from-code=UTF-8 $$(find src/ \( -name '*.js' -o -name '*.jsx' \))
--from-code=UTF-8 $$(find src/ -name '*.js' -o -name '*.jsx')

po/$(PACKAGE_NAME).html.pot: $(NODE_MODULES_TEST)
po/html2po -o $@ $$(find src -name '*.html')
po/$(PACKAGE_NAME).html.pot: $(NODE_MODULES_TEST) $(COCKPIT_REPO_STAMP)
pkg/lib/html2po -o $@ $$(find src -name '*.html')

po/$(PACKAGE_NAME).manifest.pot: $(NODE_MODULES_TEST)
po/manifest2po src/manifest.json -o $@
po/$(PACKAGE_NAME).manifest.pot: $(NODE_MODULES_TEST) $(COCKPIT_REPO_STAMP)
pkg/lib/manifest2po src/manifest.json -o $@

po/$(PACKAGE_NAME).metainfo.pot: $(APPSTREAMFILE)
xgettext --default-domain=$(PACKAGE_NAME) --output=$@ $<
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@babel/eslint-parser": "^7.17.0",
"@babel/preset-env": "^7.5.4",
"@babel/preset-react": "^7.0.0",
"argparse": "^2.0.1",
"babel-loader": "^8.0.6",
"chrome-remote-interface": "^0.31.0",
"compression-webpack-plugin": "^9.0.0",
Expand All @@ -41,7 +42,6 @@
"sass": "^1.35.2",
"sass-loader": "^12.1.0",
"sizzle": "^2.3.3",
"stdio": "^2.1.0",
"string-replace-loader": "^3.0.0",
"terser-webpack-plugin": "^5.1.4",
"webpack": "^5.54.0",
Expand Down
264 changes: 0 additions & 264 deletions po/html2po

This file was deleted.

Loading

0 comments on commit 6e1fd84

Please sign in to comment.