gettext-universal 1.0.2 → 1.0.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/.github/dependabot.yml +9 -0
- package/bin/{gettext-universal.mjs → gettext-universal.js} +1 -1
- package/bin/{po2mjs.mjs → po2mjs.js} +1 -1
- package/package.json +9 -5
- package/peak_flow.yml +1 -1
- package/spec/gettext-universal.spec.js +9 -0
- package/spec/support/jasmine.js +14 -0
- package/src/{config.mjs → config.js} +1 -1
- package/src/{po2mjs.mjs → po2mjs.js} +1 -1
- package/src/{translate.mjs → translate.js} +1 -1
- package/src/{use-translate-expo.mjs → use-translate-expo.js} +1 -1
- /package/src/{scanner.mjs → scanner.js} +0 -0
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bin": {
|
|
3
|
-
"gettext-universal": "bin/gettext-universal.
|
|
3
|
+
"gettext-universal": "bin/gettext-universal.js"
|
|
4
4
|
},
|
|
5
5
|
"name": "gettext-universal",
|
|
6
|
-
"
|
|
6
|
+
"type": "module",
|
|
7
|
+
"version": "1.0.3",
|
|
7
8
|
"main": "index.js",
|
|
8
9
|
"scripts": {
|
|
9
|
-
"gettext-universal": "node bin/gettext-universal.
|
|
10
|
-
"po2mjs": "node bin/po2mjs.
|
|
11
|
-
"test": "
|
|
10
|
+
"gettext-universal": "node bin/gettext-universal.js",
|
|
11
|
+
"po2mjs": "node bin/po2mjs.js",
|
|
12
|
+
"test": "jasmine"
|
|
12
13
|
},
|
|
13
14
|
"repository": {
|
|
14
15
|
"type": "git",
|
|
@@ -31,5 +32,8 @@
|
|
|
31
32
|
},
|
|
32
33
|
"peerDependencies": {
|
|
33
34
|
"expo-localization": "*"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"jasmine": "^5.7.1"
|
|
34
38
|
}
|
|
35
39
|
}
|
package/peak_flow.yml
CHANGED
|
@@ -5,7 +5,7 @@ class Config {
|
|
|
5
5
|
|
|
6
6
|
loadTranslationsFromRequireContext(requireContext) {
|
|
7
7
|
for (const localeFile of requireContext.keys()) {
|
|
8
|
-
const match = localeFile.match(/^\.\/([a-z]{2}).
|
|
8
|
+
const match = localeFile.match(/^\.\/([a-z]{2}).js$/)
|
|
9
9
|
|
|
10
10
|
if (!match) {
|
|
11
11
|
throw new Error(`Couldn't detect locale from file: ${localeFile}`)
|
|
@@ -21,7 +21,7 @@ export default class Po2Mjs {
|
|
|
21
21
|
async readFile(file, ext) {
|
|
22
22
|
const fullPath = `${this.directory}/${file}`
|
|
23
23
|
const baseName = path.basename(file, ext)
|
|
24
|
-
const jsFilePath = `${this.directory}/${baseName}.
|
|
24
|
+
const jsFilePath = `${this.directory}/${baseName}.js`
|
|
25
25
|
const fileContentBuffer = await fs.readFile(fullPath)
|
|
26
26
|
const fileContent = fileContentBuffer.toString()
|
|
27
27
|
const matches = fileContent.matchAll(/#: (.+?)\nmsgid \"(.+?)\"\nmsgstr \"(.+?)\"\n(\n|$)/g)
|
|
File without changes
|