On 30.08.2020 22:19, michael michaud via Jump-pilot-devel wrote:
> 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

hmmm, ok now i understand. sounds it was never meant to work with external 
extensions but only loaders in core.

> - 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 ?

yeah, someone didn't have your use case in mind creating the code you 
described. not sure how to tackle this of the top of my hat.

still you should switch I18N implementations, if only to get rid of the I18N 
class in the future ;)

> -  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...

let me think on it and come back with a suggestion in some days. will need to 
have a more detailed look at it.

..ede


---

** [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 08:19 PM 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

Reply via email to