This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 140907 - I18N - attribute not added since exception is thrown if translation of Unnamed has white space between the words
Summary: I18N - attribute not added since exception is thrown if translation of Unname...
Status: CLOSED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Diagram Class (show other bugs)
Version: 6.x
Hardware: All Windows Vista
: P2 blocker (vote)
Assignee: Trey Spiva
URL:
Keywords: I18N
: 128507 140197 148679 150942 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-07-20 15:52 UTC by gilbertowa
Modified: 2008-10-22 13:31 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Message error (in portuguese) (20.30 KB, image/jpeg)
2008-07-20 15:55 UTC, gilbertowa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gilbertowa 2008-07-20 15:52:24 UTC
Hi!

I'm trying to create a digrama of classes, but when I try to add an attribute (Shitf + Alt + A) or operation (Shitf +
Alt + M) in a class, it appears the message: "Invalid value !..." and then fail to add the attribute / operation
properly. This occurs with version 1.3.1 in Portuguese, could someone help?

Sorry, as always say, translated into English by Google .... :)
Comment 1 gilbertowa 2008-07-20 15:55:16 UTC
Created attachment 65063 [details]
Message error (in portuguese)
Comment 2 Sergey Petrov 2008-07-20 16:46:00 UTC
there was similar issue filed recently.
what's default name for a class right after creation in your case?
Comment 3 gilbertowa 2008-07-21 19:22:46 UTC
in both cases (class, attribute and operation) is the standard used "Não nomeado" (or "not named" in english).
Example:

When I add an attribute, appears "private int Não nomeado"
Comment 4 Sergey Petrov 2008-07-21 19:59:34 UTC
>p2, need to review the issue, it block some part of functionality
Comment 5 Trey Spiva 2008-07-24 15:47:05 UTC
I am wondering if it is because the localized name has a space in the name.  Since it is the name of a code construct it should not have any spaces.
Comment 6 Jeremie Bertolino 2008-07-24 17:37:57 UTC
This looks like pure localization issue.
However I'm able to see object class created with name "Não nomeado" in a basic UML project.

Could you please describe step by step how to reproduce?

Thanks!

Comment 7 Ken Frank 2008-07-24 17:45:16 UTC
seems like this needs to be fixed in the code; translations should be able
to be correct and valid, they should not need to be restricted just because
there is problem in the code.

or if this word is something that should not be translated at all,
mark with #NOI18N

wouldnt problem happen if any user changed attribute name to have
space in the words, or any other place where name of any element
could be edited ?

if so, then its not really about translation.

ken.frank@sun.com
Comment 8 Sergey Petrov 2008-07-24 18:13:04 UTC
basic project do not check names for java rules when java based uml poject have java restrictions/
easiest fix may be to mark "Unnamed" as //NOI18N
but may be it's better in name validation logic allow any name if it' the same as default/initial. this way shouldn't
break code generation as no code should be generated for elements with default name.
Comment 9 Trey Spiva 2008-07-24 19:55:10 UTC
I do not believe that this should be fixed in the code.  Since it is a value that is displayed to the user it should be localized.
Comment 10 Peter Lam 2008-07-24 20:43:52 UTC
And there's no issue in the code either because user would not be able to enter an identifier with space. The tool is
smart enough to not allow space being included in the smart in-line editor for both attribute and operation. If user
enter space using the properties window or through the project tree, an Invalid Value dialog pops up to warn user and
the new name will not be accepted.
Comment 11 Ken Frank 2008-07-24 21:17:58 UTC
Jeremie, its not an l10n issue; there has been other correspondance
outside of this issue thread here.

I do think Sergey comment of using NOI18N is the way to go;
this word IMO does not need to be translated, its just a placeholder
for what user will change it to if they want and users
know that these kind of identifiers names can be changed from reading
in general about uml help and usual uml diagram practice that names
of things can be changed - thus I don't think the word
Unnamed not being translated will have a negative impact.

ken.frank@sun.com


that is, I dont think the word Unnamed is forbidden ?





Comment 12 Sergey Petrov 2008-07-24 21:56:42 UTC
now I agree NOI18N may be better way, because not only easiest and regression safe fix, but also I miss we do not
support inline edition of identifiers with spaces, so if we will fix to allow creation of attribute with such identifier
we may got problem with editor and so on.
Comment 13 Ken Frank 2008-07-24 23:32:33 UTC
whats the scope of the problem - does it apply to just the class diagram or for other
elements and other diagram types (ie when some word is translated as two words and thus
triggers the exception) ?

other question - for short term solution, is there a workaround, that is, after exception
happens, are user allowed to use one word for the value and it works ok ?

for other solution, should it go into patch3, besides being fixed for 6.5 ?

ken.frank@sun.com
Comment 14 Ken Frank 2008-07-25 01:56:58 UTC
modifying synopsis a bit to describe about what happens and when -
and top clarify, this issue is not about the translation; the translation is correct.

ken.frank@sun.com
Comment 15 Masaki Katakai 2008-07-25 04:08:05 UTC
From the point of view of i18n users, "Unnamed" needs be localized.

Actually all 3 languages, ja, zh_CN and pt_BR are translating this now.
The problem is that space is not allowed in the translation. It may
depend on the language, Japanese and Chinese usually do not use a space,
but pt_BR does. So the problem happens in pt_BR now.

So, I suggest to put "#NOI18N" with the following comment. Just putting
"#NOI18N" is not good.

#NOI18N - can be localized but do not include a space

This comment can be a good notice to translators.

It's not a NOI18N string actually, but current l10n-kit will
contain only #NOI18N comments, other comments will be omitted at creation.
Comment 16 Jeremie Bertolino 2008-07-25 11:35:15 UTC
Below is list of files containing "n\u00e3o nomeado" and potentially harmful.

