@forumulate/cli 0.4.0 → 0.8.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/README.md +116 -5
- package/dist/api/args.d.ts +21 -0
- package/dist/api/args.d.ts.map +1 -0
- package/dist/api/args.js +81 -0
- package/dist/api/args.js.map +1 -0
- package/dist/api/command.d.ts +17 -0
- package/dist/api/command.d.ts.map +1 -0
- package/dist/api/command.js +182 -0
- package/dist/api/command.js.map +1 -0
- package/dist/api/describe.d.ts +5 -0
- package/dist/api/describe.d.ts.map +1 -0
- package/dist/api/describe.js +121 -0
- package/dist/api/describe.js.map +1 -0
- package/dist/api/http.d.ts +81 -0
- package/dist/api/http.d.ts.map +1 -0
- package/dist/api/http.js +183 -0
- package/dist/api/http.js.map +1 -0
- package/dist/api/operations.json +1 -0
- package/dist/api/output.d.ts +35 -0
- package/dist/api/output.d.ts.map +1 -0
- package/dist/api/output.js +176 -0
- package/dist/api/output.js.map +1 -0
- package/dist/api/request.d.ts +37 -0
- package/dist/api/request.d.ts.map +1 -0
- package/dist/api/request.js +230 -0
- package/dist/api/request.js.map +1 -0
- package/dist/api/send.d.ts +35 -0
- package/dist/api/send.d.ts.map +1 -0
- package/dist/api/send.js +85 -0
- package/dist/api/send.js.map +1 -0
- package/dist/api/spec.d.ts +96 -0
- package/dist/api/spec.d.ts.map +1 -0
- package/dist/api/spec.js +126 -0
- package/dist/api/spec.js.map +1 -0
- package/dist/cli.js +12 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/completion.d.ts +12 -0
- package/dist/commands/completion.d.ts.map +1 -0
- package/dist/commands/completion.js +153 -0
- package/dist/commands/completion.js.map +1 -0
- package/dist/commands/config.d.ts +33 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +144 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/context.d.ts +35 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +59 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/groups-api.d.ts +11 -0
- package/dist/commands/groups-api.d.ts.map +1 -0
- package/dist/commands/groups-api.js +140 -0
- package/dist/commands/groups-api.js.map +1 -0
- package/dist/commands/groups-community.d.ts +15 -0
- package/dist/commands/groups-community.d.ts.map +1 -0
- package/dist/commands/groups-community.js +344 -0
- package/dist/commands/groups-community.js.map +1 -0
- package/dist/commands/groups-content.d.ts +10 -0
- package/dist/commands/groups-content.d.ts.map +1 -0
- package/dist/commands/groups-content.js +331 -0
- package/dist/commands/groups-content.js.map +1 -0
- package/dist/commands/groups-docs.d.ts +12 -0
- package/dist/commands/groups-docs.d.ts.map +1 -0
- package/dist/commands/groups-docs.js +414 -0
- package/dist/commands/groups-docs.js.map +1 -0
- package/dist/commands/groups-org.d.ts +10 -0
- package/dist/commands/groups-org.d.ts.map +1 -0
- package/dist/commands/groups-org.js +405 -0
- package/dist/commands/groups-org.js.map +1 -0
- package/dist/commands/groups-site.d.ts +3 -0
- package/dist/commands/groups-site.d.ts.map +1 -0
- package/dist/commands/groups-site.js +230 -0
- package/dist/commands/groups-site.js.map +1 -0
- package/dist/commands/groups-spaces.d.ts +3 -0
- package/dist/commands/groups-spaces.d.ts.map +1 -0
- package/dist/commands/groups-spaces.js +273 -0
- package/dist/commands/groups-spaces.js.map +1 -0
- package/dist/commands/groups-types.d.ts +3 -0
- package/dist/commands/groups-types.d.ts.map +1 -0
- package/dist/commands/groups-types.js +251 -0
- package/dist/commands/groups-types.js.map +1 -0
- package/dist/commands/groups.d.ts +4 -0
- package/dist/commands/groups.d.ts.map +1 -0
- package/dist/commands/groups.js +71 -0
- package/dist/commands/groups.js.map +1 -0
- package/dist/commands/index.d.ts +25 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +118 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/resource.d.ts +86 -0
- package/dist/commands/resource.d.ts.map +1 -0
- package/dist/commands/resource.js +314 -0
- package/dist/commands/resource.js.map +1 -0
- package/dist/content/command.d.ts +34 -0
- package/dist/content/command.d.ts.map +1 -0
- package/dist/content/command.js +225 -0
- package/dist/content/command.js.map +1 -0
- package/dist/content/library.d.ts +23 -0
- package/dist/content/library.d.ts.map +1 -0
- package/dist/content/library.js +41 -0
- package/dist/content/library.js.map +1 -0
- package/dist/content/render.d.ts +15 -0
- package/dist/content/render.d.ts.map +1 -0
- package/dist/content/render.js +85 -0
- package/dist/content/render.js.map +1 -0
- package/dist/content/types-gen.d.ts +40 -0
- package/dist/content/types-gen.d.ts.map +1 -0
- package/dist/content/types-gen.js +200 -0
- package/dist/content/types-gen.js.map +1 -0
- package/dist/help.d.ts +3 -0
- package/dist/help.d.ts.map +1 -0
- package/dist/help.js +142 -0
- package/dist/help.js.map +1 -0
- package/dist/import/coerce.d.ts +34 -0
- package/dist/import/coerce.d.ts.map +1 -0
- package/dist/import/coerce.js +134 -0
- package/dist/import/coerce.js.map +1 -0
- package/dist/import/command.d.ts +25 -0
- package/dist/import/command.d.ts.map +1 -0
- package/dist/import/command.js +127 -0
- package/dist/import/command.js.map +1 -0
- package/dist/import/config.d.ts +39 -0
- package/dist/import/config.d.ts.map +1 -0
- package/dist/import/config.js +48 -0
- package/dist/import/config.js.map +1 -0
- package/dist/import/contentful.d.ts +3 -0
- package/dist/import/contentful.d.ts.map +1 -0
- package/dist/import/contentful.js +179 -0
- package/dist/import/contentful.js.map +1 -0
- package/dist/import/disk.d.ts +4 -0
- package/dist/import/disk.d.ts.map +1 -0
- package/dist/import/disk.js +19 -0
- package/dist/import/disk.js.map +1 -0
- package/dist/import/engine-locales.d.ts +35 -0
- package/dist/import/engine-locales.d.ts.map +1 -0
- package/dist/import/engine-locales.js +61 -0
- package/dist/import/engine-locales.js.map +1 -0
- package/dist/import/engine.d.ts +29 -0
- package/dist/import/engine.d.ts.map +1 -0
- package/dist/import/engine.js +248 -0
- package/dist/import/engine.js.map +1 -0
- package/dist/import/media.d.ts +24 -0
- package/dist/import/media.d.ts.map +1 -0
- package/dist/import/media.js +39 -0
- package/dist/import/media.js.map +1 -0
- package/dist/import/model-fields.d.ts +22 -0
- package/dist/import/model-fields.d.ts.map +1 -0
- package/dist/import/model-fields.js +60 -0
- package/dist/import/model-fields.js.map +1 -0
- package/dist/import/payload/index.d.ts +9 -0
- package/dist/import/payload/index.d.ts.map +1 -0
- package/dist/import/payload/index.js +129 -0
- package/dist/import/payload/index.js.map +1 -0
- package/dist/import/report.d.ts +5 -0
- package/dist/import/report.d.ts.map +1 -0
- package/dist/import/report.js +52 -0
- package/dist/import/report.js.map +1 -0
- package/dist/import/richtext-core.d.ts +26 -0
- package/dist/import/richtext-core.d.ts.map +1 -0
- package/dist/import/richtext-core.js +65 -0
- package/dist/import/richtext-core.js.map +1 -0
- package/dist/import/richtext-html.d.ts +5 -0
- package/dist/import/richtext-html.d.ts.map +1 -0
- package/dist/import/richtext-html.js +311 -0
- package/dist/import/richtext-html.js.map +1 -0
- package/dist/import/richtext-json.d.ts +10 -0
- package/dist/import/richtext-json.d.ts.map +1 -0
- package/dist/import/richtext-json.js +250 -0
- package/dist/import/richtext-json.js.map +1 -0
- package/dist/import/sanity.d.ts +8 -0
- package/dist/import/sanity.d.ts.map +1 -0
- package/dist/import/sanity.js +158 -0
- package/dist/import/sanity.js.map +1 -0
- package/dist/import/strapi-archive.d.ts +6 -0
- package/dist/import/strapi-archive.d.ts.map +1 -0
- package/dist/import/strapi-archive.js +127 -0
- package/dist/import/strapi-archive.js.map +1 -0
- package/dist/import/strapi.d.ts +7 -0
- package/dist/import/strapi.d.ts.map +1 -0
- package/dist/import/strapi.js +185 -0
- package/dist/import/strapi.js.map +1 -0
- package/dist/import/tar.d.ts +3 -0
- package/dist/import/tar.d.ts.map +1 -0
- package/dist/import/tar.js +48 -0
- package/dist/import/tar.js.map +1 -0
- package/dist/import/types.d.ts +157 -0
- package/dist/import/types.d.ts.map +1 -0
- package/dist/import/types.js +12 -0
- package/dist/import/types.js.map +1 -0
- package/dist/import/wordpress.d.ts +15 -0
- package/dist/import/wordpress.d.ts.map +1 -0
- package/dist/import/wordpress.js +147 -0
- package/dist/import/wordpress.js.map +1 -0
- package/dist/publish/scan.d.ts +1 -1
- package/dist/publish/scan.d.ts.map +1 -1
- package/dist/publish/scan.js +2 -2
- package/dist/publish/scan.js.map +1 -1
- package/dist/publish-dir.d.ts +54 -0
- package/dist/publish-dir.d.ts.map +1 -0
- package/dist/publish-dir.js +119 -0
- package/dist/publish-dir.js.map +1 -0
- package/dist/run.d.ts +21 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +70 -65
- package/dist/run.js.map +1 -1
- package/dist/translations/command.d.ts +36 -0
- package/dist/translations/command.d.ts.map +1 -0
- package/dist/translations/command.js +411 -0
- package/dist/translations/command.js.map +1 -0
- package/dist/translations/extras.d.ts +29 -0
- package/dist/translations/extras.d.ts.map +1 -0
- package/dist/translations/extras.js +123 -0
- package/dist/translations/extras.js.map +1 -0
- package/dist/translations/files.d.ts +22 -0
- package/dist/translations/files.d.ts.map +1 -0
- package/dist/translations/files.js +75 -0
- package/dist/translations/files.js.map +1 -0
- package/dist/translations/sync.d.ts +89 -0
- package/dist/translations/sync.d.ts.map +1 -0
- package/dist/translations/sync.js +215 -0
- package/dist/translations/sync.js.map +1 -0
- package/dist/translations/target.d.ts +33 -0
- package/dist/translations/target.d.ts.map +1 -0
- package/dist/translations/target.js +54 -0
- package/dist/translations/target.js.map +1 -0
- package/dist/translations/xliff.d.ts +29 -0
- package/dist/translations/xliff.d.ts.map +1 -0
- package/dist/translations/xliff.js +62 -0
- package/dist/translations/xliff.js.map +1 -0
- package/package.json +6 -4
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stubHash = void 0;
|
|
4
|
+
exports.writeTranslationFile = writeTranslationFile;
|
|
5
|
+
exports.readTranslationFile = readTranslationFile;
|
|
6
|
+
exports.fileStem = fileStem;
|
|
7
|
+
/**
|
|
8
|
+
* One translation as one file: Markdown with front matter.
|
|
9
|
+
*
|
|
10
|
+
* `translations pull` writes `<out>/<locale>/<slug>.md` per piece per
|
|
11
|
+
* language, and `push` reads them back. The front matter says what the file
|
|
12
|
+
* IS (space, piece, language) so a file renamed or moved by a TMS still lands
|
|
13
|
+
* on the right piece, and carries the non-body fields (title, a post's
|
|
14
|
+
* summary, an incident's update texts). `source` is a hash of what was
|
|
15
|
+
* written out for a piece nobody had translated yet: a file still carrying
|
|
16
|
+
* those exact words is a stub, and pushing it would publish English under a
|
|
17
|
+
* Spanish address — so it is skipped, not sent.
|
|
18
|
+
*/
|
|
19
|
+
const node_crypto_1 = require("node:crypto");
|
|
20
|
+
const yaml_1 = require("yaml");
|
|
21
|
+
const frontmatter_1 = require("../publish/frontmatter");
|
|
22
|
+
const stubHash = (title, markdown) => (0, node_crypto_1.createHash)('sha256').update(`${title}\n${markdown.trim()}`).digest('hex').slice(0, 16);
|
|
23
|
+
exports.stubHash = stubHash;
|
|
24
|
+
function writeTranslationFile(f) {
|
|
25
|
+
const front = {
|
|
26
|
+
forumulate: 'translation',
|
|
27
|
+
space: f.space,
|
|
28
|
+
piece: f.piece,
|
|
29
|
+
door: f.door,
|
|
30
|
+
locale: f.locale,
|
|
31
|
+
title: f.title,
|
|
32
|
+
};
|
|
33
|
+
if (f.excerpt !== undefined && f.excerpt !== null)
|
|
34
|
+
front.excerpt = f.excerpt;
|
|
35
|
+
if (f.updates && Object.keys(f.updates).length)
|
|
36
|
+
front.updates = f.updates;
|
|
37
|
+
if (f.published !== undefined)
|
|
38
|
+
front.published = f.published;
|
|
39
|
+
if (f.state)
|
|
40
|
+
front.state = f.state;
|
|
41
|
+
if (f.source)
|
|
42
|
+
front.source = f.source;
|
|
43
|
+
return `---\n${(0, yaml_1.stringify)(front).trimEnd()}\n---\n\n${f.markdown.trim()}\n`;
|
|
44
|
+
}
|
|
45
|
+
/** A pulled file, or null when it is not one of ours (any other Markdown in the folder). */
|
|
46
|
+
function readTranslationFile(text) {
|
|
47
|
+
const { data, body } = (0, frontmatter_1.splitFront)(text);
|
|
48
|
+
if (data.forumulate !== 'translation')
|
|
49
|
+
return null;
|
|
50
|
+
const s = (k) => (typeof data[k] === 'string' ? data[k] : '');
|
|
51
|
+
if (!s('piece') || !s('locale'))
|
|
52
|
+
throw new Error('front matter needs `piece` and `locale`.');
|
|
53
|
+
const updates = data.updates && typeof data.updates === 'object' && !Array.isArray(data.updates)
|
|
54
|
+
? Object.fromEntries(Object.entries(data.updates).map(([k, v]) => [k, String(v ?? '')]))
|
|
55
|
+
: undefined;
|
|
56
|
+
return {
|
|
57
|
+
space: s('space'),
|
|
58
|
+
piece: s('piece'),
|
|
59
|
+
locale: s('locale'),
|
|
60
|
+
door: s('door'),
|
|
61
|
+
title: s('title'),
|
|
62
|
+
markdown: body.trim(),
|
|
63
|
+
excerpt: typeof data.excerpt === 'string' ? data.excerpt : undefined,
|
|
64
|
+
updates,
|
|
65
|
+
published: typeof data.published === 'boolean' ? data.published : undefined,
|
|
66
|
+
state: s('state') || undefined,
|
|
67
|
+
source: s('source') || undefined,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/** A file name a TMS and a filesystem both accept. */
|
|
71
|
+
function fileStem(slug, id) {
|
|
72
|
+
const clean = (slug ?? '').replace(/[^a-zA-Z0-9._-]+/g, '-').replace(/^-+|-+$/g, '');
|
|
73
|
+
return clean || id;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/translations/files.ts"],"names":[],"mappings":";;;AAmCA,oDAeC;AAGD,kDAsBC;AAGD,4BAGC;AAjFD;;;;;;;;;;;GAWG;AACH,6CAAyC;AACzC,+BAAiC;AACjC,wDAAoD;AAkB7C,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,QAAgB,EAAU,EAAE,CAClE,IAAA,wBAAU,E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ACpE,OAAO;QACP,SAAS,EAAE,OAAO,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QAC3E,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,SAAS;QAC9B,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,SAAS;KACjC,CAAC;AACJ,CAAC;AAED,sDAAsD;AACtD,SAAgB,QAAQ,CAAC,IAAmB,EAAE,EAAU;IACtD,MAAM,KAAK,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IACrF,OAAO,KAAK,IAAI,EAAE,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `translations pull | push`, `labels pull | push`, `overrides pull | push`:
|
|
3
|
+
* the file round trips a TMS (or a person with an editor) sits in the middle of.
|
|
4
|
+
*
|
|
5
|
+
* Every push is a diff first: each file is compared with what the API holds
|
|
6
|
+
* now, and only what differs is written — so a second push of the same files
|
|
7
|
+
* writes nothing (idempotent), and `--dry-run` prints exactly what a real push
|
|
8
|
+
* would send.
|
|
9
|
+
*/
|
|
10
|
+
import { type ForumulateClient, type LabelScope, type TranslationCoverage } from '@forumulate/sdk';
|
|
11
|
+
export interface SyncFiles {
|
|
12
|
+
read(path: string): string;
|
|
13
|
+
write(path: string, text: string): void;
|
|
14
|
+
exists(path: string): boolean;
|
|
15
|
+
/** Every file under a folder, recursively, as paths joinable with it. */
|
|
16
|
+
list(dir: string): string[];
|
|
17
|
+
}
|
|
18
|
+
export interface SyncDeps {
|
|
19
|
+
client: ForumulateClient;
|
|
20
|
+
out: (line: string) => void;
|
|
21
|
+
err: (line: string) => void;
|
|
22
|
+
files: SyncFiles;
|
|
23
|
+
}
|
|
24
|
+
/** Write one file per piece per language under `<out>/<locale>/`. */
|
|
25
|
+
export declare function pullPieces(deps: SyncDeps, at: {
|
|
26
|
+
orgId: string;
|
|
27
|
+
spaceId: string;
|
|
28
|
+
}, coverage: TranslationCoverage, opts: {
|
|
29
|
+
out: string;
|
|
30
|
+
locales: string[];
|
|
31
|
+
only?: string[];
|
|
32
|
+
includeMissing: boolean;
|
|
33
|
+
}): Promise<{
|
|
34
|
+
written: string[];
|
|
35
|
+
skipped: number;
|
|
36
|
+
}>;
|
|
37
|
+
export interface PushPlan {
|
|
38
|
+
path: string;
|
|
39
|
+
piece: string;
|
|
40
|
+
locale: string;
|
|
41
|
+
action: 'write' | 'unchanged' | 'stub' | 'other-space';
|
|
42
|
+
fields: string[];
|
|
43
|
+
}
|
|
44
|
+
/** Compare every pulled file under `dir` with the API, then (unless dry) write what differs. */
|
|
45
|
+
export declare function pushPieces(deps: SyncDeps, at: {
|
|
46
|
+
orgId: string;
|
|
47
|
+
spaceId: string;
|
|
48
|
+
}, opts: {
|
|
49
|
+
dir: string;
|
|
50
|
+
locales?: string[];
|
|
51
|
+
dryRun: boolean;
|
|
52
|
+
}): Promise<PushPlan[]>;
|
|
53
|
+
export type TableFormat = 'json' | 'xliff';
|
|
54
|
+
export declare function tableFormat(value: string | undefined, file?: string): TableFormat;
|
|
55
|
+
/** The chrome dictionary, as JSON (`{labels}`) or XLIFF over every owner string. */
|
|
56
|
+
export declare function pullLabels(deps: SyncDeps, orgId: string, scope: LabelScope, opts: {
|
|
57
|
+
format: TableFormat;
|
|
58
|
+
locales?: string[];
|
|
59
|
+
}): Promise<string>;
|
|
60
|
+
/** The words that differ from the dictionary now, as a PATCH body; unchanged words are not sent. */
|
|
61
|
+
export declare function pushLabels(deps: SyncDeps, orgId: string, scope: LabelScope, text: string, opts: {
|
|
62
|
+
format: TableFormat;
|
|
63
|
+
dryRun: boolean;
|
|
64
|
+
}): Promise<{
|
|
65
|
+
changes: {
|
|
66
|
+
locale: string;
|
|
67
|
+
text: string;
|
|
68
|
+
to: unknown;
|
|
69
|
+
}[];
|
|
70
|
+
}>;
|
|
71
|
+
export declare function pullOverrides(deps: SyncDeps, orgId: string, opts: {
|
|
72
|
+
format: TableFormat;
|
|
73
|
+
locales?: string[];
|
|
74
|
+
}): Promise<string>;
|
|
75
|
+
export declare function pushOverrides(deps: SyncDeps, orgId: string, text: string, opts: {
|
|
76
|
+
format: TableFormat;
|
|
77
|
+
dryRun: boolean;
|
|
78
|
+
prune: boolean;
|
|
79
|
+
}): Promise<{
|
|
80
|
+
set: {
|
|
81
|
+
locale: string;
|
|
82
|
+
key: string;
|
|
83
|
+
}[];
|
|
84
|
+
removed: {
|
|
85
|
+
locale: string;
|
|
86
|
+
key: string;
|
|
87
|
+
}[];
|
|
88
|
+
}>;
|
|
89
|
+
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/translations/sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAqB,KAAK,gBAAgB,EAAE,KAAK,UAAU,EAAE,KAAK,mBAAmB,EAAwB,MAAM,iBAAiB,CAAC;AAI5I,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,yEAAyE;IACzE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,gBAAgB,CAAC;IACzB,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,KAAK,EAAE,SAAS,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ineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pullPieces = pullPieces;
|
|
4
|
+
exports.pushPieces = pushPieces;
|
|
5
|
+
exports.tableFormat = tableFormat;
|
|
6
|
+
exports.pullLabels = pullLabels;
|
|
7
|
+
exports.pushLabels = pushLabels;
|
|
8
|
+
exports.pullOverrides = pullOverrides;
|
|
9
|
+
exports.pushOverrides = pushOverrides;
|
|
10
|
+
/**
|
|
11
|
+
* `translations pull | push`, `labels pull | push`, `overrides pull | push`:
|
|
12
|
+
* the file round trips a TMS (or a person with an editor) sits in the middle of.
|
|
13
|
+
*
|
|
14
|
+
* Every push is a diff first: each file is compared with what the API holds
|
|
15
|
+
* now, and only what differs is written — so a second push of the same files
|
|
16
|
+
* writes nothing (idempotent), and `--dry-run` prints exactly what a real push
|
|
17
|
+
* would send.
|
|
18
|
+
*/
|
|
19
|
+
const sdk_1 = require("@forumulate/sdk");
|
|
20
|
+
const files_1 = require("./files");
|
|
21
|
+
const xliff_1 = require("./xliff");
|
|
22
|
+
const join = (a, b) => `${a.replace(/\/+$/, '')}/${b}`;
|
|
23
|
+
/** Write one file per piece per language under `<out>/<locale>/`. */
|
|
24
|
+
async function pullPieces(deps, at, coverage, opts) {
|
|
25
|
+
const t = deps.client.translations;
|
|
26
|
+
const knownDoor = (0, sdk_1.translationDoorOf)(coverage.spaceType);
|
|
27
|
+
const written = [];
|
|
28
|
+
let skipped = 0;
|
|
29
|
+
const used = new Set();
|
|
30
|
+
for (const item of coverage.items) {
|
|
31
|
+
if (opts.only && !opts.only.some((o) => o === item.id || o === item.slug))
|
|
32
|
+
continue;
|
|
33
|
+
let stem = (0, files_1.fileStem)(item.slug, item.id);
|
|
34
|
+
if (used.has(stem))
|
|
35
|
+
stem = `${stem}-${item.id.slice(0, 8)}`;
|
|
36
|
+
used.add(stem);
|
|
37
|
+
for (const locale of opts.locales) {
|
|
38
|
+
const cell = item.locales[locale];
|
|
39
|
+
if (!cell)
|
|
40
|
+
continue;
|
|
41
|
+
const path = join(join(opts.out, locale), `${stem}.md`);
|
|
42
|
+
let file;
|
|
43
|
+
if (cell.state === 'missing' || (knownDoor === 'page' && !cell.id)) {
|
|
44
|
+
if (!opts.includeMissing) {
|
|
45
|
+
skipped += 1;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
// A stub carrying the original, for a translator to replace.
|
|
49
|
+
const { item: src } = await deps.client.request('GET', `/orgs/${at.orgId}/spaces/${at.spaceId}/items/${item.id}`);
|
|
50
|
+
file = {
|
|
51
|
+
space: at.spaceId,
|
|
52
|
+
piece: item.id,
|
|
53
|
+
locale,
|
|
54
|
+
door: knownDoor,
|
|
55
|
+
title: src.title,
|
|
56
|
+
markdown: src.markdown ?? '',
|
|
57
|
+
state: 'missing',
|
|
58
|
+
source: (0, files_1.stubHash)(src.title, src.markdown ?? ''),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const tr = await t.get(at.orgId, at.spaceId, item.id, locale, { door: knownDoor });
|
|
63
|
+
file = {
|
|
64
|
+
space: at.spaceId,
|
|
65
|
+
piece: item.id,
|
|
66
|
+
locale,
|
|
67
|
+
door: tr.door,
|
|
68
|
+
title: tr.title ?? item.title,
|
|
69
|
+
markdown: tr.markdown ?? '',
|
|
70
|
+
excerpt: tr.excerpt ?? undefined,
|
|
71
|
+
updates: tr.updates,
|
|
72
|
+
published: tr.state === 'draft' ? false : tr.door === 'incident' ? undefined : true,
|
|
73
|
+
state: tr.state,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
deps.files.write(path, (0, files_1.writeTranslationFile)(file));
|
|
77
|
+
written.push(path);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return { written, skipped };
|
|
81
|
+
}
|
|
82
|
+
/** Compare every pulled file under `dir` with the API, then (unless dry) write what differs. */
|
|
83
|
+
async function pushPieces(deps, at, opts) {
|
|
84
|
+
const t = deps.client.translations;
|
|
85
|
+
const plans = [];
|
|
86
|
+
for (const path of deps.files.list(opts.dir).filter((p) => p.endsWith('.md')).sort()) {
|
|
87
|
+
const f = (0, files_1.readTranslationFile)(deps.files.read(path));
|
|
88
|
+
if (!f)
|
|
89
|
+
continue;
|
|
90
|
+
if (opts.locales && !opts.locales.includes(f.locale))
|
|
91
|
+
continue;
|
|
92
|
+
const plan = { path, piece: f.piece, locale: f.locale, action: 'unchanged', fields: [] };
|
|
93
|
+
plans.push(plan);
|
|
94
|
+
if (f.space && f.space !== at.spaceId) {
|
|
95
|
+
plan.action = 'other-space';
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (f.source && f.source === (0, files_1.stubHash)(f.title, f.markdown)) {
|
|
99
|
+
plan.action = 'stub';
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const door = (f.door || undefined);
|
|
103
|
+
const now = await t.get(at.orgId, at.spaceId, f.piece, f.locale, { door });
|
|
104
|
+
if ((now.title ?? '') !== f.title)
|
|
105
|
+
plan.fields.push('title');
|
|
106
|
+
if ((now.markdown ?? '').trim() !== f.markdown.trim())
|
|
107
|
+
plan.fields.push('markdown');
|
|
108
|
+
if (f.excerpt !== undefined && (now.excerpt ?? '') !== f.excerpt)
|
|
109
|
+
plan.fields.push('excerpt');
|
|
110
|
+
if (f.updates && JSON.stringify(now.updates ?? {}) !== JSON.stringify({ ...(now.updates ?? {}), ...f.updates }))
|
|
111
|
+
plan.fields.push('updates');
|
|
112
|
+
if (f.published === true && now.state === 'draft')
|
|
113
|
+
plan.fields.push('published');
|
|
114
|
+
if (!plan.fields.length)
|
|
115
|
+
continue;
|
|
116
|
+
plan.action = 'write';
|
|
117
|
+
if (opts.dryRun)
|
|
118
|
+
continue;
|
|
119
|
+
await t.put(at.orgId, at.spaceId, f.piece, f.locale, {
|
|
120
|
+
// A topic's PUT replaces the translation (title required); a page's
|
|
121
|
+
// title is its own PATCH, sent only when it changed.
|
|
122
|
+
title: now.door === 'page' && !plan.fields.includes('title') ? undefined : f.title,
|
|
123
|
+
markdown: plan.fields.includes('markdown') || now.door !== 'page' ? f.markdown : undefined,
|
|
124
|
+
excerpt: f.excerpt,
|
|
125
|
+
updates: f.updates,
|
|
126
|
+
published: f.published,
|
|
127
|
+
}, { door: now.door });
|
|
128
|
+
}
|
|
129
|
+
return plans;
|
|
130
|
+
}
|
|
131
|
+
function tableFormat(value, file) {
|
|
132
|
+
if (value === 'json' || value === 'xliff')
|
|
133
|
+
return value;
|
|
134
|
+
if (value !== undefined)
|
|
135
|
+
throw new Error(`--format is json or xliff, not "${value}".`);
|
|
136
|
+
return file && /\.(xlf|xliff)$/i.test(file) ? 'xliff' : 'json';
|
|
137
|
+
}
|
|
138
|
+
/** The chrome dictionary, as JSON (`{labels}`) or XLIFF over every owner string. */
|
|
139
|
+
async function pullLabels(deps, orgId, scope, opts) {
|
|
140
|
+
const listing = await deps.client.translations.labels.strings(orgId, scope);
|
|
141
|
+
const locales = opts.locales ?? listing.languages;
|
|
142
|
+
if (opts.format === 'json') {
|
|
143
|
+
const labels = Object.fromEntries(Object.entries(listing.labels).filter(([l]) => locales.includes(l)));
|
|
144
|
+
return `${JSON.stringify({ labels }, null, 2)}\n`;
|
|
145
|
+
}
|
|
146
|
+
const rows = listing.strings;
|
|
147
|
+
const files = locales.map((locale) => ({
|
|
148
|
+
locale,
|
|
149
|
+
units: rows.map((r) => ({ id: r.text, source: r.text, target: typeof r.dictionary[locale] === 'string' ? r.dictionary[locale] : '' })),
|
|
150
|
+
}));
|
|
151
|
+
return (0, xliff_1.toXliff)(files, { original: 'labels' });
|
|
152
|
+
}
|
|
153
|
+
/** The words that differ from the dictionary now, as a PATCH body; unchanged words are not sent. */
|
|
154
|
+
async function pushLabels(deps, orgId, scope, text, opts) {
|
|
155
|
+
const listing = await deps.client.translations.labels.strings(orgId, scope);
|
|
156
|
+
const incoming = opts.format === 'json'
|
|
157
|
+
? (JSON.parse(text).labels ?? {})
|
|
158
|
+
: Object.fromEntries((0, xliff_1.fromXliff)(text).map((f) => [f.locale, Object.fromEntries(f.units.filter((u) => u.target.trim()).map((u) => [u.id, u.target]))]));
|
|
159
|
+
const changes = [];
|
|
160
|
+
const patch = {};
|
|
161
|
+
for (const [locale, words] of Object.entries(incoming)) {
|
|
162
|
+
for (const [original, to] of Object.entries(words ?? {})) {
|
|
163
|
+
const now = listing.labels[locale]?.[original];
|
|
164
|
+
if (JSON.stringify(now) === JSON.stringify(to))
|
|
165
|
+
continue;
|
|
166
|
+
changes.push({ locale, text: original, to });
|
|
167
|
+
(patch[locale] ??= {})[original] = to;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (changes.length && !opts.dryRun)
|
|
171
|
+
await deps.client.translations.labels.merge(orgId, scope, patch);
|
|
172
|
+
return { changes };
|
|
173
|
+
}
|
|
174
|
+
async function pullOverrides(deps, orgId, opts) {
|
|
175
|
+
const { overrides } = await deps.client.translations.overrides.list(orgId);
|
|
176
|
+
const byLocale = {};
|
|
177
|
+
for (const o of overrides)
|
|
178
|
+
if (!opts.locales || opts.locales.includes(o.locale))
|
|
179
|
+
(byLocale[o.locale] ??= {})[o.key] = o.value;
|
|
180
|
+
if (opts.format === 'json')
|
|
181
|
+
return `${JSON.stringify({ overrides: byLocale }, null, 2)}\n`;
|
|
182
|
+
// The English each key replaces, so the TMS shows the translator the source.
|
|
183
|
+
const { catalog } = await deps.client.translations.overrides.catalog(orgId).catch(() => ({ catalog: {} }));
|
|
184
|
+
const locales = opts.locales ?? Object.keys(byLocale);
|
|
185
|
+
return (0, xliff_1.toXliff)(locales.map((locale) => ({
|
|
186
|
+
locale,
|
|
187
|
+
units: Object.entries(byLocale[locale] ?? {}).map(([key, value]) => ({ id: key, source: catalog[key] ?? key, target: value })),
|
|
188
|
+
})), { original: 'translation-overrides' });
|
|
189
|
+
}
|
|
190
|
+
async function pushOverrides(deps, orgId, text, opts) {
|
|
191
|
+
const { overrides } = await deps.client.translations.overrides.list(orgId);
|
|
192
|
+
const incoming = opts.format === 'json'
|
|
193
|
+
? (JSON.parse(text).overrides ?? {})
|
|
194
|
+
: Object.fromEntries((0, xliff_1.fromXliff)(text).map((f) => [f.locale, Object.fromEntries(f.units.filter((u) => u.target.trim()).map((u) => [u.id, u.target]))]));
|
|
195
|
+
const set = [];
|
|
196
|
+
const removed = [];
|
|
197
|
+
for (const [locale, keys] of Object.entries(incoming))
|
|
198
|
+
for (const [key, value] of Object.entries(keys ?? {})) {
|
|
199
|
+
if (overrides.some((o) => o.locale === locale && o.key === key && o.value === value))
|
|
200
|
+
continue;
|
|
201
|
+
set.push({ locale, key });
|
|
202
|
+
if (!opts.dryRun)
|
|
203
|
+
await deps.client.translations.overrides.set(orgId, { locale, key, value: String(value) });
|
|
204
|
+
}
|
|
205
|
+
if (opts.prune)
|
|
206
|
+
for (const o of overrides) {
|
|
207
|
+
if (incoming[o.locale]?.[o.key] !== undefined)
|
|
208
|
+
continue;
|
|
209
|
+
removed.push({ locale: o.locale, key: o.key });
|
|
210
|
+
if (!opts.dryRun)
|
|
211
|
+
await deps.client.translations.overrides.remove(orgId, { locale: o.locale, key: o.key });
|
|
212
|
+
}
|
|
213
|
+
return { set, removed };
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/translations/sync.ts"],"names":[],"mappings":";;AA+BA,gCA6DC;AAWD,gCAkDC;AAID,kCAIC;AAGD,gCAkBC;AAGD,gCA0BC;AAED,sCAmBC;AAED,sCA4BC;AAtQD;;;;;;;;GAQG;AACH,yCAA4I;AAC5I,mCAA8G;AAC9G,mCAA6D;AAiB7D,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;AAEvE,qEAAqE;AAC9D,KAAK,UAAU,UAAU,CAC9B,IAAc,EACd,EAAsC,EACtC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,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC/G,CAAC;IACH,IAAI,IAAI,CAAC,KAAK;QACZ,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE,CAAC;YAC1B,IAAI,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,SAAS;gBAAE,SAAS;YACxD,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;YAC/C,IAAI,CAAC,IAAI,CAAC,MAAM;gBAAE,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;QAC7G,CAAC;IACH,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which space, library or site a `forumulate translations` command means.
|
|
3
|
+
*
|
|
4
|
+
* A person types a slug (`--space docs`); the API wants ids. Like the content
|
|
5
|
+
* commands' library rule (`content/library.ts`): the org is optional, an
|
|
6
|
+
* ambiguous slug is refused with the orgs named, never guessed.
|
|
7
|
+
*/
|
|
8
|
+
import type { ForumulateClient, LocaleTarget } from '@forumulate/sdk';
|
|
9
|
+
import { TargetError } from '../content/library';
|
|
10
|
+
export { TargetError };
|
|
11
|
+
export interface SpaceTarget {
|
|
12
|
+
orgId: string;
|
|
13
|
+
spaceId: string;
|
|
14
|
+
name: string;
|
|
15
|
+
type: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function resolveSpace(client: ForumulateClient, want: {
|
|
18
|
+
org?: string;
|
|
19
|
+
space?: string;
|
|
20
|
+
}): Promise<SpaceTarget>;
|
|
21
|
+
/** `--space` or `--library` — the two things that declare languages. */
|
|
22
|
+
export declare function resolveLocaleTarget(client: ForumulateClient, want: {
|
|
23
|
+
org?: string;
|
|
24
|
+
space?: string;
|
|
25
|
+
library?: string;
|
|
26
|
+
}): Promise<{
|
|
27
|
+
orgId: string;
|
|
28
|
+
target: LocaleTarget;
|
|
29
|
+
name: string;
|
|
30
|
+
}>;
|
|
31
|
+
/** The org alone (`overrides`), from --org or the only one the caller has. */
|
|
32
|
+
export declare function resolveOrg(client: ForumulateClient, org?: string): Promise<string>;
|
|
33
|
+
//# sourceMappingURL=target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../src/translations/target.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAS,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAA2B,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EAAE,WAAW,EAAE,CAAC;AAIvB,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAsB,YAAY,CAChC,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACrC,OAAO,CAAC,WAAW,CAAC,CAmBtB;AAED,wEAAwE;AACxE,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACvD,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAQhE;AAED,8EAA8E;AAC9E,wBAAsB,UAAU,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAKxF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TargetError = void 0;
|
|
4
|
+
exports.resolveSpace = resolveSpace;
|
|
5
|
+
exports.resolveLocaleTarget = resolveLocaleTarget;
|
|
6
|
+
exports.resolveOrg = resolveOrg;
|
|
7
|
+
const library_1 = require("../content/library");
|
|
8
|
+
Object.defineProperty(exports, "TargetError", { enumerable: true, get: function () { return library_1.TargetError; } });
|
|
9
|
+
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
10
|
+
async function resolveSpace(client, want) {
|
|
11
|
+
if (!want.space)
|
|
12
|
+
throw new library_1.TargetError('Say which space: --space <id|slug> (or FORUMULATE_SPACE).');
|
|
13
|
+
const space = want.space;
|
|
14
|
+
const orgIds = want.org
|
|
15
|
+
? [await (0, library_1.orgIdOf)(client, want.org)]
|
|
16
|
+
: (await client.orgs.list()).orgs.map((o) => o.id);
|
|
17
|
+
const hits = [];
|
|
18
|
+
for (const orgId of orgIds) {
|
|
19
|
+
const listed = await client.spaces.list(orgId).catch(() => ({ spaces: [] }));
|
|
20
|
+
for (const s of listed.spaces)
|
|
21
|
+
if (s.id === space || s.slug === space)
|
|
22
|
+
hits.push({ orgId, spaceId: s.id, name: s.name, type: s.type });
|
|
23
|
+
}
|
|
24
|
+
if (hits.length === 1)
|
|
25
|
+
return hits[0];
|
|
26
|
+
if (!hits.length) {
|
|
27
|
+
// An id in an org the listing could not reach (a confined token) is still addressable.
|
|
28
|
+
if (UUID.test(space) && want.org)
|
|
29
|
+
return { orgId: await (0, library_1.orgIdOf)(client, want.org), spaceId: space, name: space, type: '' };
|
|
30
|
+
throw new library_1.TargetError(`No space "${space}"${want.org ? ` in ${want.org}` : ' in any of your organizations'}.`);
|
|
31
|
+
}
|
|
32
|
+
throw new library_1.TargetError(`"${space}" names a space in ${hits.length} organizations (${hits.map((h) => h.orgId).join(', ')}); add --org.`);
|
|
33
|
+
}
|
|
34
|
+
/** `--space` or `--library` — the two things that declare languages. */
|
|
35
|
+
async function resolveLocaleTarget(client, want) {
|
|
36
|
+
if (want.library && !want.space) {
|
|
37
|
+
const lib = await (0, library_1.resolveLibrary)(client, { org: want.org, library: want.library });
|
|
38
|
+
return { orgId: lib.orgId, target: { libraryId: lib.libraryId }, name: lib.name };
|
|
39
|
+
}
|
|
40
|
+
if (!want.space)
|
|
41
|
+
throw new library_1.TargetError('Say which space or library: --space <id|slug> or --library <id|slug>.');
|
|
42
|
+
const s = await resolveSpace(client, want);
|
|
43
|
+
return { orgId: s.orgId, target: { spaceId: s.spaceId }, name: s.name };
|
|
44
|
+
}
|
|
45
|
+
/** The org alone (`overrides`), from --org or the only one the caller has. */
|
|
46
|
+
async function resolveOrg(client, org) {
|
|
47
|
+
if (org)
|
|
48
|
+
return (0, library_1.orgIdOf)(client, org);
|
|
49
|
+
const { orgs } = await client.orgs.list();
|
|
50
|
+
if (orgs.length === 1)
|
|
51
|
+
return orgs[0].id;
|
|
52
|
+
throw new library_1.TargetError(`Say which organization: --org <id|slug> (you have ${orgs.length}).`);
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target.js","sourceRoot":"","sources":["../../src/translations/target.ts"],"names":[],"mappings":";;;AAqBA,oCAsBC;AAGD,kDAWC;AAGD,gCAKC;AAzDD,gDA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CAAC,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC3C,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AAC1E,CAAC;AAED,8EAA8E;AACvE,KAAK,UAAU,UAAU,CAAC,MAAwB,EAAE,GAAY;IACrE,IAAI,GAAG;QAAE,OAAO,IAAA,iBAAO,EAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAC1C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC;IAC1C,MAAM,IAAI,qBAAW,CAAC,qDAAqD,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;AAC9F,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* XLIFF 1.2 for the two string tables (chrome labels, UI overrides).
|
|
3
|
+
*
|
|
4
|
+
* Every translation management system a customer already pays for (Crowdin,
|
|
5
|
+
* Lokalise, Phrase, Smartling) imports and exports XLIFF; none of them reads
|
|
6
|
+
* our label dictionary's JSON. One `<file>` per target language, one
|
|
7
|
+
* `<trans-unit>` per string: `id` is the key (the original words for a label,
|
|
8
|
+
* the catalog key for an override), `<source>` what it replaces, `<target>`
|
|
9
|
+
* the language's words — empty when nobody has translated it yet, so the TMS
|
|
10
|
+
* shows it as work to do. Small and dependency-free on purpose: the CLI ships
|
|
11
|
+
* with two dependencies and a parser for one well-known dialect is not a third.
|
|
12
|
+
*/
|
|
13
|
+
export interface XliffUnit {
|
|
14
|
+
id: string;
|
|
15
|
+
source: string;
|
|
16
|
+
target: string;
|
|
17
|
+
}
|
|
18
|
+
export interface XliffFile {
|
|
19
|
+
/** The target language code (`es`, `pt-BR`). */
|
|
20
|
+
locale: string;
|
|
21
|
+
units: XliffUnit[];
|
|
22
|
+
}
|
|
23
|
+
export declare function toXliff(files: XliffFile[], opts: {
|
|
24
|
+
original: string;
|
|
25
|
+
sourceLanguage?: string;
|
|
26
|
+
}): string;
|
|
27
|
+
/** Every `<file>` and its units. An empty `<target>` is kept as `''` (untranslated). */
|
|
28
|
+
export declare function fromXliff(xml: string): XliffFile[];
|
|
29
|
+
//# sourceMappingURL=xliff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xliff.d.ts","sourceRoot":"","sources":["../../src/translations/xliff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB;AAcD,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAmBvG;AAED,wFAAwF;AACxF,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,CAmBlD"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* XLIFF 1.2 for the two string tables (chrome labels, UI overrides).
|
|
4
|
+
*
|
|
5
|
+
* Every translation management system a customer already pays for (Crowdin,
|
|
6
|
+
* Lokalise, Phrase, Smartling) imports and exports XLIFF; none of them reads
|
|
7
|
+
* our label dictionary's JSON. One `<file>` per target language, one
|
|
8
|
+
* `<trans-unit>` per string: `id` is the key (the original words for a label,
|
|
9
|
+
* the catalog key for an override), `<source>` what it replaces, `<target>`
|
|
10
|
+
* the language's words — empty when nobody has translated it yet, so the TMS
|
|
11
|
+
* shows it as work to do. Small and dependency-free on purpose: the CLI ships
|
|
12
|
+
* with two dependencies and a parser for one well-known dialect is not a third.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.toXliff = toXliff;
|
|
16
|
+
exports.fromXliff = fromXliff;
|
|
17
|
+
const esc = (s) => s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|
18
|
+
const unesc = (s) => s
|
|
19
|
+
.replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g, '$1')
|
|
20
|
+
.replace(/</g, '<')
|
|
21
|
+
.replace(/>/g, '>')
|
|
22
|
+
.replace(/"/g, '"')
|
|
23
|
+
.replace(/'/g, "'")
|
|
24
|
+
.replace(/&#(\d+);/g, (_, n) => String.fromCodePoint(Number(n)))
|
|
25
|
+
.replace(/&/g, '&');
|
|
26
|
+
function toXliff(files, opts) {
|
|
27
|
+
const out = ['<?xml version="1.0" encoding="UTF-8"?>', '<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">'];
|
|
28
|
+
for (const f of files) {
|
|
29
|
+
out.push(` <file original="${esc(opts.original)}" source-language="${esc(opts.sourceLanguage ?? 'en')}" target-language="${esc(f.locale)}" datatype="plaintext">`, ' <body>');
|
|
30
|
+
for (const u of f.units) {
|
|
31
|
+
out.push(` <trans-unit id="${esc(u.id)}">`, ` <source>${esc(u.source)}</source>`, ` <target>${esc(u.target)}</target>`, ' </trans-unit>');
|
|
32
|
+
}
|
|
33
|
+
out.push(' </body>', ' </file>');
|
|
34
|
+
}
|
|
35
|
+
out.push('</xliff>', '');
|
|
36
|
+
return out.join('\n');
|
|
37
|
+
}
|
|
38
|
+
/** Every `<file>` and its units. An empty `<target>` is kept as `''` (untranslated). */
|
|
39
|
+
function fromXliff(xml) {
|
|
40
|
+
const files = [];
|
|
41
|
+
for (const f of xml.matchAll(/<file\b([^>]*)>([\s\S]*?)<\/file>/g)) {
|
|
42
|
+
const attrs = f[1] ?? '';
|
|
43
|
+
const locale = /target-language="([^"]*)"/.exec(attrs)?.[1];
|
|
44
|
+
if (!locale)
|
|
45
|
+
throw new Error('An XLIFF <file> has no target-language.');
|
|
46
|
+
const units = [];
|
|
47
|
+
for (const u of (f[2] ?? '').matchAll(/<trans-unit\b([^>]*)>([\s\S]*?)<\/trans-unit>/g)) {
|
|
48
|
+
const id = /\bid="([^"]*)"/.exec(u[1] ?? '')?.[1];
|
|
49
|
+
if (id === undefined)
|
|
50
|
+
continue;
|
|
51
|
+
const inner = u[2] ?? '';
|
|
52
|
+
const source = /<source\b[^>]*>([\s\S]*?)<\/source>/.exec(inner)?.[1] ?? '';
|
|
53
|
+
const target = /<target\b[^>]*>([\s\S]*?)<\/target>/.exec(inner)?.[1] ?? '';
|
|
54
|
+
units.push({ id: unesc(id), source: unesc(source), target: unesc(target) });
|
|
55
|
+
}
|
|
56
|
+
files.push({ locale: unesc(locale), units });
|
|
57
|
+
}
|
|
58
|
+
if (!files.length)
|
|
59
|
+
throw new Error('No XLIFF <file> elements found.');
|
|
60
|
+
return files;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=xliff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xliff.js","sourceRoot":"","sources":["../../src/translations/xliff.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;AA0BH,0BAmBC;AAGD,8BAmBC;AArDD,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CACxB,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,C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