On 30.08.2020 11:43, michael michaud wrote:
> 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 ?

you seem to utilize de.fho.jump.pirol.utilities.i18n.I18NPlug in 
fr.michaelm.jump.drivers.csv.CSVDriverConfiguration , which is some legacy I18N 
code i never modified apart from some logging changes. when the I18N class is 
not located in the same folder as the files they repectively cannot be loaded.
how about switching to the OJ com.vividsolutions.jump.I18N implementation.

i remember our com.vividsolutions.jump.I18N having a mechanism for extensions 
to provide the path to "their" language files. let me check.

ahh, wfs eg. has a small wrapper
  de.latlon.deejump.wfs.i18n.I18N

you could copy and modify that or simply provide a proper prefix, which looks 
like would be (untested ;9)
  new File("fr/michaelm/jump/drivers/csv/csv")
in your case. alternatively move the language files into a language/ subfolder 
of your package and rename them jump_<lang>.properties . then you can use the 
package name as prefix
  new String("fr.michaelm.jump.drivers.csv")

it's documented in de.latlon.deejump.wfs.i18n.I18N as follows

   * Get the I18N instance for a category or a path. The resource files are
   * resolved and at least one must exist in the classpath.
   *
   * Examples:
   *
   * categoryPrefixOrPath = new String("org.openjump.myplugin") then
   * resourcebundle is looked up as
   * /org/openjump/myplugin/language/jump[_locale].properties
   *
   * categoryPrefixOrPath = new File("language/wfs/messages") then
   * resourcebundle is looked up as /language/wfs/messages[_locale].properties


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

Reply via email to