logo
Doom
English
简体中文
English
简体中文
logo
Doom
Introduction
Getting Started

Usage

Configuration
Convention
Markdown
MDX
Internationalization
API Documentation
Permission Description Document
Referencing Documents
Deployment

APIs

Advanced API

Event APIs

Search

Log APIs

Aggregation
Search
CodeQualityTaskSummary
Projects

Workload APIs

DaemonSet [apps/v1]
Deployments [apps/v1]

CRDs

ArtifactCleanupRun

Public References

CodeQuality
CodeQualityBranch
📝 Edit this page on GitHub
Previous PageMDX
Next PageAPI Documentation

#Internationalization

Most of the internal documentation of alauda is bilingual in Chinese and English. Therefore, we by default support using en/zh subfolders to store documents in different languages. It is recommended to also store static resources under en/zh subfolders in the public directory, which facilitates the management of both documentation content and static resources.

#TOC

#i18n.json

For reusable components, if you need to support both Chinese and English within the same component, you first need to create an i18n.json file under the docs directory. Then, in the component, use useI18n to get the text for the current language, for example:

docs/i18n.json
{
  "title": {
    "zh": "标题",
    "en": "Title"
  },
  "description": {
    "zh": "描述",
    "en": "description"
  }
}

#.ts/.tsx

import { useI18n } from '@rspress/core/runtime'

export const CommonContent = () => {
  const t = useI18n()
  return <h1>{t('title')}</h1>
}

#.mdx

import { useI18n } from '@rspress/core/runtime'

# {useI18n()('title')}

{useI18n()('description')}