Open conky77 opened 1 week ago
@conky77 , JsonTools is not currently translatable. However, I believe that I could implement translation.
I can't add translation for everything; here is what I envision translating:
Pretty-print current JSON file
becomes Abbellisci il file JSON corrente
based on Google Translate)Submit query
becomes Inviare interrogativo
)sort_keys
would not change, but the description would change from Sort the keys of objects alphabetically when pretty-printing or compressing
to Ordina le chiavi degli oggetti in ordine alfabetico durante l'abbellimento o la compressione
Notably, I don't want to try to translate the text in message boxes. This might require calling up a translation API to translate an error message before rendering the message box, whereas what I'm proposing would just involve having some static JSON files with objects mapping a strings to the appropriate translation in another language.
I'll try to come up with an implementation today, add some documentation explaining how to make a pull request adding translation, and then you can add Italian translation if you like.
@molsonkiko thanks for answering. It should be ok. After the first translation, it would be clearer if it is possible to translate something more. If your work can be the starting for the creation of standard for plugin translation, it would be great.
In my most recent commit, I've added this JSON with comments file as a mockup of what users could edit to provide translation into other languages. The comments in the file should provide all the explanation that you need. Let me know if there's anything that I could make clearer.
I got hung up dealing with other issues today, so I wasn't able to implement the actual logic for translation yet, but I plan to do that tomorrow or the day after.
@molsonkiko I created the pull request #71 . Please let me know how to test it
I merged PR #71 so that I can use the JSON file for local testing. I'm still in the early stages of getting it to work; right now it seems like non-ASCII characters like ù
in the file are causing problems, but I'm sure I will find a workaround.
Thanks, in Italian the non-standard ASCII are: à, è, é, ì, ò, ù
I figured out an issue, which I will clarify in my next draft of the JSON:
The text for a menu item CANNOT have more than 63 characters (including whitespace) when encoded in UTF-16 (which should just mean 63 letters for your purposes, since all the Italian letters are in the Basic Multilingual Plane). The relevant line of code is here (it says the max length is 64, but that's including the terminating NUL character since it's for a C string), and since it's in the Notepad++ codebase there's nothing I can do (other than request that it be changed, which likely wouldn't work). If a menu item is too long, it could make Notepad++ refuse to start.
As it happens, you can easily check which menu items are too long by opening up the italian.json5
file in Notepad++, opening up the tree view for that file, and entering the query @.menuItems[s_len(@) >= 64]
, which selects all menuItems with 64 or more UTF-16 characters.
Right now the only menu item that is too long is your translation of Choose schemas to automatically validate &filename patterns
. Please come up with a new translation that is short enough. I came up with Convalida i file con schemi basati su modelli di nomi file
by playing around with Google Translate; do you think that is clear enough?
EDIT: To be clear; there's no reason for you to make another PR. You can just suggest a different translation here in the comments, and I'll make the change on my computer.
@molsonkiko for "Choose schemas to automatically validate &filename patterns", I propose this translation "Scegli lo schema per convalidare i &file JSON".
@conky77
I forgot to include the field for the toolbar_icons
setting in the settingsDescriptions
object. The English description is as follows:
Specify one of these chars for each toolbar icon you want to show, in the order you want:
('t' = tree view, 'c' = compress, 'p' = pretty-print, 'o' = path to current position)
This setting will take effect the next time you start Notepad++.
If you want there to be NO toolbar icons, enter a character that does not represent an icon; do NOT leave this field empty.
What do you think the Italian translation should be?
@molsonkiko
the translation is
Per ogni icona della barra degli strumenti, indica una delle seguenti icone nell'ordine desiderato: ('t' = visualizzazione ad albero, 'c' = compressione, 'p' = formatta, 'o' = Percorso della posizione corrente) Questa impostazione avrà effetto al riavvio di Notepad++. Per non visualizzare le icone nella barra degli strumenti, inserisci un carattere diverso dai precedenti; NON lasciare questo campo vuoto.
All translations need to be tested.
I saw you have already published a new version with the Italian translation: with the latest version of N++. Will this version of the plugin be able to be downloaded from plugin Manager? Since I have yet to test it, I would prefer not to.
I tested the plugin, and the settings appear not translated
@molsonkiko some of strings not translated (I could not have translated some strings or the program doesn't show the translation):
@molsonkiko If I change the language of N++ from Italian to English, I still see the menu in Italian. Nothing changes after Notepad++ restarting
"Choose folder to find json files" not translatable
I created a new pull request
I created a new pull request
You don't need to tell me when you submit a PR; I already get email notifications about that.
I tested the plugin, and the settings appear not translated
Correct. My documentation on translation reflects this.
I knew that Notepad++ 8.6.9 would be released soon, and I had to choose between having this new version of JsonTools appear in the Plugin Manager for that Notepad++ version and trying to fix every little outstanding problem with the plugin, and I chose to release this new version. I'm sorry if you disagree with this decision.
some of strings not translated (I could not have translated some strings or the program doesn't show the translation):
As my documentation notes, I do not plan to translate Error messages and message boxes
. Making all of that translatable would be more work than I am willing to put in.
"Choose folder to find json files" not translatable
No, and it won't be. This falls into the category of "message boxes and error messages" as far as I'm concerned, so it won't be translatable.
@molsonkiko If I change the language of N++ from Italian to English, I still see the menu in Italian. Nothing changes after Notepad++ restarting
@molsonkiko in case you didn't see this issue, since it was between other issues...
In case you changed your mind, the translations of settings would be very useful. (and warning messages as well)
If I change the language of N++ from Italian to English, I still see the menu in Italian. Nothing changes after Notepad++ restarting
See my response to #73 (now closed).
I would like to translate Json tools to Italian: is it possible?