#32 Don't generate empty entries

Released
closed
5
2007-02-07
2005-10-21
Pasi Paasiala
No

When I've used the editor, I've sometimes had problems
with empty entries. For example, I set a path to an
icon file in the root resource and don't set it in
another locale. The other locale then has the same
entry, but it is empty. I think the point in resource
bundles is that you localize only the entries you need
to. The path to icon file is the same in each locale
and I don't want to copy it unnecessarily. So maybe
there should be a difference between "" and null empty.

Discussion

  • mauromol
    mauromol
    2006-06-16

    Logged In: YES
    user_id=1471819

    I agree with this point of view.

    Moreover, suppose I have three locales:
    - default
    - English
    - Italian
    My default language is English, so I would like to:
    - put localized entries in English in the 'default' property
    file
    - put localized entries in Italian in the 'Italian' property
    file
    While the 'English' property file needs to exist (otherwise
    the ResourceBundle lookup process failes when I specify
    Locale.ENGLISH as a locale), I don' want to make it a copy
    of the 'default' property file, while I prefer to leave it
    empty.

    By now, this is a bit unconfortable to do with
    ResourceBundleEditor: when I create a new entry, while
    leaving blank the localized text for the 'English' property
    file, ResourceBundleEditor inserts an empty entry in it and
    I have to manually remove it switching to the English
    property file tab.
    Moreover (and this is a little bug), when I switch back to
    the "Properties" tab, that entry has disappeared (even if I
    only deleted it in the 'English' property file, but not in
    the 'default' and 'Italian' ones) and I have to change che
    layout (from hierarchical to list and/or vice-versa) to make
    it appear again.

    Mauro.

     
  • Logged In: YES
    user_id=1207036

    Yes I agree. This is very annoying.

    Example : I modify an entry in default and one language.
    That does not mean that I want all other languages to be
    modified.
    So each time I change an entry I have to revert all other
    files in svn...

    I may use if you give me some clues...

    Thanks for all this good work BTW :o)

     
  • Logged In: YES
    user_id=1207036

    Sorry was of course "I may HELP if you give me some clues..."

    Jacques

     
  • Logged In: YES
    user_id=1207036

    To be clearer my exmaple should be :

    Example : I CREATE an entry in default and one language.
    That does not mean that I want all other languages to be
    modified.
    So each time I CREATE an entry in my language and default I
    have to revert all other files (sometimes dozen of them) in
    svn because they have an empty entry and they would better
    have nothing (hence would use default)

    Thanks

     
  • Logged In: YES
    user_id=1012642
    Originator: NO

    A solution has been added to CVS. Will be part of next release.

     
    • milestone: --> 450941
    • assigned_to: nobody --> essiembre
     
  • Logged In: YES
    user_id=1012642
    Originator: NO

    Implemented in release 0.7.6. Now a configurable option (not generating empty entries now being the default).

     
    • milestone: 450941 --> 494692
    • status: open --> closed
     
  • mauromol
    mauromol
    2007-02-05

    Logged In: YES
    user_id=1471819
    Originator: NO

    I just tried the new release, but apart from the fact that the new options seem not to be localized (in Italian, at least - but this is not a problem), I noticed two facts:

    1) when you try to delete a key, it is not removed from the tree (you have to switch the view from hierarchical to flat and vice-versa to have it go away); this is independent from the option to keep empty key entries
    2) if you choose not to keep empty key entries, when you save the editor deletes also other keys that you may have left empty on purpose (as "TODO" marks, for instance...); in other words, it would be nice to have the support for the distinction between "empty entries" and "null entries" (=> just these ones should be pruned away and/or never generated), as in NetBeans resource bundle editor
    3) whenever I save, the tree is reset and collapsed and it looses the selection paths... this is quite annoying and makes 0.76 release almost unusable

    Anyway, I would like to thank you very much for your effort and I hope for a great 0.77 version!

    Mauro.

     
    • milestone: 494692 --> 450941
    • status: closed --> open
     
  • Logged In: YES
    user_id=1012642
    Originator: NO

    Thanks for pointing those out. I feel quite bad to have missed those. Attached is a version with some fixes. The details:

    1) Key deletion now updates the tree properly.
    2) Unfortunately, making distinction between empty vs null properties will probably have to wait for the next major release (a rewrite I am working on).
    3) Upon saving, the last selection is now kept. The tree is otherwise redrawn. Again, the rewrite I am working should fix this as well (I have no target date for it yet).

    The text for the new features has not been localized in all languages yet. If you can help me with Italian, so much the better.

    Would you be kind enough to give that a go and let me know if everything behaves according to what I just described above. If you find any other issue that version 0.7.6 brought up, I will try to fix them quickly. I am hoping will then release 0.7.7 soon (with your feedback first, I hope).

    Thanks a lot.

    P.S. The attached version does not contain source, localization, or country flags, because of SourceForge attachment size limitations.
    File Added: ResourceBundleEditor_v0.7.6.fix001.zip

     
  • mauromol
    mauromol
    2007-02-06

    Logged In: YES
    user_id=1471819
    Originator: NO

    Dear Pascal, I tried your fix and the problems I mentioned are gone, thank you very much!

    Anyway, other minor issues are these:
    1) when you save, the selection path is now kept, but all the other expanded paths are collapsed: in other words, the tree does not keep the nodes expasion state as did before, except for the last selection path (I personally preferred the old behaviour)
    2) when you rename a key from the tree, that key looses the selection state; I cannot remember if that happened before, although I feel that it didn't

    Here is instead my little contribution for the Italian localization of the new options:

    General Resource Bundle Editor settings page:
    [Don't display the key tree within the editor] => Non mostrare l'albero delle chiavi all'interno dell'editor

    Format settings page:
    [Keep properties with empty values] => Mantieni le proprietà aventi valori vuoti

    Using the tree:
    [New] => Nuova

    Mauro.

     
  • Logged In: YES
    user_id=1012642
    Originator: NO

    The two issues you mention are known to me, and are targeted for the next major release/rewrite I am working on. Since they are more nuisances than show-stoppers, I leave them in for now and I will focus on making sure they are OK in the rewrite (not having enough time, I have to make choices).

    Thanks a lot for your time and the Italian translation. I will put those in and put a new release up.

     
    • milestone: 450941 --> Released
    • status: open --> closed
     
  • Logged In: YES
    user_id=1012642
    Originator: NO

    0.7.7 Released.

     
  • Logged In: NO

    Hi Pascal,
    today I tried 0.7.7 with the new Eclipse 3.3 (Europa) release.
    It seems to work well, except from the fact that the bug introduced with 0.7.6 regarding the tree expansion state on save (see my comment on 2007-02-05) has resurfaced :-(
    Unfortunately, this is very annoying... could you please have a look at it?

    By the way, any news about ResourceBundle Editor next major release, with extensive support of null/empty values?

    Thanks in advance.
    Mauro.

     
  • mauromol
    mauromol
    2007-07-03

    Logged In: YES
    user_id=1471819
    Originator: NO

    Sorry, the previous comment was mine, I forgot to login.
    Mauro.