mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 11:41:17 +02:00
refactor: update language configuration
This commit is contained in:
parent
ff59dc1a7c
commit
22dc899a95
25 changed files with 53 additions and 188 deletions
|
@ -1,5 +1,23 @@
|
|||
import { themeConfig } from '@/config'
|
||||
// Global Language Map
|
||||
export const langMap: Record<string, string[]> = {
|
||||
'zh': ['zh-CN'],
|
||||
'zh-tw': ['zh-TW'],
|
||||
'ja': ['ja-JP'],
|
||||
'en': ['en-US'],
|
||||
'es': ['es-ES'],
|
||||
'ru': ['ru-RU'],
|
||||
}
|
||||
|
||||
export const defaultLocale = themeConfig.global.locale
|
||||
export const moreLocales = themeConfig.global.moreLocales
|
||||
export const allLocales = [defaultLocale, ...moreLocales]
|
||||
// Waline Language Map
|
||||
// docs: https://waline.js.org/guide/i18n.html
|
||||
export const walineLocaleMap: Record<string, string> = {
|
||||
'zh': 'zh-CN',
|
||||
'zh-tw': 'zh-TW',
|
||||
'ja': 'jp-JP', // Waline uses jp-JP not ja-JP
|
||||
'en': 'en-US',
|
||||
'es': 'es-ES',
|
||||
'ru': 'ru-RU',
|
||||
}
|
||||
|
||||
// Supported Languages
|
||||
export const supportedLangs = Object.keys(langMap).flat()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue