jsoneditor
jsoneditor copied to clipboard
How to display Chinese in valid message
1.I set schema but how to display Chinese in valid message(can integrated i18n?) 2.How to add a new button to the menu & call custom function(form mode,not onCreateMenu)
-
There is a Chinese translation already available. See docs on
language
andlanguages
https://github.com/josdejong/jsoneditor/blob/develop/docs/api.md. There is also an example showing how to create your own translation. Is that what you mean? -
Which menu do you mean? The main menu (on top) or the context menu that you can open for every node?
- display Chinese translation like schema vaild message in ajv error tips,It is better to synchronize with the jsoneditor language attribute.
- I want to add a save button on main menu , no attribute to do this.
- when i set schema like
"app_key" : {[ "type":"string", "minLength":1 ]}
input number of value,call getText() method can auto change the value to string? now getText : {app_key:123}
hope getText: {app_key:"123"}
all about in form mode,Thanks
- That's an interesting idea. I did have a short look, there is support for it via ajv-i18n. Anyone interested to look into hooking up
ajv-i18n
with thejsoneditor
localization? - There is indeed no API for it, though after creating the JSONEditor you can quite easily find the menu
div
(has a classjsoneditor-menu
) using aquerySelector
, and then append (or prepend) your own button there with plain JavaScript. - Yes, that would indeed be nice. I think a solution for this idea is discussed in #862, is that correct?
That's an interesting idea. I did have a short look, there is support for it via ajv-i18n. Anyone interested to look into hooking up ajv-i18n with the jsoneditor localization?
I have made this PR - #1244.
Thanks @askalione 👍