Concepts

Languages

The Dashboard speaks English and Simplified Chinese (zh-CN). This page says how it chooses between them, where its words live, and which Chinese term stands for each of Davloom's own.

Choosing the language

  • With nothing chosen, the Dashboard follows the browser: any Chinese in navigator.languages, in any script or region (zh, zh-CN, zh-TW, zh-Hant-HK), shows Simplified Chinese, and anything else shows English.
  • Settings > Appearance > Language offers English, 简体中文 and System. The choice is kept in this browser's localStorage under davloom-language, applies at once to every open tab, and System removes it. Without storage, as in a private window, a choice lasts until the page closes.
  • lang on <html> always names the language shown, so screen readers and the browser's own features, such as hyphenation and font choice, read it right.

First paint

Each prerendered page holds its frame twice, once in each language, in elements marked data-frame-locale. A small script in <head> (apps/web/src/features/i18n/script.ts) sets lang on <html> from the stored choice or the browser before <body> is parsed, and for Chinese it also writes the page's Chinese title and description. The stylesheet shows only the frame whose language matches lang, so a Chinese reader never sees English first. Once the code loads, the page renders in one language only.

Where the words live

  • apps/web/src/features/i18n/messages/en.ts holds every English word of the Dashboard, by key. Braces hold a placeholder, such as {name}, and a message whose words depend on a number has one and other forms, which Intl.PluralRules chooses between. Chinese has only other.
  • apps/web/src/features/i18n/messages/zh-CN.ts holds the same keys in Chinese. TypeScript fails when a key is missing, and i18n.test.tsx fails when a text is empty or its placeholders or tags differ from the English.
  • apps/web/src/features/i18n/messages/astryx-zh-CN.ts supplies the words of Astryx components that Astryx's own Chinese catalog leaves out.
  • A component reads its words with const t = useT() and t("key", { name }). Numbers, sizes, dates, times, relative times and lists go through t.count, t.bytes, t.date, t.dateTime, t.relative and t.list, which format them with Intl for the language shown.
  • A message that holds a link marks it with a tag, such as <link>Credentials</link>, so a translation can move the link within its sentence; RichText renders it.
To add words, add the key to en.ts and to zh-CN.ts. Write a whole sentence per key rather than joining fragments, because Chinese orders a sentence's parts differently.

Style

Write Chinese that is short and plain, as a native product would say it. Use full-width punctuation (,。:;?!“”()) and leave a space between Chinese and a Latin word or a number, as in 3 个文件 or Davloom 实例. Address the reader as 你, and keep error messages to what happened and what to do next.

Glossary

Names stay as they are in both languages: Davloom, WebDAV, Finder, rclone, Cloudflare, Durable Objects, S3 and API.
EnglishChinese
Dashboard控制台
Overview概览
Files文件
Folder文件夹
Credentials凭据
API Key, keyAPI 密钥, 密钥
Storage & Mounts存储与挂载
Mount挂载点
Backend, storage backend后端, 存储后端
S3 compatible兼容 S3
Bucket存储桶
Endpoint端点
Region区域
Settings设置
Appearance外观
Profile个人资料
Sign in, sign out登录, 退出登录
Create account创建账户
Password密码
Passkey通行密钥
Two-step verification两步验证
Authenticator app身份验证器应用
Backup code备用验证码
Setup token初始化令牌
Session会话
Revoke吊销
Read only, read and write只读, 读写
Instance实例
Data export数据导出
Available, unavailable可用, 不可用