BaRatin-tools / BaRatinAGE

BaRatin Advanced Graphical Environment
https://baratin-tools.github.io/en/
GNU General Public License v3.0
4 stars 0 forks source link

Open/save dialog are not translated #7

Closed IvanHeriver closed 10 months ago

IvanHeriver commented 2 years ago

I noticed that the Open dialog (and probably all the other file related dialog) are always in english regardless of the computer's default locale and the language picked by the user.

open_bug

It seems to be a known issue with Java Swing File dialog. I think this is worth fixing (although I don't know yet what's the best approach). In any case, it will require additional entries in dico.txt:

JeromeLeCoz commented 2 years ago

A corriger en effet, mais ça ne me semble pas bloquant non plus (tout le monde est habitué à naviguer ainsi).

Par contre, plusieurs ont été déstabilisés / étonnés que la fenêtre "Enregistrer" propose "Open" au lieu de "Save" pour enregistrer une étude...

IvanHeriver commented 1 year ago

I now use the save dialog instead of the open dialog where relevant (see commit dd461df9fc0f8e8260ed9e437a38f24f267ca0c4 ).

Since translation of these dialog box isn't fully addressed (only the title is translated I think) I leave the issue open. It will be addressed in futur version of BaRatinAGE.

IvanHeriver commented 1 year ago

I identified the following keys for the UI manager that must be modified to correctly translate different parts of the open and save dialog boxes. It is not far from being exhaustive, but I believe there are still some missing pieces. Here it is, using french translations:

UIManager.put("FileChooser.openButtonText", "Ouvrir");
UIManager.put("FileChooser.lookInLabelText", "Rechercher dans");

UIManager.put("FileChooser.saveButtonText", "Sauvegarder");
UIManager.put("FileChooser.saveInLabelText", "Sauvegarder dans");

UIManager.put("FileChooser.cancelButtonText", "Annuler");
UIManager.put("FileChooser.cancelButtonToolTipText", "Annuler");

UIManager.put("FileChooser.fileNameLabelText", "Nom du fichier");
UIManager.put("FileChooser.filesOfTypeLabelText", "Type");
UIManager.put("FileChooser.acceptAllFileFilterText", "Tous les fichiers (*, *)");
UIManager.put("FileChooser.upFolderToolTipText", "Dossier parent");
UIManager.put("FileChooser.homeFolderToolTipText", "Bureau");
UIManager.put("FileChooser.newFolderToolTipText", "Créer un nouveau dossier");

UIManager.put("FileChooser.other.newFolder", "Nouveau");
UIManager.put("FileChooser.win32.newFolder", "Nouveau"); // default name of the folder

UIManager.put("FileChooser.refreshActionLabelText", "Actualiser");
UIManager.put("FileChooser.viewMenuLabelText", "Affichage");
UIManager.put("FileChooser.newFolderActionLabelText", "Nouveau dossier");

UIManager.put("FileChooser.renameErrorTitleText", "Impossible de renommer le fichier ou dossier");
UIManager.put("FileChooser.renameErrorText", "Impossible de renommer");
UIManager.put("FileChooser.renameErrorFileExistsText",
        "Un fichier ou dossier du même nom existe déjà ou le nom spécifié n'est pas valide");

UIManager.put("FileChooser.viewMenuToolTipText", "Affichage");
UIManager.put("FileChooser.listViewActionLabelText", "Liste");
UIManager.put("FileChooser.detailsViewActionLabelText", "Détails");

And there is also the following methods:

chooser.setDialogTitle("Sauvegarder");
chooser.setApproveButtonToolTipText("Sauvegarder dans le fichier sélectionné");
IvanHeriver commented 10 months ago

fixed in v3.