-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconstants.ts
More file actions
57 lines (51 loc) · 2.1 KB
/
constants.ts
File metadata and controls
57 lines (51 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import url from 'node:url'
import path from 'node:path'
const __dirname = path.dirname(url.fileURLToPath(import.meta.url))
export const ROOT_DIR = path.resolve(__dirname, '..')
export enum DocumentType {
MARKDOWN = '.md',
JSON = '.json',
}
export const DOCUMENT_LABELS = {
[DocumentType.MARKDOWN]: 'Markdown',
[DocumentType.JSON]: 'JSON'
}
export const TRANSLATABLE_EXTENSIONS = ['.md', '.json']
export const TRANSLATION_INSTRUCTIONS = {
[DocumentType.MARKDOWN]: [
'The document is a Docusaurus documentation page and separated in frontmatter and body.',
'The frontmatter is the first block of the document, and the body is the rest of the document.',
'Only translate the "title" and "description" fields in the frontmatter.',
'In the body: keep all Markdown formatting intact, don\'t add any headings if they don\'t exist in the original content',
'Also ignore any links, code blocks (except comments), and other syntax within tick characters (`).',
'Do not translate code inside code blocks, variable names, or technical terms that should remain in English.',
'Do not translate HTML tags or attributes.',
'Do not change URLs.',
'Do not change Markdown image references. Keep the entire image syntax exactly as-is, including the file path/URL. For example, `` must remain unchanged — do not translate the alt text or modify the path.',
].join('\n'),
[DocumentType.JSON]: [
'The document is a JSON file that contains documentation for a WebdriverIO project.',
'Only translate the value behind the "message" property, nothing else.',
'Do not change any keys.',
].join('\n'),
}
export const LANGUAGES_TO_TRANSLATE = {
ar: 'Arabic',
de: 'German',
es: 'Spanish',
fa: 'Persian',
fr: 'French',
hi: 'Hindi',
it: 'Italian',
ja: 'Japanese',
el: 'Greek',
pl: 'Polish',
pt: 'Portuguese',
ru: 'Russian',
sv: 'Swedish',
ta: 'Tamil',
uk: 'Ukrainian',
zh: 'Chinese',
vi: 'Vietnamese',
ko: 'Korean'
} as const;