Skip to content

Commit

Permalink
orb(ignite-cli): fix(boilerplate): upgrade i18n-js (#2735 by @lindboe
Browse files Browse the repository at this point in the history
…and @frankcalise)

* fix(boilerplate): upgrade i18n-js

* fix(boilerplate): i18n jest mock

* docs(intl): update adding languages with doc link

* docs(fix): RTL removal steps (a171eaec0034d868fd78ac8f2fc55c5c540b3351)
  • Loading branch information
infinitered-circleci committed Aug 13, 2024
1 parent a8788c7 commit fa9f34e
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 11 deletions.
49 changes: 45 additions & 4 deletions docs/ignite-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,52 @@ Prerequisites:

### Intro to Ignite

If you're new to Ignite, check out these resources:
#### Resources

- Check out the [Getting Started with Ignite](https://www.youtube.com/watch?v=KOSvDlFyg20) video for a 13 minute overview!
- Jamon's Code Quest on [What's new in Ignite 9](https://www.youtube.com/watch?v=QmkMsUYrTlk)
- Check out our [Guide](./Guide.md) for a walkthrough of the boilerplate project and how to use it
Here are a few videos / talks that introduce Ignite and show off some of its features. Check them out!

<table>
<tr>
<td width="50%">
<figure>
<a href="https://www.youtube.com/watch?v=KOSvDlFyg20">
<img src="https://img.youtube.com/vi/KOSvDlFyg20/sddefault.jpg" alt="Getting Started with Ignite" width="100%" /><br />
<figcaption><strong>Getting Started with Ignite</strong></figcaption>
</a>
</figure>
</td>
<td>
<figure>
<a href="https://www.youtube.com/watch?v=dNWkJOpD6YE&list=PLFHvL21g9bk0XOO9XK6d6S9w1jBU6Dz_U&index=16">
<img src="https://img.youtube.com/vi/dNWkJOpD6YE/sddefault.jpg" alt="Sweetening React Native Development With Ignite" width="100%" /><br />
<figcaption><strong>Ignite talk at Chain React 2024 - Robin Heinze</strong></figcaption>
</a>
</figure>
</td>
</tr>
<tr>
<td>
<figure>
<a href="https://www.youtube.com/watch?v=QmkMsUYrTlk">
<img src="https://img.youtube.com/vi/QmkMsUYrTlk/sddefault.jpg" alt="Jamon's Code Quest on Ignite 9" width="100%" /><br />
<figcaption><strong>What's new in Ignite 9</strong></figcaption>
</a>
</figure>
</td>
<td>
<figure>
<a href="https://www.youtube.com/watch?v=n_VjjJxyd8Q">
<img src="https://img.youtube.com/vi/n_VjjJxyd8Q/sddefault.jpg" alt="Jamon's Code Quest on MobX-State-Tree" width="100%" /><br />
<figcaption><strong>Intro to MobX-State-Tree</strong></figcaption>
</a>
</figure>
</td>
</tr>
</table>

#### Boilerplate Guide

Check out our [Guide](./Guide.md) for a walkthrough of the boilerplate project and how to use it

<table>
<tr>
Expand Down
19 changes: 12 additions & 7 deletions docs/ignite-cli/boilerplate/app/i18n/Internationalization.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,21 @@ Since Ignite already comes with an RTL language, Arabic, adding any new ones wou

To remove RTL support, follow the following steps:

1. `/app/i18n/i18n.ts`
1. In `/app/i18n/i18n.ts`

- remove your RTL `.json` file from the `i18n.translations` object
- remove lines 19-21 where we allow and force RTL on the native layer
- Remove your RTL language imports
- Remove references to those language objects
- Remove lines where we allow and force RTL on the native layer

2. remove all other associated logic that uses the exported `isRTL` variable
3. remove any `tx="some.i18n.key"` from your components and use `text="Some Text"` instead
```ts
I18nManager.allowRTL(isRTL)
I18nManager.forceRTL(isRTL)
```

2. Remove all other associated logic that uses the exported `isRTL` variable
3. Remove any `tx="some.i18n.key"` from your components and use `text="Some Text"` instead
(e.g. `<Text text="Some Text" />`

## Adding more languages

1. add your language `.json` file to `app/i18n/`, e.g. `app/i18n/fr.json`
2. update `app/i18n/i18n.ts` `i18n.translations` object to include the newly imported language, e.g. `i18n.translations = { en, "en-US": en, ja, fr }`
See the [i18n-js Documentation](https://github.com/fnando/i18n?tab=readme-ov-file#base-translations) to add languages to `app/i18n/i18n.ts`.

0 comments on commit fa9f34e

Please sign in to comment.