\pt_BR\uml5\uml-reporting\uml-reporting\org\netbeans\modules\uml\reporting\dataobjects\Bundle_pt_BR.properties
\pt_BR\uml5\uml-integration\uml-integration\org\netbeans\modules\uml\integration\ide\Bundle_pt_BR.properties
\pt_BR\uml5\uml\uml\org\netbeans\modules\uml\ui\products\ad\projecttreedefaultengine\Bundle_pt_BR.properties
\pt_BR\uml5\uml\uml\org\netbeans\modules\uml\core\preferenceframework\Bundle_pt_BR.properties
\pt_BR\uml5\uml\uml\org\netbeans\modules\uml\core\metamodel\core\foundation\Bundle_pt_BR.properties
\pt_BR\uml5\uml\uml\org\netbeans\modules\uml\core\configstringframework\Bundle_pt_BR.properties
\pt_BR\uml5\uml\uml\org\netbeans\modules\uml\core\Bundle_pt_BR.properties
\pt_BR\uml5\uml\uml\org\netbeans\modules\uml\common\Bundle_pt_BR.properties
\pt_BR\soa2\bpel-editors\bpel-editors\org\netbeans\modules\bpel\design\model\patterns\Bundle_pt_BR.properties
\pt_BR\profiler3\org-netbeans-lib-profiler-common\org-netbeans-lib-profiler-common\org\netbeans\lib\profiler\common\Bundle_pt_BR.properties
\pt_BR\java2\spring-beans\spring-beans\org\netbeans\modules\spring\beans\ui\customizer\Bundle_pt_BR.properties
\pt_BR\java2\spring-beans\spring-beans\org\netbeans\modules\spring\beans\completion\Bundle_pt_BR.properties
\pt_BR\ide9\xml-axi\xml-axi\org\netbeans\modules\xml\axi\Bundle_pt_BR.properties
Comment 17 Ken Frank 2008-07-25 18:17:53 UTC
several comments:

1. based on discussion with masaki, and to be in agreement with other views of translation team,
the fix for this should not be

to have comment in bundle file that says to make sure translation is just one word.
ie #NOI18N - can be localized but do not include a space

that is, translation team view is that the word should be translated but that there should not be restriction
on translations to need to limit some translation to just one word without spaces.

thus I do think the fix would need to be from uml team; in code or in stating that in this case,
the word Unnamed does not need to be translated; that its clear to user it would be changed
due to usual practice and that its higlighted, and in this case the #NOI18N comment line would
be the solution.  (then this situation would be same for any user who tries to use spaces in name)

ken.frank@sun.com

2. as to the fix, as mentioned, it could mean having a warning appear but not exception
when the label is first seeded in the attribute name area, the warning about not allowing
naming with spaces.

3. Jeremie, your list does show many places where word Unnamed is used; if there are other
such words used in uml area in which restriction is that there can't be spaces,
but where translations might result in 2 or more words with spaces, then it can increase
places where this problem would show.

ken.frank@sun.com


wheth
Comment 18 Trey Spiva 2008-08-07 21:51:01 UTC
Ok so I just want to make sure I understand the solution.  The development team will put #NOI18N - can be localized but do not include a space in the 
bundle file.  Is that all?  I did not quite understand what we need to do for number 2.
Comment 19 Ken Frank 2008-08-07 22:14:08 UTC
#2 was referring to discussion in issue about some other fix
to give warning in case #1 (NOI18N) was not done.

but if using #NOI18N then #2 can be ignored.

in this issue is mentioned some other uml files where word
Unnamed is translated - please check all uml bundle entries
that have Unnamed to see if some/all of those might need
the #NOI18N comment also.

ken.frank@sun.com
Comment 20 Ken Frank 2008-08-07 23:00:46 UTC
Trey,

I misread it a little -

if the solution is not to put a space but ok to translate rather
than completely not translating it - I'm not sure that was
ok since it means an artificial kind of translation and translation
shouldn't be restricted that way.

but if that is the solution, then the comment should be 

#NOI18N - PARTI18N - this is ok to translate but it should be only one word or if two words, no 
spaces between the words.


ken.frank@sun.com
Comment 21 Trey Spiva 2008-08-12 17:04:50 UTC
fixed

I have put the comment "#NOI18N - PARTI18N - this is ok to translate but it should be only one word or if two words, no 
spaces between the words" above the "Unnamed" keys.

http://hg.netbeans.org/uml-main/rev/2d7c16f25855 
Comment 22 Trey Spiva 2008-08-12 19:49:47 UTC
The one artifact in the configstirng framework bundle file must be a rendering artifact in the browser.  When you look at the dif in a text editor it is correct.
Comment 23 Ken Frank 2008-08-15 17:55:20 UTC
Peter,

lets wait for verification for when uml will next be translated - 
if thats not ok then since solution is straight forward, 
and is not problem using testing (which not use space)
then it could be verified even now.

ken.frank@sun.com
Comment 24 Peter Lam 2008-08-15 18:59:10 UTC
Ken, yes it can be waited until when it's appropriate to verify.
Comment 25 Jeremie Bertolino 2008-08-25 12:37:34 UTC
*** Issue 128507 has been marked as a duplicate of this issue. ***
Comment 26 Sergey Petrov 2008-09-18 15:23:42 UTC
*** Issue 140197 has been marked as a duplicate of this issue. ***
Comment 27 Yang Su 2008-09-30 00:27:59 UTC
*** Issue 148679 has been marked as a duplicate of this issue. ***
Comment 28 Sergey Petrov 2008-10-22 11:33:59 UTC
*** Issue 150942 has been marked as a duplicate of this issue. ***