@gjsify/vite-plugin-gettext 0.25.1 → 0.26.0
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/lib/gettext.js +4 -2
- package/lib/msgfmt.js +4 -2
- package/lib/po2json.js +4 -2
- package/package.json +1 -1
package/lib/gettext.js
CHANGED
|
@@ -13,13 +13,15 @@ export function gettextPlugin(options) {
|
|
|
13
13
|
const pluginName = 'vite-plugin-gettext';
|
|
14
14
|
async function compileMoFiles() {
|
|
15
15
|
try {
|
|
16
|
-
//
|
|
16
|
+
// Ensure the PO directory exists (mkdir -p — a missing directory
|
|
17
|
+
// is CREATED, not an error); only EACCES/ENOTDIR-class failures
|
|
18
|
+
// can land in the catch.
|
|
17
19
|
try {
|
|
18
20
|
await ensureDirectory(poDirectory);
|
|
19
21
|
}
|
|
20
22
|
catch {
|
|
21
23
|
if (verbose) {
|
|
22
|
-
console.log(`[${pluginName}] PO directory ${poDirectory}
|
|
24
|
+
console.log(`[${pluginName}] PO directory ${poDirectory} not creatable, skipping compilation`);
|
|
23
25
|
}
|
|
24
26
|
return;
|
|
25
27
|
}
|
package/lib/msgfmt.js
CHANGED
|
@@ -65,13 +65,15 @@ export function msgfmtPlugin(options) {
|
|
|
65
65
|
const pluginName = 'vite-plugin-msgfmt';
|
|
66
66
|
async function compilePoFiles() {
|
|
67
67
|
try {
|
|
68
|
-
//
|
|
68
|
+
// Ensure the PO directory exists (mkdir -p — a missing directory
|
|
69
|
+
// is CREATED, not an error); only EACCES/ENOTDIR-class failures
|
|
70
|
+
// can land in the catch.
|
|
69
71
|
try {
|
|
70
72
|
await ensureDirectory(poDirectory);
|
|
71
73
|
}
|
|
72
74
|
catch {
|
|
73
75
|
if (verbose) {
|
|
74
|
-
console.log(`[${pluginName}] PO directory ${poDirectory}
|
|
76
|
+
console.log(`[${pluginName}] PO directory ${poDirectory} not creatable, skipping compilation`);
|
|
75
77
|
}
|
|
76
78
|
return;
|
|
77
79
|
}
|
package/lib/po2json.js
CHANGED
|
@@ -86,13 +86,15 @@ export function po2jsonPlugin(options) {
|
|
|
86
86
|
const pluginName = 'vite-plugin-gettext-po2json';
|
|
87
87
|
async function convertPoToJson() {
|
|
88
88
|
try {
|
|
89
|
-
//
|
|
89
|
+
// Ensure the PO directory exists (mkdir -p — a missing directory
|
|
90
|
+
// is CREATED, not an error); only EACCES/ENOTDIR-class failures
|
|
91
|
+
// can land in the catch.
|
|
90
92
|
try {
|
|
91
93
|
await ensureDirectory(poDirectory);
|
|
92
94
|
}
|
|
93
95
|
catch {
|
|
94
96
|
if (verbose) {
|
|
95
|
-
console.log(`[${pluginName}] PO directory ${poDirectory}
|
|
97
|
+
console.log(`[${pluginName}] PO directory ${poDirectory} not creatable, skipping conversion`);
|
|
96
98
|
}
|
|
97
99
|
return;
|
|
98
100
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/vite-plugin-gettext",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"description": "Gettext PO/MO/JSON pipeline for Vite / Rollup / Rolldown — extract via xgettext, compile via msgfmt, JSON for browser targets.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|