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

i18n, support internationalization #84

Open
nsb opened this issue Aug 25, 2023 · 3 comments
Open

i18n, support internationalization #84

nsb opened this issue Aug 25, 2023 · 3 comments
Assignees

Comments

@nsb
Copy link

nsb commented Aug 25, 2023

It would be great if we could specify translated strings for the embedded importer.

@ciminelli ciminelli self-assigned this Aug 25, 2023
@pintaf
Copy link

pintaf commented Mar 7, 2024

I'm using this library, I need to add support for french.
What do you think is the best approach?

❤️ configuring other languages as an option of createCSVImporter
Pros: No need to add a i18n library or having to handle PR for every new language supported
Cons: more complex use

🚀 handling different languages inside the component
Pros: could display automatically the text in the correct language depending on the browser language or could be overriden. More "Plug & Play"
Cons: having to handle different languages, etc. But could be simplified by the use of systems like crowdin.

What would you prefer? Vote with emojis !
Depending on the choice, I, or a colleague could work on implementing this.

@civan
Copy link
Collaborator

civan commented Mar 8, 2024

I'm using this library, I need to add support for french. What do you think is the best approach?

❤️ configuring other languages as an option of createCSVImporter Pros: No need to add a i18n library or having to handle PR for every new language supported Cons: more complex use

🚀 handling different languages inside the component Pros: could display automatically the text in the correct language depending on the browser language or could be overriden. More "Plug & Play" Cons: having to handle different languages, etc. But could be simplified by the use of systems like crowdin.

What would you prefer? Vote with emojis ! Depending on the choice, I, or a colleague could work on implementing this.

Hi @pintaf thanks for starting this conversation we were actually planning on working on a solution for i18n so this message comes in great timing, we were thinking on a mix of the solutions you mentioned:

  • Having predefined languages out of the box, starting with English as default, and the most used ones, available to select using a new prop locale=fr
  • Also giving the option to customize these languages exporting the keys for anyone to override them, this way it is more flexible and we don't need to support all languages, users can also rephrase and change the labels, ex:
// Set up custom translations
const customTranslations = {
  en: {
    greeting: 'Hello, {name}!',
  },
 es: {
    greeting: 'Hola, {name}!',
  },
  // other languages...
};

return(
  <CSVImporter language="es" translations={customTranslations}  ... />
)

Let me know what you think! I'm actually working on a POC and would gladly collaborate with you!

@pintaf
Copy link

pintaf commented Mar 11, 2024

looks great !

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

No branches or pull requests

4 participants