Ede,
The I18NPlug class I use in csv may not be the best way to internationalize csv
extension, but the problem is not there.
I'll try to give a more complete description :
In OpenJUMP, SelectFilesOptionPanel internationalize option names as follows :
~~~
String label = I18N.get(loader.getClass().getName() + "."+ name);
~~~
But in case of extension like csv driver,
- I internationalize option names in the driver => SelectFilesOptionPanel try
to use these internationalized name as keys. It does not find any value for
these keys (especially in OpenJUMP language file), but as in this case, it uses
the key itself as a default value, everything looks OK in the UI (and a warning
is emitted because the key has not been found) -> it works, but it sounds
twisted
- If I do not translate option names in the extension, maybe I can do it from
SelectFilesOptionPanel with the categoryPrefixOrPath parameter (your suggestion
?), but how will SelectFilesOptionPanel know which categoryPrefixOrPath to use ?
- I thought that maybe it would be easier if SelectFilesOptionPanel was using
directly internationalized option name, so that it is the responsability of the
FileLoader to internationalize strings, not the responsability of
SelectFilesOptionPanel. But it means that Option names are internationalized
names. I'm not very comfortable with this idea either...
---
** [bugs:#499] SelectFilesOptionPanel and extensions**
**Status:** open
**Milestone:** undecided
**Created:** Sun Aug 30, 2020 09:43 AM UTC by michael michaud
**Last Updated:** Sun Aug 30, 2020 09:43 AM UTC
**Owner:** nobody
I think I found the cause of the I18N warnings emitted by csv driver (see
#494) :
SelectFilesOptionPanel handle internationalization of options, but in case of
extensions like csv, internationalization is embeded in the extension, so it is
already done when it arrives in SelectFilesOptionPanel.
It just emit warnings because SelectFilesOptionPanel don't find already
translated keys, but in this case, it uses the trick to return the key itself,
which is the already translated option name.
Not too bad, but not very clean. Wonder if SelectFilesOptionPanel shouldn't
suppose that option names are already I18N. Ede ?
---
Sent from sourceforge.net because jump-pilot-devel@lists.sourceforge.net is
subscribed to https://sourceforge.net/p/jump-pilot/bugs/
To unsubscribe from further messages, a project admin can change settings at
https://sourceforge.net/p/jump-pilot/admin/bugs/options. Or, if this is a
mailing list, you can unsubscribe from the mailing list.
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel