Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout Editor i18n #1828

Merged
merged 42 commits into from
Aug 28, 2016
Merged

Layout Editor i18n #1828

merged 42 commits into from
Aug 28, 2016

Conversation

silverailscolo
Copy link
Contributor

Quite substantial reworking of the 3 Panel interface code
To prevent breaking access to resources, checked all usage in IDE and changed the most obvious ones to point to our basic set in NamedBeanBundle/Bundle/DisplayBundle
Clean up label style in pop ups/panes, respecting intentions of authors
Some German props, more to follow.

Beans Turnout/Sensor/Light/Block etc.
ButtonEdit/ButtonCancel
Use NBB key in LayoutEditor with if/else to keep name/type value intact
Comment duplicate keys in LE Bundle
Move existing translations to NBB
Fix Multisensor property value \n
use existing bundle keys for OK etc.
Fix Positionable Item Edit Dialog button bundle names
spelling errors
stray copies from other Bundles
move ButtonSet to jmri.NBB to be found
Clean up DisplayBundle
Clean up SpeedProfile Bundle button keys and error string
Move some keys to NBB
Clean up Maintenance strings
Fix BlockContentsIcon to use existing NBB keys
Mark NOI18N places
Fix ellipsis in Panel popup menus (only when a input dialog follows, never in pane title)
Move File/Edit menu keys to NBB, fix method to retrieve File menu in LE
Add spacing to LE icon popup menus
Text clean up of AppsBundle headers
# Conflicts solved:
#	java/src/apps/AppsBundle_de.properties
#	java/src/jmri/ConditionalVariable.java
#	java/src/jmri/NamedBeanBundle_ja_JP.properties
#	java/src/jmri/jmrit/Bundle_da.properties
#	java/src/jmri/jmrit/Bundle_it.properties
#	java/src/jmri/jmrit/beantable/BeanTableBundle_ca.properties
#	java/src/jmri/jmrit/beantable/BeanTableBundle_de.properties
#	java/src/jmri/jmrit/display/DisplayBundle.properties
#	java/src/jmri/jmrit/display/DisplayBundle_da.properties
#	java/src/jmri/jmrit/display/DisplayBundle_fr.properties
#	java/src/jmri/jmrit/display/DisplayBundle_it.properties
#	java/src/jmri/jmrit/display/DisplayBundle_ja_JP.properties
#	java/src/jmri/jmrit/display/palette/FamilyItemPanel.java
#	java/src/jmri/jmrit/display/palette/PaletteBundle.properties
Call color names by Bundle
insert button name as {0} in property
delete unused CPE keys in other languages
Clean up of label style in pop ups
Some German props
Props moved downstream to reuse
@silverailscolo
Copy link
Contributor Author

Preparing for more translations, rather clean up calls so properties can be reused multiple times from different packages than typing a translation for ‘Turnouts’ in 10 places (also: colors, buttons). Fixed a lot of misspelled property keys, which show up as (unused) stray translations. Hope I didn't erase existing stuff, tried to fix it or move it downstream. Will check when adding German. Still a bit of fine tuning to be done, so please label as WIP.

@rhwood
Copy link
Contributor

rhwood commented Aug 18, 2016

The Bundle class in any package automatically inherits all keys available to the Bundle class that is extended. So for example:

Since jmri.jmrit.display.Bundle extends jmri.jmrit.Bundle, any key made available by jmri.Bundle and jmri.jmrit.Bundle is also available to jmri.jmrit.display.Bundle (because jmri.jmrit.Bundle extends jmri.Bundle). A Bundle class with a "null" name does not provide any keys of its own, but does provide the keys of the Bundle(s) that it extends. A Bundle with a non-null name field provides the keys in the named properties file.

