Chuyển đến nội dung

Contribute to dots-hyprland-wiki

Nội dung này chưa có trong Tiếng Việt

The repo of this doc site is here and it’s open to contribution.

We sincerely thank all contributors.

What to contribute

You’re welcomed to submit any kind of beneficial Pull Request, though it’s our final decision to merge it or not.

If you’re unsure about a possible PR, you may create a Discussion before you work on it.

Here are some common types of contribution:

Translation

This site has i18n support, and we need your help to finish l10n (i.e. translation).

Content

Typically, if you have successfully contributed a new function/workflow/… to dots-hyprland, and if it needs documentation, then you’re very welcomed to submit a PR here to document it.

Troubleshooting related contents are also welcomed.

Please see here for reference, including how to preview the site (i.e. start local dev server).

How to contribute

The following steps details on how to contribute using Git and GitHub.

You must have a GitHub account to proceed.

Setup GitHub SSH

See GitHub Docs for instructions.

Or, to ensure that you have GitHub SSH configured well on your local machine, run ssh -T git@github.com in terminal, and if you see:

Hi <Your GitHub username>! You've successfully authenticated, but GitHub does not provide shell access.

Then you’re all set.

Get this repo

Fork this repo online, and then git clone the forked repo to your local machine.

Make changes (with l10n example)

cd to the folder of the cloned repo so that you can make futher changes.

As for l10n (translation), follow the steps below:

Manage locales

On your local machine, go to the forked repo, edit astro.config.mjs and find the languages under locales: .

If your language is not listed or is commented, add your language. Example:

astro.config.mjs
...
locales: {
'en': {
label: 'English', // Engligh
lang: 'en',
},
'zh-cn': {
label: '简体中文', //Simplified Chinese
lang: 'zh-CN',
},
...

You may also add translation for the labels on sidebar under the sidebar: . Example:

astro.config.mjs
...
sidebar: [
{
label: 'General',
translations: {
'zh-CN': '通用',
},
autogenerate: { directory: 'general' },
},
...

You should also translate the message in l10n-notify.json, e.g. for zh-CN:

l10n-notify.json
{
"en": "This page is an outdated translation. The original version in English was last updated on: ",
...
"zh-cn": "此页面的翻译已过时。其英语原文的最新版本的时间是:",
...
}

Translate pages

Go to directory src/content/docs/.

  • Source language (English): src/content/docs/en/.
  • Target language (your language): src/content/docs/<lang>/.

If target language directory does not exists, mkdir to create it first.

Target language directory has exact the same folder structure and filename as the source language directory, and non-existing files and directory in target language directory will fallback to source language (English).

E.g. for Simplified Chinese, src/content/docs/zh-cn/general/showcase.md is the translated version of src/content/docs/en/general/showcase.md.

After you’ve finished translation for a document:

  1. Update the value of lastUpdated entry in frontmatter to your current time in yyyy-mm-dd, e.g. lastUpdated: 2024-02-18.
  2. If you see the “caution[l10n-notify]” lines at the top of it, please delete these 3 lines.

Example:

foo.md
---
title: 示例文档
sidebar:
label: 示例
lastUpdated: 2024-02-16
lastUpdated: 2024-02-18
---
:::caution[l10n-notify]
此页面的翻译已过时。其英语原文的最新版本的时间是:2024-02-17
:::

Translate UI (Optional)

Starlight UI already has built-in translation for some languages. You may still translate to override it if you think it’s necessary.

  • The source file in English: see here.
  • To translate, edit the file under src/content/i18n/, eg. for Simplified Chinese: src/content/i18n/zh-CN.json.

Upload changes

When you’ve finished making changes to the repo:

  • git add . to track untracked changes under current directory.
  • git status to re-check what you have changed.
    • If you have unexpectedly changed a file, run git restore <file> to restore it.
  • git commit -m '<Commit message>' to commit the tracked changes with your customed <Commit message>.
  • git push to push new commits to the repo on GitHub.

Create a Pull Request

Go to the forked repo online, click on Contribute and then Open pull request to submit a Pull Request.

Remember to detail what you have done when you submit. E.g. if you’ve done translation, tell which language you have translated to.