Eclipse NL Mechanism

amber
2007-07-25
2012-12-06
  • amber
    amber
    2007-07-25

    I'm very interested in being able to use this plug-in.  The plug-in overview [1] says that it "Supports Eclipse "nl" structure for I18N of plugins".  What does that mean exactly?  I was hoping to find some additional documentation on this site or in a help file, but the best I found was an old post[2] on this forum, but I'm still confused.  What do you consider the "Eclipse NL mechanism"?  I checked out the source for the resource bundle editor and see that messages.properties is in the project root and the translated files (still named messages.properties) are in nl\<language>\<country> folders.  I opened message.properties in the editor and it did not find the translations.

    My understanding of the eclipse recommendation for translated files is to put them in a separate bundle (a fragment, actually). This is, in fact, how the eclipse platform resource bundles are translated. I downloaded one of the language packs [3] and it has a bunch of fragments named org.eclipse.*.nl* and the messages.properties files are there and named messages_<language>_<country>.properties.

    I was hoping that the editor would search all projects in my workspace find them.  So for example if I have

    com.app
    - messages.properties

    com.app.nl
    - messages_de.properties
    - messages_fr.properties

    where com.app.nl is a fragment whose host is com.app that opening the editor for messages.properties in com.app would also show me the values in messages_de.properties and messages_fr.properties in com.app.nl.

    What is the expected behavior here?

    thanks,
    amber

    [1] - http://www.resourcebundleeditor.com/
    [2] - http://sourceforge.net/forum/message.php?msg_id=3323782
    [3] - http://europa-mirror1.eclipse.org/eclipse/downloads/

     
    • You are 100% quite correct that to truly support eclipse nationalization would mean reading files across fragments.  Right now, it will only support reading the NL structure if it is within the same project (look at the RBE plugin source for a sample).  It was simply a bad understanding of Eclipse NL support on my behalf that lead to that (otherwise supported) implementation.  I intend to fix that in the next major release to support the two approaches to NL (the one you describe should be preferred), but unfortunately, I can't predict when I will have the time to get to it.

       
    • amber
      amber
      2007-07-25

      Thanks.  Looking at the RBE plug-in source, I see how the .properties files are organized and how you are reading them in.

      Do you have any work done for loading the .properties files from various fragments?  Am I correct in thinking that it would just require implementing a new ResourceFactory?

       
      • Yes, you are correct, assuming the interface you would have to implement is not too rigid to prevent you from reading through other fragments.   Feel free to submit a patch.  But first, look at already submitted patches.  There is one that seems to do it.  I am simply lagging behind integrating those patches.  My bad.   I will try my best to get to those whenever I can.

         
    • amber
      amber
      2007-07-27

      Thanks!  I'll look through the submitted patches before I do anything.