Theme I18n Options
About 2 min
You can add the following options to locales[localePath]
in theme options to customize the theme's multilingual options.
interface ThemeLocaleData {
/**
* Current lang code
*/
lang: string;
/**
* Outlook
*/
outlookLocales: {
/**
* Theme Color
*/
themeColor: string;
/**
* Theme mode
*/
darkmode: string;
/**
* Fullscreen text
*/
fullscreen: string;
};
/**
* Blog
*/
blogLocales: {
/** 文章文字 */
article: string;
/** 文章列表文字 */
articleList: string;
/** 分类文字 */
category: string;
/** 标签文字 */
tag: string;
/** 时间轴文字 */
timeline: string;
/** 时间轴标题文字 */
timelineTitle: string;
/** 全部文字 */
all: string;
/** 个人介绍 */
intro: string;
/** 星标文章 */
star: string;
/** 空文字 */
empty: string;
};
/**
* Pagination
*/
paginationLocales: {
/**
* Previous page button label text
*/
prev: string;
/**
* Next page button label text
*/
next: string;
/**
* Navigation hint label text
*/
navigate: string;
/**
* Navigation button label text
*/
action: string;
/**
* Error text when invalid page number
*
* @description `$page` will be replaced by total page number automatically
*/
errorText: string;
};
/**
* Encrypt
*/
encryptLocales: {
/**
* Aria label for encrypt icon
*/
iconLabel: string;
/**
* Password placeholder
*/
placeholder: string;
/**
* Whether remember password
*/
remember: string;
/**
* Password error hint
*/
errorHint: string;
};
/**
* Navbar
*/
navbarLocales: {
/**
* Aria label of of the language selection dropdown
*/
selectLangAriaLabel: string;
/**
* Language name of current locale
*/
langName: string;
};
/**
* Page meta
*/
metaLocales: {
/**
* Author label text
*/
author: string;
/**
* Writing date label text
*/
date: string;
/**
* Label text marked as original
*/
origin: string;
/**
* Page views label text
*/
views: string;
/**
* Tag label text
*/
tag: string;
/**
* Category label text
*/
category: string;
/**
* Expect reading time label text
*/
readingTime: string;
/**
* Words label Text
*/
words: string;
/**
* Table of contents
*/
toc: string;
/**
* Previous link
*/
prev: string;
/**
* Next link
*/
next: string;
/**
* last updated text
*/
lastUpdated: string;
/**
* Contributors text
*/
contributors: string;
/**
* Edit link text
*/
editLink: string;
};
routeLocales: {
/**
* Skip to main content
*/
skipToContent: string;
/**
* 404 page title
*/
notFoundTitle: string;
/**
* 404 page msgs
*/
notFoundMsg: string[];
/**
* Back to homepage
*/
home: string;
/**
* Back to last page
*/
back: string;
};
}
Meanwhile, some i18n options are controlled by plugins, including:
plugins.comment.walineLocales: Waline Comment Service
- plugins.components.locales
: Component locales plugins.copyCode.locales: Code block copy button
plugins.copyright.locales: Copyright information
plugins.markdownHint.locales: Markdown hint
plugins.photoSwipe.locales: Photo preview
plugins.pwa.locales: PWA