Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for zh-CN #871

Merged
merged 6 commits into from
Apr 22, 2017
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ The above syntax will create examples for all supported files and folders.
## Contributing with translations
We're looking for people willing to help us translate the extension's messages into [all the languages that `vscode` supports](https://code.visualstudio.com/docs/customization/locales).

We're currently supporting English, German and Spanish. If you're willing to help with the translations of the missing languages take a look at [#526](https://github.com/vscode-icons/vscode-icons/issues/526) and get your hands dirty. We'll really appreciate it! ;P
We're currently supporting `English`, `German`, `Simplified Chinese` and `Spanish`. If you're willing to help with the translations of the missing languages take a look at [#526](https://github.com/vscode-icons/vscode-icons/issues/526) and get your hands dirty. We'll really appreciate it! ;P

## Building the extension's source code
If you're willing to explore the extension source code and want to make it work you should run this:
Expand Down
27 changes: 27 additions & 0 deletions package.nls.zh-cn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"command.regenerateIcons.title": "开始使用自定义图标",
"command.ngPreset.title": "切换成Angular模式(工作级别)",
"command.jsPreset.title": "切换成官方JS模式(用户级别)",
"command.tsPreset.title": "切换成官方TS模式(用户级别)",
"command.jsonPreset.title": "切换成官方JSON模式(用户级别)",
"command.hideFoldersPreset.title": "切换成显示文件夹图标(用户级别)",
"command.foldersAllDefaultIconPreset.title": "切换成显示特定文件夹图标(用户级别)",
"command.restoreIcons.title": "恢复成默认图标模式",
"command.resetProjectDetectionDefaults.title": "重置工程文件侦测模式到默认设置",
"configuration.title": "vscode-图标设置",
"configuration.dontShowNewVersionMessage.description": "如果设置成true,关于新的版本消息将不再显示",
"configuration.projectDetection.autoReload.description": "如果设置成true,安装完更新后插件会自动重启",
"configuration.projectDetection.disableDetect.description": "如果设置成true,插件不再自动检测工程文件",
"configuration.presets.angular.description": "如果设置成true,插件会自动匹配Angular模式",
"configuration.presets.jsOfficial.description": "如果设置成true,插件会自动使用官方JS图标",
"configuration.presets.tsOfficial.description": "如果设置成true,插件会自动使用官方TS图标",
"configuration.presets.jsonOfficial.description": "如果设置成true,插件会自动使用官方JSON图标",
"configuration.presets.hideFolders.description": "如果设置成true,所有文件夹会隐藏",
"configuration.presets.foldersAllDefaultIcon.description": "如果设置成true,所有文件夹会恢复成默认图标",
"configuration.associations.files.description": "这些自定义的设置会覆盖掉系统默认文件的设置",
"configuration.associations.folders.description": "这些自定义的设置会覆盖掉系统默认文件夹的设置",
"configuration.associations.fileDefault.file.description": "这个设置会改变默认深色文件图标",
"configuration.associations.fileDefault.file_light.description": "这个设置会改变默认浅色文件图标",
"configuration.associations.folderDefault.folder.description": "这个设置会改变默认深色文件夹图标",
"configuration.associations.folderDefault.folder_light.description": "这个设置会改变默认浅色文件夹图标"
}
3 changes: 2 additions & 1 deletion src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export class LanguageResourceManager {
private resourceCollection?: ILangResourceCollection |
{ [key: string]: { [key: string]: string | IOSSpecific; } }) {
this.resourceCollection = this.resourceCollection || langResourceCollection;
this.messages = this.resourceCollection[this.language] || this.resourceCollection['en'];
this.messages = (this.language && this.resourceCollection[this.language.toLowerCase()]) ||
this.resourceCollection['en'];
}

public getMessage(...keys: Array<LangResourceKeys | string>): string {
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/langResourceCollection.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// tslint:disable object-literal-key-quotes
import { ILangResourceCollection } from '../models/i18n';
import * as resources from './langResources';

export const langResourceCollection: ILangResourceCollection = {
de: resources.langDe,
en: resources.langEn,
es: resources.langEs,
"zh-cn": resources.langZhCn,
};
1 change: 1 addition & 0 deletions src/i18n/langResources/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './lang.de';
export * from './lang.en';
export * from './lang.es';
export * from './lang.zh-cn';
41 changes: 41 additions & 0 deletions src/i18n/langResources/lang.zh-cn.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { ILangResource } from '../../models/i18n';

export const langZhCn: ILangResource = {
newVersion: '欢迎使用最新版本的 vscode-icons.',
seeReleaseNotes: '关于最新版本的改动',
dontShowThis: '下次不再显示这条消息',
seeReadme: '查看插件的文档',
welcomeBegin: 'vscode-icons 现在支持官方API,去',
welcomeEnd: 'VSCode图标里面点击使用',
activationPath: {
darwin: '代码 > 首选项 > 文件图标主题',
linux: '文件 > 首选项 > 文件图标主题',
win32: '文件 > 首选项 > 文件图标主题',
},
aboutOfficialApi: '查看更多关于文件和文件夹的图标',
learnMore: '想要了解更多消息?',
urlReleaseNote: 'https://github.com/robertohuertasm/vscode-icons/blob/master/CHANGELOG.md',
urlReadme: 'https://github.com/robertohuertasm/vscode-icons/blob/master/README.md',
urlOfficialApi: 'http://code.visualstudio.com/docs/customization/themes#_select-an-icon-theme',
reload: '重启',
autoReload: '自动重启',
disableDetect: '取消自动检测',
iconCustomization: '重新生成图标',
iconRestore: '图标正在被复原',
ngPresetEnabled: '使用Angular的图标',
ngPresetDisabled: '取消使用Angular的图标',
jsOfficialPresetEnabled: '使用官方JS图标',
jsOfficialPresetDisabled: '取消使用官方JS图标',
tsOfficialPresetEnabled: '使用官方TS图标',
tsOfficialPresetDisabled: '取消使用官方TS图标',
jsonOfficialPresetEnabled: '使用官方JSON图标',
jsonOfficialPresetDisabled: '取消使用官方JSON图标',
hideFoldersPresetEnabled: '现在使用文件夹图标',
hideFoldersPresetDisabled: '现在隐藏文件夹图标',
foldersAllDefaultIconPresetEnabled: '现在使用指定的文件夹图标',
foldersAllDefaultIconPresetDisabled: '现在取消使用指定的文件夹图标',
restart: '选择 \'重启\' 使改变生效',
ngDetected: 'vscode-icons 发现当前工程是Angular选择 \'重启\' 使用Angular的图标',
nonNgDetected: 'vscode-icons 发现当前工程不是Angular选择 \'重启\' 取消使用Angular的图标',
projectDetecticonReset: '重设自动检测工程文件到默认设置',
};
4 changes: 2 additions & 2 deletions src/models/i18n/langResourceCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export interface ILangResourceCollection {
ja?: ILangResource;
ko?: ILangResource;
ru?: ILangResource;
"zh-CN"?: ILangResource;
"zh-TW"?: ILangResource;
"zh-cn"?: ILangResource;
"zh-tw"?: ILangResource;
}