Skip to content

Commit

Permalink
feat: 增加排序整理字典檔案
Browse files Browse the repository at this point in the history
  • Loading branch information
bluelovers committed Jan 19, 2022
1 parent 91c7e0e commit 0a1d828
Show file tree
Hide file tree
Showing 8 changed files with 182 additions and 103 deletions.
75 changes: 29 additions & 46 deletions lib/static/lazy.properties
Original file line number Diff line number Diff line change
@@ -1,55 +1,38 @@
plugins.configurable.uninstall=解除安裝
prompt.uninstall.plugin=確定要解除安裝插件 ''{0}'' 嗎?
prompt.uninstall.several.plugins=確定要解除安裝這 {0} 個插件嗎?
title.plugin.uninstall=解除安裝插件
action.AnActionButton.text.uninstall=解除安裝
action.org.jetbrains.r.packages.remote.ui.RUninstallAction.text=解除安裝軟件包
deployment.failed.uninstall.prompt.androidthings.errortext=無法解除安裝以下軟件包:\n{0}
deployment.failed.uninstall.prompt.androidthings.text=您的 APK 和其他已安裝的軟件包的意圖是 IOT_LAUNCHER。一次只能安裝一個具有該意圖的 APK。安裝 APK 之前,請嘗試解除安裝這些軟件包。\n\n警告: 解除安裝將移除應用數據!\n\n您要解除安裝以下應用嗎?\n{0}
deployment.failed.uninstall.prompt.generic.text=安裝失敗,消息 {0}。\n可以通過解除安裝 APK 的現有版本(如果有)來解決此問題,然後重新安裝。\n\n警告: 解除安裝將移除應用數據!\n\n要解除安裝現有的應用嗎?
deployment.failed.uninstall.prompt.text=自 {0} 起安裝失敗。\n要繼續,您必須解除安裝現有的應用。\n\n警告: 解除安裝將移除應用數據!\n\n要解除安裝現有的應用嗎?
device.reportMessage=請嘗試從設備上解除安裝應用程序,然後重試。\n如果無效,請向我們的跟踪器 (https://youtrack.jetbrains.com/issues/OC) 報告問題
install.package.dialog.message.are.you.sure.you.wish.to.uninstall.package=確定要解除安裝 ''{0}'' 軟件包嗎?
install.package.dialog.title.uninstall=解除安裝 {0}
install.package.dialog.title.uninstall.packages.failed=解除安裝軟件包失敗
install.uninstall.plugins.dialog.title=安裝/解除安裝插件
memory.snapshot.captured.text=插件解除安裝失敗時捕獲內存快照
plugins.configurable.uninstalled=已解除安裝
uninstall.packages.failed.dialog.title=解除安裝軟件包失敗
notification.telephonyPrejoinScreenShowing.title=自定義語音/視訊設定
package.successfully.uninstalled=已成功解除安裝軟件包 ''{0}''
package.task.manager.uninstall.title=解除安裝軟件包
packages.successfully.uninstalled=已成功解除安裝軟件包
uninstall.packages.failed=無法解除安裝軟件包。<a href="xxx">詳細信息…</a>
notification.telephonyPrejoinScreenShowing.title=自定義語音/視訊設定
yeoman.generators.dialog.uninstall.generator=解除安裝生成器
yeoman.generators.prompt.uninstall=確實要解除安裝生成器 ''{0}'' 嗎?
yeoman.generators.prompt.uninstall.title=Yeoman 生成器解除安裝
plugin.sync.state.uninstall.everywhere=隨處解除安裝
plugins.configurable.uninstall=解除安裝
plugins.configurable.uninstalled=已解除安裝
progress.title.uninstalling.yeoman.generator=正在解除安裝 Yeoman 生成器…
prompt.uninstall.plugin=確定要解除安裝插件 ''{0}'' 嗎?
prompt.uninstall.several.plugins=確定要解除安裝這 {0} 個插件嗎?
status.bar.text.no.plugins=沒有要安裝或解除安裝的插件
swift.rdt.test.more=就是這樣! 對於某些框架(例如 <strong>Quick</strong>),<ide/> 對測試結果提供了進一步增強的呈現效果。有關 <ide/> 支援的所有測試框架的概述,請觀看<a href="https://www.youtube.com/watch?v=DXvx6xNG_jc">這段影片</a>。
package.task.manager.uninstall.title=解除安裝軟件包
title.plugin.uninstall=解除安裝插件
uninstall.air.runtime.title=解除安裝 AIR 運行時
uninstall.old.pods=解除安裝舊 pod
uninstall.packages.failed=無法解除安裝軟件包。<a href="xxx">詳細信息…</a>
uninstall.packages.failed.dialog.title=解除安裝軟件包失敗
uninstall.task.action.failure.description=無法解除安裝軟件包: {0}
uninstall.task.action.failure.title=解除安裝軟件包失敗
uninstall.task.action.name=解除安裝軟件包
uninstall.task.action.success.title=已成功解除安裝軟件包
uninstall.task.action.success.description=已解除安裝軟件包: {0}
uninstall.task.action.failure.title=解除安裝軟件包失敗
uninstall.task.action.failure.description=無法解除安裝軟件包: {0}
install.package.dialog.message.are.you.sure.you.wish.to.uninstall.package=確定要解除安裝 ''{0}'' 軟件包嗎?
install.package.dialog.title.uninstall=解除安裝 {0}
install.package.dialog.title.uninstall.packages.failed=解除安裝軟件包失敗
action.org.jetbrains.r.packages.remote.ui.RUninstallAction.text=解除安裝軟件包
deployment.failed.uninstall.prompt.text=自 {0} 起安裝失敗。\n\
要繼續,您必須解除安裝現有的應用。\n\
\n\
警告: 解除安裝將移除應用數據!\n\
\n\
要解除安裝現有的應用嗎?
deployment.failed.uninstall.prompt.generic.text=安裝失敗,消息 {0}。\n\
可以通過解除安裝 APK 的現有版本(如果有)來解決此問題,然後重新安裝。\n\
\n\
警告: 解除安裝將移除應用數據!\n\
\n\
要解除安裝現有的應用嗎?
deployment.failed.uninstall.prompt.androidthings.text=您的 APK 和其他已安裝的軟件包的意圖是 IOT_LAUNCHER。一次只能安裝一個具有該意圖的 APK。安裝 APK 之前,請嘗試解除安裝這些軟件包。\n\
\n\
警告: 解除安裝將移除應用數據!\n\
\n\
您要解除安裝以下應用嗎?\n\
{0}
deployment.failed.uninstall.prompt.androidthings.errortext=無法解除安裝以下軟件包:\n\
{0}
uninstall.old.pods=解除安裝舊 pod
plugin.sync.state.uninstall.everywhere=隨處解除安裝
device.reportMessage=請嘗試從設備上解除安裝應用程序,然後重試。\n\
如果無效,請向我們的跟踪器 (https://youtrack.jetbrains.com/issues/OC) 報告問題
uninstall.air.runtime.title=解除安裝 AIR 運行時
uninstall.task.action.success.title=已成功解除安裝軟件包
uninstalling.air.runtime=正在解除安裝 AIR 運行時
status.bar.text.no.plugins=沒有要安裝或解除安裝的插件
install.uninstall.plugins.dialog.title=安裝/解除安裝插件
yeoman.generators.dialog.uninstall.generator=解除安裝生成器
yeoman.generators.prompt.uninstall=確實要解除安裝生成器 ''{0}'' 嗎?
yeoman.generators.prompt.uninstall.title=Yeoman 生成器解除安裝
46 changes: 23 additions & 23 deletions lib/static/synonym.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
頁籤,選項卡,標籤頁,標簽頁,选项卡,标签页,标签页,標籤頁,标籤页,标签页,标簽页,標籤頁,標签頁,標簽頁
視窗,窗口,窗口
預設,默認,默认
列印,打印,打印
貼上,粘貼,粘贴
伺服器,服务器,服務器
原始碼,源代码
全域,全局
全域類別庫,全局库,全局庫
列印,打印
初始頁面,初始屏幕
剪下,剪切
剪貼簿,剪貼板,剪贴板
剪下,剪切,剪切
註釋,注釋,注释
支援,支持
合併,合並,合并
唯讀,只讀,只读
選單,菜單,菜单
日誌,日志
註解,注解,注解
磁碟,磁盤,磁盘
檔案,文件
支援,支持
歡迎頁面,欢迎屏幕
註解,注解
註釋,注释,注釋
源資料夾,源文件夹,源文件夾
螢幕,屏幕,显示屏
視窗,窗口
視訊,视频
磁碟,磁盘,磁盤
移除,卸载
空閒,空閑,空闲
設定,设置
貼上,粘貼,粘贴
資料夾,文件夹,文件夾
源資料夾,源文件夹,源文件夾
遠端,远程
原始碼,源代码
資料庫,数据库
移除,卸载
空閒,空閑,空闲
遠端,远程
選單,菜单,菜單
音訊,音频
歡迎頁面,欢迎屏幕
初始頁面,初始屏幕
視訊,视频
合併,合並,合并
全域,全局
全域類別庫,全局库,全局庫
伺服器,服務器,服务器
頁籤,标签页,标簽页,标籤页,標签頁,標簽頁,標籤頁,选项卡,選項卡
預設,默認,默认
10 changes: 5 additions & 5 deletions lib/static/table.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
選項卡|0x100000|0
全局库|0x100000|0
初始屏幕|0x100000|50000
換擋|0x1000|0
標籤頁|0x100000|0
標簽頁|0x100000|0
換擋|0x1000|0
源文件夾|0x100000|0
欢迎屏幕|0x100000|50000
初始屏幕|0x100000|50000
源代码|0x100000|10000
源文件夾|0x100000|0
远程|0x101000|5000
全局库|0x100000|0
選項卡|0x100000|0
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,21 @@
"scripts": {
"ci:build": "yarn run plugin:build && yarn run build:commit",
"ci:test": "yarn run test",
"build:commit": "git commit -m \"build(release): update build\" ./plugin-dev-out ./plugin-dev-raw & echo build:commit",
"build:commit": "git commit -m \"build(release): update build\" ./plugin-dev-out ./plugin-dev-raw ./lib/static & echo build:commit",
"plugin:build": "yarn run test && yarn run plugin:handle-source && yarn run build",
"plugin:handle-source": "ts-node scripts/plugin-handle-source.ts",
"plugin:zht": "ts-node scripts/to-zht.ts && ts-node scripts/properties-replace.ts",
"prebuild": "ts-node scripts/update-meta.ts",
"build": "ts-node scripts/puglin-build-install-file.ts",
"build:sort": "ts-node scripts/sort-static-files.ts",
"review": "yarn run review:coverage",
"review:coverage": "yarn run lint && yarn run coverage",
"review:test": "yarn run lint && yarn run test",
"coverage": "yarn run test -- --coverage",
"lint": "yarn run lint:eslint",
"lint:eslint": "ynpx eslint --ext .ts,.tsx,.mts,.cts ./",
"test": "jest --passWithNoTests -u",
"posttest": "yarn run build:sort",
"test:jest": "jest --passWithNoTests",
"test:mocha": "ynpx --quiet -p ts-node -p mocha mocha -- --require ts-node/register \"!(node_modules)/**/*.{test,spec}.{ts,tsx}\"",
"test:tsdx": "ynpx @bluelovers/tsdx test --passWithNoTests",
Expand Down Expand Up @@ -62,7 +64,10 @@
"dependencies": {
"@bluelovers/fast-glob": "^3.0.4",
"@lazy-cjk/zh-convert": "^1.0.42",
"@novel-segment/loaders": "^1.0.26",
"@novel-segment/loaders": "^1.0.27",
"@novel-segment/sort-dict-table": "^1.0.1",
"@novel-segment/sort-synonym": "^1.0.1",
"@novel-segment/util-compare": "^1.0.1",
"@yarn-tool/find-root": "^1.0.61",
"ansi-colors": "^4.1.1",
"array-hyper-unique": "^2.0.6",
Expand All @@ -79,8 +84,8 @@
"jszip": "^3.7.1",
"jszip-fixed-date": "^1.0.3",
"micromatch": "^4.0.4",
"novel-segment": "^2.7.84",
"novel-segment-cli": "^1.1.102",
"novel-segment": "^2.7.85",
"novel-segment-cli": "^1.1.103",
"progress-estimator": "^0.3.0",
"tslib": "^2.3.1",
"upath2": "^3.1.12"
Expand Down
54 changes: 54 additions & 0 deletions scripts/sort-static-files.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { loadFile as loadFileSynonym } from "@novel-segment/sort-synonym";
import { stringifyHandleDictLinesList } from "@novel-segment/util-compare";
import { __dict_properties_lazy, __dict_synonym_txt, __dict_table_txt } from '../lib/const';
import { outputFile, writeFile } from 'fs-extra';
import { LF } from 'crlf-normalize';
import { loadFile as loadFileTable } from '@novel-segment/sort-dict-table';
import DotProperties from 'dot-properties-loader';
import { basename } from 'path';

export default Promise.all([
loadFileTable(__dict_table_txt)
.then(list =>
{
const lines = stringifyHandleDictLinesList(list);

return writeFile(__dict_table_txt, lines.join(LF) + LF)
.then(() => console.log(`sort ${basename(__dict_table_txt)}`))
}),
loadFileSynonym(__dict_synonym_txt)
.then(list =>
{
const lines = stringifyHandleDictLinesList(list);

return writeFile(__dict_synonym_txt, lines.join(LF) + LF)
.then(() => console.log(`sort ${basename(__dict_synonym_txt)}`))
}),
Promise.resolve()
.then(() =>
{

const LAZY_PROPERTIES = new DotProperties({
file: __dict_properties_lazy,
});

const LAZY_PROPERTIES_KEYS = Object.keys(LAZY_PROPERTIES.tree).sort();

const dp = new DotProperties({
source: '',
});

LAZY_PROPERTIES_KEYS.forEach(key =>
{
dp.set(key, LAZY_PROPERTIES.get(key) as any);
});

let text = dp.stringify({
latin1: false,
keySep: '=',
});

return outputFile(__dict_properties_lazy, text + LF)
.then(() => console.log(`sort ${basename(__dict_properties_lazy)}`))
}),
])
2 changes: 2 additions & 0 deletions test/__snapshots__/segment.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ exports[`segment 剪貼板 - 從剪貼板粘貼 1`] = `"從剪貼簿貼上"`;

exports[`segment 只讀 - action.ToggleReadOnlyAttribute.text=切換只讀特性 1`] = `"action.ToggleReadOnlyAttribute.text=切換唯讀特性"`;

exports[`segment 屏幕 - action.android.emulator.home.button.text=主屏幕 1`] = `"action.android.emulator.home.button.text=主螢幕"`;

exports[`segment 打印 - action.Print.text=打印(_P)…
action.Print.description=打印文件 1`] = `
"action.Print.text=列印(_P)…
Expand Down
1 change: 1 addition & 0 deletions test/segment.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe(`segment`, () =>
[`全局`, `使工具全局可见(&B)`],
[`全局库`, `导入的项目引用了未知的全局库`],
[`服務器`, `以下文件被禁止,因为其中一个文件很可能导致服务器崩溃。\n{0}`],
[`屏幕`, `action.android.emulator.home.button.text=主屏幕`],

].forEach(text =>
{
Expand Down
Loading

0 comments on commit 0a1d828

Please sign in to comment.