Skip to content

Refactor Internationalization #2906

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

Closed
wants to merge 17 commits into from
Closed

Conversation

branaust
Copy link

@branaust branaust commented Feb 25, 2025

Description

This PR reshapes the way we think about internationalization in ignite by introducing a new tool called TranslateSheet

What is TranslateSheet?

Built on top of the trusted i18next library, TranslateSheet combines developer-first workflows with powerful features, making localization easy for both new and existing apps

  • Inline Translation Definitions
    Define your app's translations directly in your components with a simple API. No more juggling massive external files during development – keep your translations organized and scoped by component or feature.

  • Hot reloading support
    One major issue with i18next is that it takes away the ability to quickly make a text change or add a new piece of text without completely restarting your app. TranslateSheet serves as a proxy on top of i18next, and for the first time gives you the optimal desired DX with the combination of both localization and hot-reloading support.

  • Full TypeScript Support
    Another pain point that comes with using i18next is type safety. The ignite boilerplate has done a great job filling the gaps by providing its own in-house type safety on all of its custom components with props such as tx and txOptions. With TranslateSheet, type safety comes baked in. There is no need for separate props on the components to define a translated string and the translated string options.

  • AI Translation
    For teams that want to serve their apps to users in other countries as fast as possible, quickly translate your app in over 200+ languages with a single command translate-sheet generate.

  • Translation CRM
    For teams that already have translation files (i.e. ignite boilerplate) and want to adopt the TranslateSheet CRM, push up all of your translation files with a single command translate-sheet push. Within seconds, your app's translations are accessible in a user-friendly interface making it incredibly easy to manage your app's text and hire professional translators to validate your text strings or add additional languages. You can provide context to your text strings via image or recording. Once approved, auto-open a PR (or merge to main) with your latest changes or manually pull them locally with the command translate-sheet pull

Screenshot 2025-02-25 at 1 00 20 PM

Ignite demo w/ TranslateSheet

Check out the demo for my 2025 App.js Conference Application

TranslateSheet Documentation

import ko from "./ko"

const resources: Resource = {
en: { language: "isPrimary" },
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

primary language is read directly from TranslateSheet.create objects. Need to have "en" listed in resources or else i18n doesnt pick up the primaryLanguage as a language option

Comment on lines +120 to +124
demoIcon: {
description:
"Un componente para dibujar un ícono pre-definido. Si se proporciona el atributo `onPress`, se rodea por un componente <TouchableOpacity />. De lo contrario, se rodea por un componente <View />.",
useCase: {
icons: {
Copy link
Author

@branaust branaust Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of the content from the demo files live in its respective main language file

@jamonholmgren
Copy link
Member

jamonholmgren commented Mar 15, 2025

Whew, @branaust, this is a tremendous amount of work -- thanks so much!

I like a lot of what I see. One thing though -- we (generally) can't merge new patterns into Ignite until we've shipped at least an app or two using this methodology and can solidly stand behind it.

But this work isn't wasted, at all. It gives us a great reference point to do so, when the time is right.

Would you be interested in taking this and turning it into an Ignite Cookbook recipe?

By the way, the conflicts look tiny, at least as of now.

@branaust
Copy link
Author

branaust commented Mar 15, 2025

@jamonholmgren firstly thanks for giving this a glance. Opening a massive pr on such a critically acclaimed repository is incredibly intimidating (which is mostly why it's remained in draft), but it was such a great opportunity to see what TranslateSheet could look like in a large codebase.

During my integration into Ingite, I did actually run into a couple of limitations which led me to make some updates to the library itself and I can now say that TranslateSheet is 100% compatible with the boilerplate!

I did not intend for this to get merged in right away, but more-so to use this as an opportunity to share what this library can offer and get some eyes from some of the best in the business to share their opinion.

I will absolutely add this as a recipe to the ignite cookbook.

TranslateSheet is an open source API and I welcome anyone who has opinions to take a look and contribute if they'd like!

Thank you to the infinite red team for all of your contributions to react-native and its community and God bless!

@ahmedrowaihi
Copy link

this is free ? I see a "billing" section on translationsheet dashboard

@branaust
Copy link
Author

branaust commented Mar 16, 2025

this is free ? I see a "billing" section on translationsheet dashboard

@ahmedrowaih the TranslateSheet API is and always will be free! The translation service/dashboard/hosting is free while in beta 😁 for the next few weeks you can use the translation API to translate your app in over 200+ languages

@ahmedrowaihi
Copy link

well, it looks aowesome ABC, I added a PR x'D

this is free ? I see a "billing" section on translationsheet dashboard

@ahmedrowaih the TranslateSheet API is and always will be free! The translation service/dashboard/hosting is free while in beta 😁 for the next few weeks you can use the translation API to translate your app in over 200+ languages

@branaust
Copy link
Author

@jamonholmgren I've moved this PR to the TranslateSheet org, opened up a PR to add this as a community recipe in the ignite cookbook recipes repo and have referenced the ignite + TranslateSheet repo in that recipe

@branaust branaust closed this Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants