josdejong / svelte-jsoneditor

A web-based tool to view, edit, format, repair, query, transform, and validate JSON
https://jsoneditoronline.org
Other
899 stars 109 forks source link

i18n options missing #472

Open AlexAndBear opened 2 months ago

AlexAndBear commented 2 months ago

Currently the svelte-jsoneditor is missing options for internationalization.

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

josdejong commented 2 months ago

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.

wang6128 commented 1 week ago

What version is expected to support multilingual support?

josdejong commented 1 week ago

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