All Bundle classes ultimately extend jmri.Bundle, so anything in jmri/NamedBeanBundle.properties is available to every class in JMRI (i.e., you don't need (or want) the FileMenu key in apps/AppsBundle.properties, since the FileMenu key is also in jmri/NamedBeanBundle.properties).

@@ -3,7 +3,7 @@
# Default properties for the apps package of jmri.

# general menu items
#MenuFile = File
MenuFile = File
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This overrides the MenuFile key in jmri/NamedBeanBundle.properties, and should be commented out or removed.

Color defaultLabelBackground = backgroundColorPanel.getBackground();
_backgroundcolors = new String[_fontcolors.length + 1];
for (int i = 0; i < _fontcolors.length; i++) {
_backgroundcolors[i] = _fontcolors[i];
}
_backgroundcolors[_backgroundcolors.length - 1] = "None";
_backgroundcolors[_backgroundcolors.length - 1] = Bundle.getMessage("ColorClear"); // I18N using Bundle.getMessage("ColorClear");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a literal that gets stored in a panel.xml file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's stores as hasBackground="yes" redBack="255" greenBack="255" blueBack="255" so no problem.
However, in the present code when you choose Clear as the bg color in the popup menu of a Sensor Icon (i.e. to remove a background color), instead it saves as the color of the background (works as expected storing Clear/None with a "Sensor text icon").

@rhwood
Copy link
Contributor

rhwood commented Aug 18, 2016

@silverailscolo Despite all the comments, thanks for doing this.

@silverailscolo
Copy link
Contributor Author

I used the key inheritance where I could. It's the older method of reading the whole resource at the start and then using rb.getString(key) that breaks when you move the key.
Will look into the issues spotted, thanks for the pointers.

Comment AppsBundle MenuFile/EditFile keys in all translations (checked they're in NBBundle)
Tested workings of ColorClear in color popup (en & de)
Remove unused X/Y keys
move left/right keys from Palette to Bundle
Clean up LogixTableBundle unused keys
Move FastClock key to NBB, point LogixBndl and LEBndl there
Comment out unused keys in DisplayBndl (probably copied from LEBndl)
German translation of ControlPanelBundle keys (50%)
Move Length key from several Operations Bundles to jmrit/Bundle
Rename LE key from lower case length to Length and use Bundle.getMessage() method
Add variable for button title to CPE DrawFrame instruction text
TitleScheduleEdit = \u4FE1\u53F7\u6A5F {0}\u306E\u30B9\u30B1\u30B8\u30E5\u30FC\u30EB\u7DE8\u96C6
TitleScheduleAdd = \u30B5\u30A4\u30C7\u30A3\u30F3\u30B0 {0}\u306E\u30B9\u30B1\u30B8\u30E5\u30FC\u30EB\u3092\u8FFD\u52A0
TitleSchedulesTable = \u30B9\u30B1\u30B8\u30E5\u30FC\u30EB
TitleLocationsTable = \u30ed\u30b1\u30fc\u30b7\u30e7\u30f3
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was unaware all these translations were stored as upper case escapes. Following agreed styling, but this will hide the original edits. The real change to each is limited to commenting out the Length key (moved to jmrit.Bundle to be shared with Panels end Tables).

Use elipsis as variable in CPE menu & pane names
Remove elipsis from menu item when there is a drop down choice
Point Operations panes to Bundle for Length key
Remove empty keys created by IDE
Replace german translation "belegt"  by more common "besetzt" (not for Warrants)
Move Cut/Copy/Paste menu item keys to NBBundle (to be accessible from /display)
Put Detection Sensor (translation) as variable in instruction, move key to DisplayBundle
Fix Warrant help urls
using Bundle.getMessage
# Conflicts:
#	java/src/jmri/jmrit/Bundle.properties
Insert button/field names as variables in translations
Fix missing/unwanted elipsis
Fix Bundle call of length>Length in Track Circuit pane
@bobjacobsen
Copy link
Member

Is this still,work-in-progress (around Bundle use and encoding) or is it ready to merge?

Fix Bundle call of color popup in LE Edit Track
Correct label for detection sensor in Palette
Some German translations
@silverailscolo
Copy link
Contributor Author

I hope to complete the translation and conversion of the Control Panel Bundle this weekend, after which this may be merged. Prefer to do some more manual testing because of the interdependencies with the other Display interfaces.

Comment out unused Signal keys
Fix LE spelling
Fix Circuit Path length unit switch tooltip
@silverailscolo
Copy link
Contributor Author

May be merged, WIP removed.

@rhwood rhwood added this to the 4.5.4 milestone Aug 28, 2016
@rhwood rhwood added Enhancement and removed WIP labels Aug 28, 2016
@rhwood rhwood merged commit 830e90d into JMRI:master Aug 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants