csv-import
csv-import copied to clipboard
i18n, support internationalization
It would be great if we could specify translated strings for the embedded importer.
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.
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!
looks great !
This is now available with version 1.0.12
! Thanks to @civan for his work on this.
The documentation can be found here: https://github.com/tableflowhq/csv-import?tab=readme-ov-file#internationalization