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 options missing #472

Open
AlexAndBear opened this issue Jul 29, 2024 · 3 comments
Open

i18n options missing #472

AlexAndBear opened this issue Jul 29, 2024 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@AlexAndBear
Copy link

Currently the svelte-jsoneditor is missing options for internationalization.

I am thinking of two ways, how this can be archived:

  • The package ships translations and the developer can set them via a translation prop, eg translation: 'de-De'
  • The package don't ship translations, but text can be overwritten eg: { texts: {searchFindText: 'Finden'}}
@josdejong
Copy link
Owner

josdejong commented Jul 30, 2024

Thanks for your suggestion Alex, it would be nice indeed to support internationalization!

I think the translations should be separate from the editor so the bundle doesn't include every translation, so I think the best API is to be something as follows.

<script>
  import { JSONEditor, languageDeDe } from 'svelte-jsoneditor'

  // here, languageDeDe can be something like:
  // { 
  //    id: 'de-De',  
  //    texts: { searchFindText: 'Finden' }
  // }
</script>

<JSONEditor language={languageDeDe} ... />

We can discuss in detail about the best API and namings for this. At least it should work with tree-shaking.

Help with this would be welcome! Any work should be done based on the v1 branch to prevent merge conflicts.

@josdejong josdejong added enhancement New feature or request help wanted Extra attention is needed labels Jul 30, 2024
@wang6128
Copy link

What version is expected to support multilingual support?

@josdejong
Copy link
Owner

There is no concrete planning for i18n support right now. This feature awaits help from an open source contributor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants