@esgettext/tools 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -50
- package/dist/commands/init.js +1 -1
- package/dist/package.js +1 -1
- package/dist/parser/javascript.js +1 -2
- package/dist/parser/typescript.js +1 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -7,37 +7,37 @@ The package also contains code for parsing po files and for writing them.
|
|
|
7
7
|
## Table of Contents <!-- omit in toc -->
|
|
8
8
|
|
|
9
9
|
- [Prerequisites](#prerequisites)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
- [Un\*x/Linux](#unxlinux)
|
|
11
|
+
- [Mac OS X](#mac-os-x)
|
|
12
|
+
- [MacPorts](#macports)
|
|
13
|
+
- [HomeBrew](#homebrew)
|
|
14
|
+
- [MS-DOS (Microsoft Windows)](#ms-dos-microsoft-windows)
|
|
15
15
|
- [Installation](#installation)
|
|
16
16
|
- [The Tools](#the-tools)
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
- [`esgettext xgettext`](#esgettext-xgettext)
|
|
18
|
+
- [Other Commands](#other-commands)
|
|
19
19
|
- [Configuration](#configuration)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
20
|
+
- [Configuration Files](#configuration-files)
|
|
21
|
+
- [Validation](#validation)
|
|
22
|
+
- [Configuration Schema](#configuration-schema)
|
|
23
|
+
- [`package`](#package)
|
|
24
|
+
- [`package.textdomain`](#packagetextdomain)
|
|
25
|
+
- [`package.msgid-bugs-address`](#packagemsgid-bugs-address)
|
|
26
|
+
- [`package.name`](#packagename)
|
|
27
|
+
- [`package.copyright-holder`](#packagecopyright-holder)
|
|
28
|
+
- [`package.version`](#packageversion)
|
|
29
|
+
- [`po`:](#po)
|
|
30
|
+
- [`po.directory`](#podirectory)
|
|
31
|
+
- [`po.locales`](#polocales)
|
|
32
|
+
- [`install`](#install)
|
|
33
|
+
- [`install.directory`](#installdirectory)
|
|
34
|
+
- [`programs`](#programs)
|
|
35
|
+
- [`programs.msgmerge`](#programsmsgmerge)
|
|
36
|
+
- [`programs.msgmerge.path`](#programsmsgmergepath)
|
|
37
|
+
- [`programs.msgmerge.options`](#programsmsgmergeoptions)
|
|
38
|
+
- [`programs.msgfmt`](#programsmsgfmt)
|
|
39
|
+
- [`programs.msgfmt.path`](#programsmsgfmtpath)
|
|
40
|
+
- [`programs.msgfmt.options`](#programsmsgfmtoptions)
|
|
41
41
|
- [Copyright](#copyright)
|
|
42
42
|
|
|
43
43
|
## Prerequisites
|
|
@@ -47,7 +47,7 @@ tools. If the command `xgettext --version` outputs some kind of version
|
|
|
47
47
|
information, you are most probably set. Otherwise check the information for
|
|
48
48
|
your platform below.
|
|
49
49
|
|
|
50
|
-
### Un
|
|
50
|
+
### Un\*x/Linux
|
|
51
51
|
|
|
52
52
|
Use the package manager of your vendor to search for something like
|
|
53
53
|
"gettext-tools" or just "gettext" and install it. The gettext tools are
|
|
@@ -74,8 +74,8 @@ $ brew install gettext
|
|
|
74
74
|
|
|
75
75
|
The options that I know of are
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
- [Cygwin](https://www.cygwin.com/)
|
|
78
|
+
- [MinGW](http://www.mingw.org/)
|
|
79
79
|
|
|
80
80
|
See their documentation for more information.
|
|
81
81
|
|
|
@@ -121,6 +121,7 @@ If you have installed them globally, just omit the leading `npx`.
|
|
|
121
121
|
Try this for an overview:
|
|
122
122
|
|
|
123
123
|
```shell
|
|
124
|
+
$ npm install --save-deve @esgettext/tools
|
|
124
125
|
$ npx esgettext --help
|
|
125
126
|
```
|
|
126
127
|
|
|
@@ -137,7 +138,7 @@ for more details.
|
|
|
137
138
|
|
|
138
139
|
### Other Commands
|
|
139
140
|
|
|
140
|
-
All other commands should be understandable by their help output.
|
|
141
|
+
All other commands should be understandable by their help output. Try
|
|
141
142
|
`npx esgettext --help` for an overview over all commands, and
|
|
142
143
|
`npx esgettext COMMAND --help` for help for a specific command.
|
|
143
144
|
|
|
@@ -150,18 +151,18 @@ in a configuration file or just in `package.json`.
|
|
|
150
151
|
|
|
151
152
|
Configuration files are checked in this order:
|
|
152
153
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
154
|
+
- esgettext.config.mjs
|
|
155
|
+
- esgettext.config.cjs
|
|
156
|
+
- esgettext.config.js
|
|
157
|
+
- esgettext.config.json
|
|
158
|
+
- package.json
|
|
158
159
|
|
|
159
160
|
The JavaScript versions should have one default export with the configuration.
|
|
160
161
|
The JSON version just defines the configuration. Alteratively, you can add
|
|
161
162
|
a field "esgettext" to your `package.json`.
|
|
162
163
|
|
|
163
164
|
You should always configure `po.locales` with a list of locale identifiers that
|
|
164
|
-
your package supports.
|
|
165
|
+
your package supports. Otherwise, using `esgettext` does not make sense.
|
|
165
166
|
|
|
166
167
|
You should also set `package.textdomain` unless you are happy with the
|
|
167
168
|
default which is just your package name read from `package.json`.
|
|
@@ -170,8 +171,8 @@ All other configuration values have sane defaults.
|
|
|
170
171
|
|
|
171
172
|
### Validation
|
|
172
173
|
|
|
173
|
-
The required format is always the same.
|
|
174
|
-
validated against a schema.
|
|
174
|
+
The required format is always the same. Note that the configuration gets
|
|
175
|
+
validated against a schema. All tools will fail with a validation error if
|
|
175
176
|
you pass an invalid configuration.
|
|
176
177
|
|
|
177
178
|
### Configuration Schema
|
|
@@ -180,7 +181,7 @@ All fields in the configuration are optional because you are always able to
|
|
|
180
181
|
pass them on the command line.
|
|
181
182
|
|
|
182
183
|
Options passed on the command line have higher precedence than options given
|
|
183
|
-
in a configuration file.
|
|
184
|
+
in a configuration file. Options that you define inside a section `esgettext`
|
|
184
185
|
in `package.json` have higher precedence than options that default to
|
|
185
186
|
general fields inside `package.json`.
|
|
186
187
|
|
|
@@ -206,12 +207,12 @@ General information about your package.
|
|
|
206
207
|
##### `package.textdomain`
|
|
207
208
|
|
|
208
209
|
The textdomain of your package, usually something like
|
|
209
|
-
`com.example.YOUR-PACKAGE`.
|
|
210
|
+
`com.example.YOUR-PACKAGE`. You should configure this.
|
|
210
211
|
|
|
211
212
|
##### `package.msgid-bugs-address`
|
|
212
213
|
|
|
213
214
|
An email address or URL where to send bug reports or questions about message
|
|
214
|
-
ids.
|
|
215
|
+
ids. This is added to the respective field in all generated po files.
|
|
215
216
|
|
|
216
217
|
If you omit this field, it will be read from the fields `bugs.email` or
|
|
217
218
|
`bugs.url` (in that order) in `package.json`.
|
|
@@ -225,13 +226,12 @@ If you omit this field, it will be read from the field `name` in
|
|
|
225
226
|
|
|
226
227
|
##### `package.copyright-holder`
|
|
227
228
|
|
|
228
|
-
The copyright holder of your package.
|
|
229
|
+
The copyright holder of your package. This is added as a comment to all
|
|
229
230
|
generated po files.
|
|
230
231
|
|
|
231
232
|
If you omit this field, it will be read from the field `people.author` in
|
|
232
233
|
`package.json`.
|
|
233
234
|
|
|
234
|
-
|
|
235
235
|
##### `package.version`
|
|
236
236
|
|
|
237
237
|
The version of your package.
|
|
@@ -250,7 +250,7 @@ The directory where all translation related files reside, usually 'po'.
|
|
|
250
250
|
|
|
251
251
|
##### `po.locales`
|
|
252
252
|
|
|
253
|
-
An array of locale identifiers.
|
|
253
|
+
An array of locale identifiers. This should always be configured.
|
|
254
254
|
|
|
255
255
|
#### `install`
|
|
256
256
|
|
|
@@ -273,8 +273,8 @@ The path to the `msgmerge` program of your system.
|
|
|
273
273
|
|
|
274
274
|
###### `programs.msgmerge.options`
|
|
275
275
|
|
|
276
|
-
An array of options to pass to the `msgmerge` program.
|
|
277
|
-
without arguments are supported.
|
|
276
|
+
An array of options to pass to the `msgmerge` program. Only boolean options
|
|
277
|
+
without arguments are supported. And you have to omit the leading hyphens,
|
|
278
278
|
for example `['verbose']` or `['v']`, and not `['--verbose']` or `['-v']`.
|
|
279
279
|
|
|
280
280
|
##### `programs.msgfmt`
|
|
@@ -285,8 +285,8 @@ The path to the `msgfmt` program of your system.
|
|
|
285
285
|
|
|
286
286
|
###### `programs.msgfmt.options`
|
|
287
287
|
|
|
288
|
-
An array of options to pass to the `msgmerge` program.
|
|
289
|
-
without arguments are supported.
|
|
288
|
+
An array of options to pass to the `msgmerge` program. Only boolean options
|
|
289
|
+
without arguments are supported. And you have to omit the leading hyphens,
|
|
290
290
|
for example `['verbose']` or `['v']`, and not `['--verbose']` or `['-v']`.
|
|
291
291
|
|
|
292
292
|
## Copyright
|
package/dist/commands/init.js
CHANGED
|
@@ -669,7 +669,7 @@ class Init {
|
|
|
669
669
|
message: gtx._x("(Boolean) options to invoke '{tool}' with", {
|
|
670
670
|
tool: 'msgmerge',
|
|
671
671
|
}),
|
|
672
|
-
default: '--
|
|
672
|
+
default: '--update --previous',
|
|
673
673
|
}),
|
|
674
674
|
msgfmt: yield (0, prompts_1.input)({
|
|
675
675
|
message: gtx._x("The '{tool}' program to use:", { tool: 'msgfmt' }),
|
package/dist/package.js
CHANGED
|
@@ -11,8 +11,7 @@ class JavaScriptParser extends parser_2.Parser {
|
|
|
11
11
|
allowReturnOutsideFunction: true,
|
|
12
12
|
allowSuperOutsideMethod: true,
|
|
13
13
|
allowUndeclaredExports: true,
|
|
14
|
-
|
|
15
|
-
// errorRecovery: true,
|
|
14
|
+
errorRecovery: true,
|
|
16
15
|
sourceFilename: filename,
|
|
17
16
|
plugins: [
|
|
18
17
|
'flow',
|
|
@@ -11,8 +11,7 @@ class TypeScriptParser extends parser_2.Parser {
|
|
|
11
11
|
allowReturnOutsideFunction: true,
|
|
12
12
|
allowSuperOutsideMethod: true,
|
|
13
13
|
allowUndeclaredExports: true,
|
|
14
|
-
|
|
15
|
-
// errorRecovery: true,
|
|
14
|
+
errorRecovery: true,
|
|
16
15
|
sourceFilename: filename,
|
|
17
16
|
plugins: [
|
|
18
17
|
'typescript',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esgettext/tools",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Gettext-like po creation and manipulation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gettext",
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"valibot": "^0.31.1",
|
|
115
115
|
"yargs": "^17.7.2"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "26c7da76d48c0e0e2d6021ed3e8fd5939417895f"
|
|
118
118
|
}
|