-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
651 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Internationalization | ||
|
||
We want the official Bluesky app to be supported in as many languages as possible. If you want to help us translate the app, please reach out to us at [email protected] | ||
|
||
## Tools | ||
We are using Lingui to manage translations. You can find the documentation [here](https://lingui.dev/). | ||
|
||
### Adding new strings | ||
When adding a new string, do it as follows: | ||
```jsx | ||
// Before | ||
import { Text } from "react-native"; | ||
<Text> Hello World </Text> | ||
``` | ||
|
||
```jsx | ||
// After | ||
import { Text } from "react-native"; | ||
import { Trans } from "@lingui/macro"; | ||
<Text><Trans> Hello World </Trans></Text> | ||
``` | ||
|
||
We can then run `yarn intl:extract` to update the catalog in `src/locale/locales/{locale}/messages.po`. This will add the new string to the catalog. | ||
We can then run `yarn intl:compile` to update the translation files in `src/locale/locales/{locale}/messages.js`. This will add the new string to the translation files. | ||
The configuration for translations is defined in `lingui.config.js` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** @type {import('@lingui/conf').LinguiConfig} */ | ||
module.exports = { | ||
locales: ['en', 'cs', 'fr'], | ||
catalogs: [ | ||
{ | ||
path: '<rootDir>/src/locale/locales/{locale}/messages', | ||
include: ['src'], | ||
}, | ||
], | ||
format: 'po', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
msgid "" | ||
msgstr "" | ||
"POT-Creation-Date: 2023-11-05 16:01-0800\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=utf-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"X-Generator: @lingui/cli\n" | ||
"Language: cs\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
msgid "" | ||
msgstr "" | ||
"POT-Creation-Date: 2023-11-05 16:01-0800\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=utf-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"X-Generator: @lingui/cli\n" | ||
"Language: en\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
msgid "" | ||
msgstr "" | ||
"POT-Creation-Date: 2023-11-05 16:01-0800\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=utf-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"X-Generator: @lingui/cli\n" | ||
"Language: fr\n" |
Oops, something went wrong.