gflohr / esgettext Goto Github PK
View Code? Open in Web Editor NEWGettext-like translation runtime for JavaScript
License: Other
Gettext-like translation runtime for JavaScript
License: Other
de-DE
should be converted to de-de
.
The boolean options for msgmerge
and msgfmt
are actually known. We can just as well use checkboxes in esgettext init
to make them safer.
The only reason that @esgettext/runtime
does not validate JSON catalogues against a schema is the size of the resulting package. In situations where the package size does not matter, it would be good to hook in better validation methods, for example using Ajv. For that purpose, a JSON Schema and a JSON Type Definition would be helpful.
Running npm run esgettext
modifies the POT-Creation-Date of the pot and po files, even if nothing has changed.
Does GNU gettext behave the same? In that case, it's a DONTFIX.
The bundled version crashes:
/path/to/node_modules/@esgettext/tools/dist/index.js:9
const runtime_1 = require("@esgettext/runtime");
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/@esgettext/runtime/dist/esgettext.cjs.js from /path/to/node_modules/@esgettext/tools/dist/index.js not supported.
esgettext.cjs.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead either rename esgettext.cjs.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /path/to/node_modules/@esgettext/runtime/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).
at Object.<anonymous> (/path/to/node_modules/@esgettext/tools/dist/index.js:9:19) {
code: 'ERR_REQUIRE_ESM'
}
Node.js v20.11.1
The locale files do not end up in the configured dist directory.
The de-facto standard for server-side locales is de_DE
, not de-DE
.
Temporary workaround: Remove --update
from esgettext.config.json
and run again.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.