Skip to content

Commit

Permalink
Updated guide
Browse files Browse the repository at this point in the history
  • Loading branch information
Froxcey committed Jun 30, 2022
1 parent 4b04a84 commit 5702cd7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
20 changes: 19 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AvdanOS Website Contributing Guide

For translators, please see [translating guideline](https://github.com/Avdan-OS/Website/blob/dev/TRANSLATING.md) for more information.
If you are a translators, please see [translating guideline](https://github.com/Avdan-OS/Website/blob/dev/TRANSLATING.md) for more information.

## Prerequisite

Expand Down Expand Up @@ -66,6 +66,24 @@ git push

9. Create pull request on GitHub

## Using translation

You need to add this code to the beginning of your file

```js
import { TranslatableText } from "../locale/TranslatableText";
```

Then wrap your text in TranslatableText tag, like this:

```jsx
<TranslatableText>I will be translated</TranslatableText>
```

Then just wait for translators to add the translation

If the text has complicated structure and not just a string, leave it to senior devs and translator.

## Pull Requests

To make the review process faster, it's recommended to have list of changes in comment section and include screenshots if there are changes in the design. List of changes should be concise.
Expand Down
4 changes: 4 additions & 0 deletions TRANSLATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Find and open the locale file that you want to contribute to. You might want to

In `translation.set`'s parenthesis, there should be two quotes, separated by a comma. The quote at the left is the original text, in all lowercase. The quote at the left side of the command is the translated text. Type your translation in the quotation marks at the right side of the comma. DO NOT EDIT THE LEFT SIDE, IT WILL BREAK THE WEBSITE. If you see a line ended in `// don't translate this yet (technical issue)`, that means this quote is likely to change in the future due to change in how injection works. You can translate it, but it will not appear on the website and might get deleted in the future. If you see something like `[%s]`, `[%/s]`, or anything that's in bracket and contains a percent, maybe a slash, and a letter, it is an indicator for developers to do tricks like adding link or applying bold font. Please do not delete any indicator, and place them where appropriate in the translated string.

## Adding Your Translation

Find the right section, and add a line of `translation.set("original text","translated text")`. Original text should be exact match of the text, not half a sentence. If half of the link is link or has a different styling, translation will most likely not work. Please just submit a new bug report including a screenshot of where the translated text should be, what the original text is, which page it is on, and tag it with translation. Developers will take care of the rest, and you will just need to wait for a response. IMPORTANT: SEARCH CLOSED ISSUES BEFORE ADDING A NEW ONE.

## Adding Your Contribution

Now all you need to do is create a pull request, name it `Update [your locale] translation`, add optional comment, and tag it with translation. We will review your changes and most likely merge it.
Expand Down
6 changes: 2 additions & 4 deletions src/components/locale/TranslationRebuilder.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Link } from '@geist-ui/core';
import { Link, useTheme } from '@geist-ui/core';
import NextLink from 'next/link';

const TranslationRebuilder = (key: string, translatedSource: string) => {
Expand All @@ -15,12 +15,10 @@ const TranslationRebuilder = (key: string, translatedSource: string) => {
</NextLink>
</>
);
break;

default:
break;
return translatedSource;
}
};

export default TranslationRebuilder;
//

0 comments on commit 5702cd7

Please sign in to comment.