Commit graph

11 commits

Author SHA1 Message Date
Martin Pitt
7f6ef51c12
Build translations with webpack
Convert the `po2json` script into a webpack plugin, and integrate the
(now trivial) po.empty.js template.

This is the last step for building the entire dist/ directory with
`npm run build` (i.e. a tool that web developers are familiar with),
and not having a split webpack+make toolchain any more.
2021-01-05 14:52:59 +01:00
Martin Pitt
88fe99361b Simplify translation template
`this.po` is not being used anywhere, so drop the whole `!loaded` code
path. There is no defer mechanism, so `po.js` *must* be loaded after
cockpit.js. Let's trigger a crash instead of silently dropping
translations, to make such a bug obvious in manual and automatic tests.
2021-01-04 14:01:59 +01:00
Martin Pitt
c7f610f489 Fix po2json usage help
The output file is an option, not a positional argument.

`opts.args` is undefined if there are no positional arguments, so that
just calling `po/po2json` crashed with

    TypeError: Cannot read property 'length' of undefined
2021-01-04 14:01:59 +01:00
Martin Pitt
f93ccb26a8 Fix po2json default option arguments
Similarly to commit cbedf06704, provide default values, so that
`po2json po/de.po` does not error out with

    Option "--module" requires 1 arguments, but 0 were provided
2021-01-04 14:01:59 +01:00
Martin Pitt
43c51b979b po: Add Language: header value to German translations 2021-01-04 14:01:59 +01:00
Martin Pitt
cbedf06704 Fix building PO template
The current version failed with

    Option "--directory" requires 1 arguments, but 0 were provided

In the current stdio npm module version, getopt() now requires a
`default:` attribute, otherwise it considers the options as required.

Also sync PO helpers with current cockpit.

Add PO template build to travis check, to make sure that it keeps
working.

Closes #375
2020-09-29 13:50:31 +03:00
Matej Marusak
d9a67b1f86 manifest2po: Parse also documentation
Closes #275
2020-02-03 11:48:38 +01:00
Matej Marusak
ec85d30d0f manifest2po: Parse also keywords 2020-02-03 11:48:38 +01:00
Martin Pitt
9fa5c6ab05 Properly initialize state of Application
This will otherwise crash with React 16.
2018-08-29 00:40:16 +02:00
Martin Pitt
47e02ef136 Add i18n for HTML and manifest 2018-06-19 18:09:57 +02:00
Martin Pitt
7ce7b2b40b Add i18n support
Make the "Running on.." string translatable and copy the extraction and
conversion of JSX and PO files from Cockpit.
2018-06-19 14:40:45 +02:00