Bug 186616 - I18N: "displayName" is used in both UI and generated codes
I18N: "displayName" is used in both UI and generated codes
Status: RESOLVED FIXED
Product: javafx
Classification: Unclassified
Component: Unsupported
6.x
All All
: P2 (vote)
: 6.x
Assigned To: David Kaspar
issues@javafx
: I18N
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-24 15:33 UTC by Masaki Katakai
Modified: 2010-05-24 17:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Masaki Katakai 2010-05-24 15:33:11 UTC
The following string is used for UI on properties window,

org/netbeans/api/javafx/composer/model/control/Bundle.properties:
     ButtonModel.action.displayName=Action

But it's also used in generated codes. When new action method is created,
the following codes are inserted. "Action" will be localized when
it's localized.

    function buttonAction (): Void {
        //TODO
    }

When it's localized, the code will be

    function button<Translation of Action> (): Void {
        //TODO
    }

We usually do not use multibytes in codes except string. Please separate the properties for UI and codes so that such localized strings will not be into the actual codes.

It looks other strings are also inserted into the generated codes, e.g.

./org/netbeans/api/javafx/composer/model/control/experimental/Bundle.properties:
  MenuModel.onHiding.displayName=On Hiding
  PopupMenuModel.onHiding.displayName=On Hiding
  MenuModel.onShowing.displayName=On Showing
  MenuModel.onShown.displayName=On Shown

It's not easy to understand which strings should be localized or not, so it's better to extract just UI strings into Bundle.properties file.
Comment 1 David Kaspar 2010-05-24 17:05:08 UTC
I am going to fix it ASAP. Meanwhile feel free to commit your I18N bundles.
Comment 2 David Kaspar 2010-05-24 17:50:06 UTC
Fixed in Composer repository as 100463976ca4 changeset. The change will be visible in next Composer continuous build.
Comment 3 David Kaspar 2010-05-24 17:58:44 UTC
The root cause of the issue is caused in properties.control.FieldPanel class and affects all properties. It took their display-name instead of field-name when generating code.

Currently the identified in generated code is composed as:

instanceNameOfTheComponent + fieldNameOfThePropertyOfTheComponent

optionally it may have a suffix in the following format:

"At" + selectedStateName

E.g. buttonAction or buttonActionAtNewState1

Note that the selectedStateName is entered by an user and is I18N as well. Its initial value is taken from "LBL_new_state_name" key in:
javafx.composer.design/org/netbeans/modules/javafx/composer/design/states/Bundle.properties
file.

Therefore there still may be a chance to have a multi-bytes character in the code.
If this is a problem we can remove the key from bundle (i.e. un-I18N it). Or just do not localize this single key.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo