@alauda/doom 0.19.1 → 0.19.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/lib/cli/translate.js +4 -4
- package/package.json +1 -1
package/lib/cli/translate.js
CHANGED
|
@@ -64,8 +64,8 @@ let openai;
|
|
|
64
64
|
const resolveTerms_ = async () => {
|
|
65
65
|
const terms = await fetchApi('https://gitlab-ce.alauda.cn/alauda-public/product-doc-guide/-/raw/main/terms.yaml', { type: 'text' });
|
|
66
66
|
const parsedTerms = parse(terms);
|
|
67
|
-
return ('- 以下是常见的相关术语词汇对应表(English
|
|
68
|
-
parsedTerms.map(({ en, zh = en }) => ` * ${en}
|
|
67
|
+
return ('- 以下是常见的相关术语词汇对应表(English <-> 中文)\n' +
|
|
68
|
+
parsedTerms.map(({ en, zh = en }) => ` * ${en} <-> ${zh}`).join('\n'));
|
|
69
69
|
};
|
|
70
70
|
let termsCache;
|
|
71
71
|
const resolveTerms = async () => {
|
|
@@ -194,8 +194,8 @@ export const translateCommand = new Command('translate')
|
|
|
194
194
|
}
|
|
195
195
|
const executor = async () => await Promise.all([...allSourceFilePaths].map(async (sourceFilePath) => {
|
|
196
196
|
const sourceContent = await fs.readFile(sourceFilePath, 'utf-8');
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
198
|
+
const { sourceSHA: _sourceSHA, ...sourceFrontmatter } = matter(sourceContent).data;
|
|
199
199
|
if (sourceFrontmatter.i18n?.disableAutoTranslation) {
|
|
200
200
|
allSourceFilePaths.delete(sourceFilePath);
|
|
201
201
|
return;
|