Skip to content

Commit

Permalink
feat(i18n): add zh-TW language
Browse files Browse the repository at this point in the history
  • Loading branch information
purocean committed Apr 30, 2024
1 parent 38d7533 commit 547b6eb
Show file tree
Hide file tree
Showing 5 changed files with 752 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class UpdateProvider extends GitHubProvider {
}

if (source === 'auto') {
if (app.getLocale().toLowerCase().includes('zh')) {
if (app.getLocale().toLowerCase().includes('zh-cn')) {
source = 'yank-note'
} else {
source = 'github'
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/others/setting-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ const schema: SettingSchema = ({
defaultValue: 'system',
title: 'T_setting-panel.schema.language',
type: 'string',
enum: ['system', 'en', 'zh-CN'],
enum: ['system', 'en', 'zh-CN', 'zh-TW'],
options: {
enum_titles: ['System', 'English', '简体中文'],
enum_titles: ['System', 'English', '简体中文', '繁體中文'],
},
group: 'appearance',
required: true,
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/support/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const FLAG_DEBUG = import.meta.env.MODE === 'development' || $args().get(

export const HELP_REPO_NAME = '__help__'

export const MONACO_EDITOR_NLS = { de: 'Deutsch', es: 'Español', fr: 'Français', it: 'Italiano', ja: '日本語', ko: '한국어', ru: 'Русский', 'zh-cn': '简体中文' }
export const MONACO_EDITOR_NLS = { de: 'Deutsch', es: 'Español', fr: 'Français', it: 'Italiano', ja: '日本語', ko: '한국어', ru: 'Русский', 'zh-cn': '简体中文', 'zh-tw': '繁體中文' }

export const CSS_VAR_NAME = {
PREVIEWER_HEIGHT: '--previewer-height'
Expand Down
4 changes: 3 additions & 1 deletion src/share/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import get from 'lodash/get'
import merge from 'lodash/merge'
import en, { BaseLanguage } from './languages/en'
import zhCN from './languages/zh-CN'
import zhTW from './languages/zh-TW'

const languages = {
en,
'zh-CN': zhCN
'zh-CN': zhCN,
'zh-TW': zhTW
}

export type Flat<T extends Record<string, any>, P extends string = ''> =(
Expand Down
Loading

0 comments on commit 547b6eb

Please sign in to comment.