ITADN
CachyOS/wiki
README.md
以下内容由 AI 翻译,如有问题请点此提交 issue 反馈

CachyOS Wiki

本仓库包含我们 wiki 页面 的源代码。

🙋 贡献

要求

  • bun - 运行网站的本地副本以预览本地更改
  • git - 尽量避免从 GitHub Web 编辑文件。请参阅 此处 开始学习使用 git。
  • 文本编辑器 - 最好是一个能正确解析 markdown 的编辑器。

基本指南

  1. Fork 此仓库,以便您拥有此仓库的副本。
  2. 将 fork 后的仓库克隆到您的计算机上。
git clone https://github.com/<your-username>/wiki
  1. 要提交你的更改,请创建一个新分支。无论是否是你自己的 fork,都不要直接提交到 master 分支。
git checkout -b <new-branch>
  1. 现在你可以开始编辑你认为合适的文件。

  2. 提交你的更改。

git add <modified-files> # Alternatively you can use git add -A for all files or git add -u for untracked files
git commit # For a simple commit message, you can do git commit -m "Commit Message"
git push origin <new-branch>

预览本地更改

bun install # Install dependencies used by our wiki
bun run dev # Runs a local copy of the wiki, complete with your modifications!

bun run build # Builds the wiki for production to make sure everything works as expected
bun run preview # Preview the production build (lunaria might show an error if there are uncommitted changes, this is normal)

最后,你可以发起一个 pull request 以获取你的更改的审查,并希望其被合并。

祝贡献愉快!

🧑‍🤝‍🧑 翻译

我们始终欢迎社区成员为 wiki 添加新的翻译。这对非英语使用者帮助极大

你可以使用位于 https://wiki.cachyos.org/localization 的本地化跟踪器来查看我们现有翻译的状态。

入门指南

首先,你需要将你的语言添加到站点的可用区域设置列表中。这在 lunaria.config.json 中完成。 请参阅 ISO 639-1 语言代码列表

// lunaria.config.json
//...
"locales": [
  {
    "label": "Your Language",
    "lang": "xx", // Refer to two-letter language codes from the ISO 639-1 list linked above.
  }
];
//...

接下来,您可以开始添加自己的翻译。为此,请在 src/content/docs 中添加一个以您的双字母语言代码命名的子目录。

├── astro.config.mjs
├── src
│   └── content
│       └── i18n
│           └── xx.json # Your language code
│       └── docs
│           ├── cachyos_basic
│           │   ├── download.mdx
│           │   └── why_cachyos.md
│           └── xx # Your language code
│               └── cachyos_basic
│                   ├── download.mdx
│                   └── why_cachyos.md
└── tsconfig.json

现在你可以开始添加你自己的翻译了。

作为最后一步,你希望你的翻译页面被索引,这同样是在我们的 astro.config.mjs 中完成的

// astro.config.mjs

    {
        label: 'Why CachyOS?',
        translations: {
        xx: '<why-cachyos-in-yourlanguage>',
        },
        link: 'cachyos_basic/why_cachyos',
    },

请参阅我们的基本指南,了解如何提交和推送更改。 完成后,您可以发起一个pull request

祝翻译愉快!

保持翻译最新

Lunaria 通过比较源文件(英文)的最后一次 git 提交日期与对应的翻译文件,来跟踪翻译页面是否最新。如果源文件的更新时间比翻译文件更近,则会在翻译页面的顶部显示“此页面已过期”横幅。

这意味着仅编辑翻译文件是不够的——更改必须提交,以便 git 记录新的修改日期。同样,每当英文源页面被更新并提交时,任何翻译版本都会开始显示过期横幅,直到其翻译也被更新并提交为止。