Skip to content

Commit 4aad448

Browse files
committed
Update gettext-parser to v4; adjust code & docs accordingly
1 parent 2159f88 commit 4aad448

File tree

4 files changed

+91
-15
lines changed

4 files changed

+91
-15
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ msgstr "Nema zvezde po imenu %(starname)s."
4747
`)
4848

4949
const MessageFormat = require('messageformat')
50-
const mf = new MessageFormat({ [headers.language]: pluralFunction })
50+
const mf = new MessageFormat({ [headers.Language]: pluralFunction })
5151
const messages = mf.compile(translations)
5252

5353
messages['Time: %1 second']([1])
@@ -98,7 +98,7 @@ For more options, take a look at the [source](./index.js).
9898
Both functions return an object containing the following fields:
9999

100100
- `headers` (object) – The raw contents of the input file's headers, with keys
101-
lower-cased
101+
using canonical casing.
102102
- `pluralFunction` (function) – An appropriate pluralisation function to use for
103103
the output translations, suitable to be used directly by [messageformat]. May
104104
be `null` if none was set in `options` and if the input did not include a

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const convert = (parse, input, options) => {
6969
options = Object.assign({}, defaultOptions, options)
7070
const { headers, translations } = parse(input, options.defaultCharset)
7171
if (!options.pluralFunction) {
72-
options.pluralFunction = getPluralFunction(headers['plural-forms'])
72+
options.pluralFunction = getPluralFunction(headers['Plural-Forms'])
7373
}
7474
let hasContext = false
7575
for (const context in translations) {

package-lock.json

Lines changed: 87 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"node": ">=6.0"
1818
},
1919
"dependencies": {
20-
"gettext-parser": "^1.4.0"
20+
"gettext-parser": "^4.0.4"
2121
},
2222
"devDependencies": {
2323
"messageformat": "^2.3.0"

0 commit comments

Comments
 (0)