diff --git a/lib/handleText.ts b/lib/handleText.ts index 11c691848..f67124725 100644 --- a/lib/handleText.ts +++ b/lib/handleText.ts @@ -1,6 +1,7 @@ import { processIdeaSegmentText } from './segment'; import { updateMeta } from './meta'; import { textToRegexp } from './util/text-to-regexp'; +import { textIncludeCJK } from './util/include-cjk'; export function handleText(content_old: string, info?: { file?: string, @@ -36,6 +37,18 @@ export function handleText(content_old: string, info?: { ; } + content_new = content_new + .replace(textToRegexp(/Java (?:运|執)行时(.)?/g), ($0, $1) => { + + if (textIncludeCJK($1)) + { + $1 = ' ' + $1; + } + + return 'Java Runtime' + $1 + }) + ; + return content_new }) } diff --git a/test/handle-text.spec.ts b/test/handle-text.spec.ts index a348c4b87..d38affee4 100644 --- a/test/handle-text.spec.ts +++ b/test/handle-text.spec.ts @@ -44,6 +44,7 @@ const tests = _handleTestsSetting([ ], `縮小`, true, ], [`messages/ActionsBundle.properties`, `縮小`], + [`messages/IdeBundle.properties`, [`Java 運行時`, `Java 執行時`], true], ]); /**