gettext-universal 1.0.11 → 1.0.13
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/package.json +1 -1
- package/src/config.js +1 -1
- package/src/scanner.js +5 -0
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -7,7 +7,7 @@ class Config {
|
|
|
7
7
|
|
|
8
8
|
loadTranslationsFromRequireContext(requireContext) {
|
|
9
9
|
for (const localeFile of requireContext.keys()) {
|
|
10
|
-
const match = localeFile.match(
|
|
10
|
+
const match = localeFile.match(/([a-z]{2}).js$/)
|
|
11
11
|
|
|
12
12
|
if (!match) {
|
|
13
13
|
throw new Error(`Couldn't detect locale from file: ${localeFile}`)
|
package/src/scanner.js
CHANGED
|
@@ -120,6 +120,11 @@ export default class Scanner {
|
|
|
120
120
|
|
|
121
121
|
let translationsCount = 0
|
|
122
122
|
|
|
123
|
+
await fp.write("msgid \"\"\n")
|
|
124
|
+
await fp.write("msgstr \"\"\n")
|
|
125
|
+
await fp.write("\"Content-Type: text/plain; charset=UTF-8\\n\"\n")
|
|
126
|
+
await fp.write("\n") // Empty line after header
|
|
127
|
+
|
|
123
128
|
for (const translationKey in this.translations) {
|
|
124
129
|
const translation = this.translations[translationKey]
|
|
125
130
|
|