Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update i18n.md #574

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/contributing/i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Currently, Actual Budget **is not yet ready** to receive community translations.

:::

## Current status
## Current Status

Actual is currently being prepared for internationalization (i18n). This means that initially everything in the app was English, but we're slowly marking all texts for translation.

## Marking for translation
## Marking for Translation

Developing translated software requires that every text shown to the user passes through a translation function. Actual uses [i18next](https://www.i18next.com/) to achieve this goal.

Expand All @@ -28,7 +28,7 @@ When preparing your translatable strings, please use complete units to translate

The translation framework provides two primary methods for translation:

### `t()` function
### `t()` Function

The `t()` function is the simplest form of translation, it accepts the text to be translated and an optional object with interpolation variables. We're using the `i18next` singleton instance. You can use the hook within React components to get a reference to it.

Expand Down Expand Up @@ -56,7 +56,7 @@ const manyItems = t('You selected {{count}} items', { count: 4 });

i18next will take care of proper pluralization rules in the currently active language and provide multiple different forms if required.

### `<Trans>` component
### `<Trans>` Component

When translating text with simple HTML tags or other React components, you will need to use the [`<Trans>` component](https://react.i18next.com/latest/trans-component).

Expand Down
Loading