@intlayer/sync-po-plugin 9.0.0-canary.13 → 9.0.0-canary.15
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/dist/cjs/index.cjs +12 -4
- package/dist/cjs/loadPO.cjs +20 -99
- package/dist/cjs/loadPO.cjs.map +1 -1
- package/dist/cjs/poFormat.cjs +86 -0
- package/dist/cjs/poFormat.cjs.map +1 -0
- package/dist/cjs/syncPO.cjs +25 -241
- package/dist/cjs/syncPO.cjs.map +1 -1
- package/dist/esm/index.mjs +3 -2
- package/dist/esm/loadPO.mjs +20 -97
- package/dist/esm/loadPO.mjs.map +1 -1
- package/dist/esm/poFormat.mjs +82 -0
- package/dist/esm/poFormat.mjs.map +1 -0
- package/dist/esm/syncPO.mjs +17 -236
- package/dist/esm/syncPO.mjs.map +1 -1
- package/dist/types/index.d.ts +4 -3
- package/dist/types/loadPO.d.ts +5 -1
- package/dist/types/loadPO.d.ts.map +1 -1
- package/dist/types/poFormat.d.ts +21 -0
- package/dist/types/poFormat.d.ts.map +1 -0
- package/dist/types/syncPO.d.ts +7 -16
- package/dist/types/syncPO.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/types/syncPO.d.ts
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { parsePO, serializePO } from "./poFormat.js";
|
|
2
2
|
import { FilePathPattern } from "@intlayer/types/filePathPattern";
|
|
3
3
|
import { Plugin } from "@intlayer/types/plugin";
|
|
4
|
+
import { extractKeyAndLocaleFromPath } from "@intlayer/engine/syncPluginKit";
|
|
4
5
|
import { DictionaryLocation } from "@intlayer/types/dictionary";
|
|
5
6
|
|
|
6
7
|
//#region src/syncPO.d.ts
|
|
7
|
-
declare const extractKeyAndLocaleFromPath: (filePath: string, maskPattern: string, locales: Locale[], defaultLocale: Locale) => {
|
|
8
|
-
key: string;
|
|
9
|
-
locale: Locale;
|
|
10
|
-
} | null;
|
|
11
|
-
/**
|
|
12
|
-
* Parse a PO file string into a flat msgid → msgstr record.
|
|
13
|
-
* Skips the PO header (msgid ""), comment lines, and plural/context keywords.
|
|
14
|
-
*/
|
|
15
|
-
declare const parsePO: (fileContent: string) => Record<string, string>;
|
|
16
|
-
/**
|
|
17
|
-
* Serialize a flat key → value record to PO file format.
|
|
18
|
-
* Non-string values are silently skipped.
|
|
19
|
-
*/
|
|
20
|
-
declare const serializePO: (content: Record<string, unknown>, locale?: string) => string;
|
|
21
8
|
type SyncPOPluginOptions = {
|
|
22
9
|
/**
|
|
23
10
|
* The source of the plugin.
|
|
@@ -58,7 +45,11 @@ type SyncPOPluginOptions = {
|
|
|
58
45
|
*/
|
|
59
46
|
priority?: number;
|
|
60
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* Two-way PO synchronization plugin: ingests gettext PO files as dictionaries
|
|
50
|
+
* and writes the merged build output back to the same files.
|
|
51
|
+
*/
|
|
61
52
|
declare const syncPO: (options: SyncPOPluginOptions) => Promise<Plugin>;
|
|
62
53
|
//#endregion
|
|
63
|
-
export { extractKeyAndLocaleFromPath, parsePO, serializePO, syncPO };
|
|
54
|
+
export { SyncPOPluginOptions, extractKeyAndLocaleFromPath, parsePO, serializePO, syncPO };
|
|
64
55
|
//# sourceMappingURL=syncPO.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syncPO.d.ts","names":[],"sources":["../../src/syncPO.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"syncPO.d.ts","names":[],"sources":["../../src/syncPO.ts"],"mappings":";;;;;;;KAeY,mBAAA;;AAAZ;;;;;;;;;EAWE,MAAA,EAAQ,eAAA;EA6BA;AAOV;;;;;;;;;;;;;;;;;EAhBE,QAAA,GAAW,kBAAA;;;;;;;;EASX,QAAA;AAAA;;;;;cAOW,MAAA,GAAgB,OAAA,EAAS,mBAAA,KAAsB,OAAA,CAAQ,MAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/sync-po-plugin",
|
|
3
|
-
"version": "9.0.0-canary.
|
|
3
|
+
"version": "9.0.0-canary.15",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A plugin for Intlayer that syncs Portable Object (.po) files to dictionaries.",
|
|
6
6
|
"keywords": [
|
|
@@ -72,10 +72,10 @@
|
|
|
72
72
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@intlayer/config": "9.0.0-canary.
|
|
76
|
-
"@intlayer/core": "9.0.0-canary.
|
|
77
|
-
"@intlayer/engine": "9.0.0-canary.
|
|
78
|
-
"@intlayer/types": "9.0.0-canary.
|
|
75
|
+
"@intlayer/config": "9.0.0-canary.15",
|
|
76
|
+
"@intlayer/core": "9.0.0-canary.15",
|
|
77
|
+
"@intlayer/engine": "9.0.0-canary.15",
|
|
78
|
+
"@intlayer/types": "9.0.0-canary.15",
|
|
79
79
|
"fast-glob": "3.3.3"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|