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

Move constant values to their own file. #894

Merged
merged 2 commits into from
Apr 24, 2017
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const constants = {
urlReleaseNote: 'https://github.com/vscode-icons/vscode-icons/blob/master/CHANGELOG.md',
urlReadme: 'https://github.com/vscode-icons/vscode-icons/blob/master/README.md',
urlOfficialApi: 'http://code.visualstudio.com/docs/customization/themes#_select-an-icon-theme',
};
3 changes: 0 additions & 3 deletions src/i18n/langResources/lang.de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ export const langDe: ILangResource = {
},
aboutOfficialApi: 'Erfahren Sie mehr über Datei und Ordner Icons (Englisch)',
learnMore: 'Wollen Sie mehr erfahren?',
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: 'Neu starten',
autoReload: 'Automatisch neu starten',
disableDetect: 'Projekterkennung deaktivieren',
Expand Down
3 changes: 0 additions & 3 deletions src/i18n/langResources/lang.en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ export const langEn: ILangResource = {
},
aboutOfficialApi: 'Learn more about File & Folder icons',
learnMore: 'Want to learn more?',
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: 'Restart',
autoReload: 'Auto-Restart',
disableDetect: 'Disable Detection',
Expand Down
3 changes: 0 additions & 3 deletions src/i18n/langResources/lang.es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ export const langEs: ILangResource = {
},
aboutOfficialApi: 'Aprenda más sobre los iconos de archivos y carpetas (en inglés)',
learnMore: '¿Quiere saber más?',
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: 'Reiniciar',
autoReload: 'Auto Reiniciar',
disableDetect: 'Deshabilitar Detección',
Expand Down
3 changes: 0 additions & 3 deletions src/i18n/langResources/lang.zh-cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ export const langZhCn: ILangResource = {
},
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: '取消自动检测',
Expand Down
7 changes: 4 additions & 3 deletions src/init/welcome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as open from 'open';
import { LanguageResourceManager } from '../i18n';
import { getConfig } from '../utils/vscode-extensions';
import { ISettingsManager, ExtensionStatus, LangResourceKeys } from '../models';
import { constants } from '../constants';

const i18nManager = new LanguageResourceManager(vscode.env.language);

Expand Down Expand Up @@ -31,9 +32,9 @@ function showWelcomeMessage(settingsManager: ISettingsManager) {
.then(btn => {
if (!btn) { return; }
if (btn.title === i18nManager.getMessage(LangResourceKeys.aboutOfficialApi)) {
open(i18nManager.getMessage(LangResourceKeys.urlOfficialApi));
open(i18nManager.getMessage(constants.urlOfficialApi));
} else if (btn.title === i18nManager.getMessage(LangResourceKeys.seeReadme)) {
open(i18nManager.getMessage(LangResourceKeys.urlReadme));
open(i18nManager.getMessage(constants.urlReadme));
}
}, reason => {
// tslint:disable-next-line:no-console
Expand All @@ -52,7 +53,7 @@ function showNewVersionMessage(settingsManager: ISettingsManager) {
settingsManager.updateStatus(ExtensionStatus.disabled);
if (!btn) { return; }
if (btn.title === i18nManager.getMessage(LangResourceKeys.seeReleaseNotes)) {
open(i18nManager.getMessage(LangResourceKeys.urlReleaseNote));
open(i18nManager.getMessage(constants.urlReleaseNote));
} else if (btn.title === i18nManager.getMessage(LangResourceKeys.dontShowThis)) {
getConfig().update('vsicons.dontShowNewVersionMessage', true, true);
}
Expand Down
3 changes: 0 additions & 3 deletions src/models/i18n/langResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ export interface ILangResource {
activationPath: string | IOSSpecific;
aboutOfficialApi: string | IOSSpecific;
learnMore: string | IOSSpecific;
urlReleaseNote: string | IOSSpecific;
urlReadme: string | IOSSpecific;
urlOfficialApi: string | IOSSpecific;
reload: string | IOSSpecific;
autoReload: string | IOSSpecific;
disableDetect: string | IOSSpecific;
Expand Down
3 changes: 0 additions & 3 deletions src/models/i18n/langResourceKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ export enum LangResourceKeys {
activationPath,
aboutOfficialApi,
learnMore,
urlReleaseNote,
urlReadme,
urlOfficialApi,
reload,
autoReload,
disableDetect,
Expand Down