Skip to content

Commit

Permalink
refactor: use json5
Browse files Browse the repository at this point in the history
  • Loading branch information
hemengke1997 committed Jun 1, 2024
1 parent bc944bf commit 28fa47c
Show file tree
Hide file tree
Showing 16 changed files with 3,092 additions and 2,378 deletions.
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"eslint.experimental.useFlatConfig": true,
"i18n-ally.localesPaths": ["locales", "src/webview/locales"],
"i18n-ally.pathMatcher": "{locale}.json",
"i18n-ally.namespace": true,
"i18n-ally.pathMatcher": "{locale}.json5",
"i18n-ally.enabledParsers": ["json5"],
"i18n-ally.namespace": false,
"i18n-ally.sourceLanguage": "zh-CN",
"i18n-ally.displayLanguage": "zh-CN",
"i18n-ally.keystyle": "nested",
Expand Down
92 changes: 0 additions & 92 deletions locales/en.json

This file was deleted.

92 changes: 92 additions & 0 deletions locales/en.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
pkg: {
title: 'Image Manager 🏞️',
cmd: {
open: 'Open Image Manager',
reset_settings: 'Reset Settings',
show_channel: 'Show Output Channel',
enable_mirror: 'Enable Mirror',
select_mirror: 'Select Mirror Url',
},
debug: {
enabled: 'enable debug mode',
forceInstall: 'force install dependencies',
},
file: {
root: 'workspace root',
exclude: 'scan images not in exclude (pattern syntax of micromatch)',
scan: 'image type to scan',
confirmDelete: 'controls whether ask for confirmation when deleting a image',
},
viewer: {
warningSize: 'show warning dot if image size is larger than this value (KB). Hidden if 0',
imageWidth: 'width of image (px)',
imageBackgroundColor: 'image background color',
imageRendering: 'image rendering',
},
appearance: {
theme: 'theme',
language: 'language',
primaryColor: 'primary color',
reducedMotion: 'reduce animation',
},
mirror: {
enabled: 'use mirror for downloading dependencies',
url: 'mirror url',
},
compression: {
keepOriginal: 'keep original image',
skipCompressed: 'skip compressed image',
quality: 'image quality',
fileSuffix: 'file suffix',
size: 'image size (x)',
format: 'output image format',
saveCompressionData: 'save compression data',
png: {
compressionLevel: 'compression level',
},
gif: {
colors: 'colors',
},
},
conversion: {
icoSize: 'ico size',
},
similarity: {
precision: 'Determining the precision of image similarity. The smaller the value, the stricter the judgment',
},
},
prompt: {
reload_tip: 'Config changed. Please reload',
compressor_init_fail: 'Install dependencies failed. Please check network.',
deps_init_success: 'Dependencies installed successfully',
initializing: 'Image Manager Initializing...',
initializing_tooltip: 'Downloading necessary dependencies',
initialized: 'Image Manager Initialized',
show_logs: 'Show logs',
mirror_enabled: 'Mirror enabled. Please reload vscode to take effect.',
reload_now: 'Reload Now',
mirror_already_enabled: 'Mirror already enabled.',
select_mirror: 'Select Mirror Url',
mirror_selected: 'Mirror Url Selected: {0}. Please reload vscode to take effect.',
load_sharp_failed: 'Load core script failed, please retry',
},
core: {
compress_fail: 'Compress Fail',
dep_not_found: 'Dependencies install failed',
compress_fail_reason_extension: '{0} format is not supported yet',
compress_fail_reason_unknown: 'Unknown error',
compress_fail_reason_size: 'Maximum support size {0} MB',
view_solution: 'View the Solution',
extension_root: 'Extension Root',
platform: 'OS platform',
manual_install_failed: 'Manual install failed. Make sure to install the correct version',
manual_install_success: 'Manual install success',
dep_cache_dir: 'Dependencies Cache Dir',
start_manual_install: 'Start manual install dependencies',
start_auto_install: 'Start auto install dependencies',
format_not_supported: '{0} format is not supported',
tip: 'Tip',
dep_url: 'The following is the manual download dependencies address, if the automatic installation of dependencies fails, please follow the documentation to manually download the following dependencies',
},
}
92 changes: 0 additions & 92 deletions locales/zh-CN.json

This file was deleted.

95 changes: 95 additions & 0 deletions locales/zh-CN.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
// package.json
pkg: {
title: 'Image Manager 🏞️',
cmd: {
open: '打开 Image Manager',
reset_settings: '重置设置',
show_channel: '显示输出',
enable_mirror: '启用镜像',
select_mirror: '选择镜像源',
},
debug: {
enabled: '开启调试模式',
forceInstall: '强制安装依赖',
},
file: {
root: '根工作区',
exclude: '排除范围内的图片 (micromatch 匹配语法)',
scan: '扫描图片的类型',
confirmDelete: '删除图片时是否询问',
},
viewer: {
warningSize: '如果图片大小大于此值 (KB),则显示警告点。值为0时不显示',
imageWidth: '图片宽度 (px)',
imageBackgroundColor: '图片背景色',
imageRendering: 'image rendering',
},
appearance: {
theme: '主题',
language: '语言',
primaryColor: '主题色',
reducedMotion: '减少动画',
},
mirror: {
enabled: '使用镜像下载依赖',
url: '镜像地址',
},
compression: {
keepOriginal: '保留原图',
skipCompressed: '跳过已压缩的图片',
quality: '图片质量',
fileSuffix: '压缩后缀',
size: '图片尺寸 (倍数)',
format: '图片格式',
saveCompressionData: '保存压缩信息',
png: {
compressionLevel: '压缩等级',
},
gif: {
colors: '色彩',
},
},
conversion: {
icoSize: 'ico 图标尺寸',
},
similarity: {
precision: '判断图片相似的精确度。值越小,判断越严格',
},
},
// 提示
prompt: {
reload_tip: '配置已更改,请重新加载',
compressor_init_fail: '依赖安装失败,请检查网络',
deps_init_success: '依赖安装成功',
initializing: 'Image Manager 初始化...',
initializing_tooltip: '正在下载必要依赖',
initialized: 'Image Manager 初始化完成',
show_logs: '显示日志',
mirror_enabled: '镜像下载依赖已启用, 请重启vscode生效',
reload_now: '立即重启',
mirror_already_enabled: '镜像下载依赖已启用',
select_mirror: '选择镜像源',
mirror_selected: '切换镜像源成功: {0}, 请重启vscode生效',
load_sharp_failed: '加载核心脚本失败,请重试',
},
// 核心代码
core: {
compress_fail: '压缩失败',
dep_not_found: '依赖安装失败',
compress_fail_reason_extension: '暂不支持 {0} 格式',
compress_fail_reason_unknown: '未知错误',
compress_fail_reason_size: '最大支持体积 {0} MB',
view_solution: '查看解决方案',
extension_root: '插件根目录',
platform: '系统平台',
manual_install_failed: '手动安装依赖失败,请确保安装对应版本',
manual_install_success: '手动安装依赖成功',
dep_cache_dir: '依赖缓存目录',
start_manual_install: '开始手动安装依赖',
start_auto_install: '开始自动安装依赖',
format_not_supported: '不支持 {0} 格式',
tip: '温馨提示',
dep_url: '以下是手动下载依赖地址,若自动安装依赖失败请按照文档手动下载以下依赖',
},
}
Loading

0 comments on commit 28fa47c

Please sign in to comment.