Skip to content

Commit

Permalink
refactor: { Java 运行时 => Java Runtime }
Browse files Browse the repository at this point in the history
  • Loading branch information
bluelovers committed Mar 5, 2022
1 parent ba53d1d commit 147c915
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/handleText.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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
})
}
1 change: 1 addition & 0 deletions test/handle-text.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const tests = _handleTestsSetting([
], `縮小`, true,
],
[`messages/ActionsBundle.properties`, `縮小`],
[`messages/IdeBundle.properties`, [`Java 運行時`, `Java 執行時`], true],
]);

/**
Expand Down

0 comments on commit 147c915

Please sign in to comment.