Skip to content
Permalink
Browse files

fix powerline bundles

  • Loading branch information...
silverailscolo committed May 17, 2019
1 parent 2549f26 commit 82f4a9a826b9690e9cc5149f3a0fd6975d47b152
@@ -10,6 +10,9 @@ PlDeviceConnectionTitle = Powerline Device Connection
MenuItemCommandMonitor = Communications Monitor
MenuItemSendCommand = Send Command

# serialmon and packetgen shared keys, no need to copy in other languages if untranslated
DefaultTag = Powerline_

# PowerlineTurnout/Light/Sensor (Add to table pane) items
AddOutputEntryToolTip = A3 (Output House code A + device 3)<br>\
House code: A-P, device 1-16 (inclusive).

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -24,7 +24,7 @@
public class Bundle extends jmri.jmrix.powerline.swing.Bundle {

@Nullable
private static final String name = null; // No local resources
private static final String name = "jmri.jmrix.powerline.swing.packetgen.SerialPacketGenBundle"; // NOI18N

//
// below here is boilerplate to be copied exactly
@@ -6,6 +6,4 @@ SendPacketTitle = Send Powerline device message
InterlockBoxLabel = Interlock
Title = Command Generator

DefaultTag = Powerline_

#Log and Error Messages
@@ -1,11 +1,7 @@
# SerialPacketGenBundle.properties
#
#
#
# Default properties for the Powerline Swing Modules
# SerialPacketGenBundle_da.properties
#
# Danish properties for the Powerline Swing Modules

#Log and Error Messages

Title = Command Generator
DefaultTag = Powerline_
@@ -1,14 +1,8 @@
# SerialPacketGenBundle.properties
#
#
#
# Default properties for the Powerline Swing Modules
#
#
# Italian translation: Enzo Fortuna (babbo_enzo@yahoo.com )
# SerialPacketGenBundle_it.properties
#
# Italian properties for the Powerline Swing Modules
# Translation: Enzo Fortuna (babbo_enzo@yahoo.com )

#Log e Messaggi di Errore

Title = Generatore Comandi
DefaultTag = Powerline_
@@ -0,0 +1,98 @@
package jmri.jmrix.powerline.swing.serialmon;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Locale;
import javax.annotation.CheckReturnValue;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;

@ParametersAreNonnullByDefault
@CheckReturnValue
@SuppressFBWarnings(value = "NM_SAME_SIMPLE_NAME_AS_SUPERCLASS", justification = "Desired pattern is repeated class names with package-level access to members")

@javax.annotation.concurrent.Immutable

/**
* Provides standard access for resource bundles in a package.
*
* Convention is to provide a subclass of this name in each package, working off
* the local resource bundle name.
*
* @author Bob Jacobsen Copyright (C) 2012
* @since 3.3.1
*/
public class Bundle extends jmri.jmrix.powerline.swing.Bundle {

@Nullable
private static final String name = "jmri.jmrix.powerline.swing.serialmon.SerialMonBundle"; // NOI18N

//
// below here is boilerplate to be copied exactly
//
/**
* Provides a translated string for a given key from the package resource
* bundle or parent.
* <p>
* Note that this is intentionally package-local access.
*
* @param key Bundle key to be translated
* @return Internationalized text
*/
static String getMessage(String key) {
return getBundle().handleGetMessage(key);
}

/**
* Merges user data with a translated string for a given key from the
* package resource bundle or parent.
* <p>
* Uses the transformation conventions of the Java MessageFormat utility.
* <p>
* Note that this is intentionally package-local access.
*
* @see java.text.MessageFormat
* @param key Bundle key to be translated
* @param subs One or more objects to be inserted into the message
* @return Internationalized text
*/
static String getMessage(String key, Object... subs) {
return getBundle().handleGetMessage(key, subs);
}

/**
* Merges user data with a translated string for a given key in a given
* locale from the package resource bundle or parent.
* <p>
* Uses the transformation conventions of the Java MessageFormat utility.
* <p>
* Note that this is intentionally package-local access.
*
* @see java.text.MessageFormat
* @param locale The locale to be used
* @param key Bundle key to be translated
* @param subs One or more objects to be inserted into the message
* @return Internationalized text
*/
static String getMessage(Locale locale, String key, Object... subs) {
return getBundle().handleGetMessage(locale, key, subs);
}


private final static Bundle b = new Bundle();

@Override
@Nullable
protected String bundleName() {
return name;
}

protected static jmri.Bundle getBundle() {
return b;
}

@Override
protected String retry(Locale locale, String key) {
return super.getBundle().handleGetMessage(locale,key);
}

}
@@ -1,11 +1,7 @@
# SerialPacketGenBundle.properties
#
#
# SerialMonBundle.properties
#
# Default properties for the Powerline Swing Modules
#

#Log and Error Messages

Title = Communication Monitor
DefaultTag = Powerline_
@@ -1,11 +1,7 @@
# SerialPacketGenBundle.properties
#
#
#
# Default properties for the Powerline Swing Modules
# SerialMonBundle_da.properties
#
# Danish properties for the Powerline Swing Modules

#Log and Error Messages

Title = Communication Monitor
DefaultTag = Powerline_
@@ -1,13 +1,8 @@
# SerialPacketGenBundle.properties
#
#
#
# Default properties for the Powerline Swing Modules
#
# Italian translation: Enzo Fortuna (babbo_enzo@yahoo.com )
# SerialMonBundle_it.properties
#
# Italian properties for the Powerline Swing Modules
# Translation: Enzo Fortuna (babbo_enzo@yahoo.com )

#Log e Messagi di Errore
# Log e Messagi di Errore

Title = Monitor Comunicazioni
DefaultTag = Powerline_
@@ -8,17 +8,15 @@
import jmri.jmrix.powerline.swing.PowerlinePanelInterface;

/**
* Swing action to create and register a MonFrame object
* Swing action to create and register a MonFrame object.
*
* @author Bob Jacobsen Copyright (C) 2001, 2008 copied from Ecos and converted
* to Powerline
* @author Ken Cameron Copyright (C) 2011
*/
public class SerialMonPane extends jmri.jmrix.AbstractMonPane implements SerialListener, PowerlinePanelInterface {

ResourceBundle rb = ResourceBundle.getBundle("jmri.jmrix.powerline.swing.serialmon.SerialMonBundle");

public SerialMonPane() {
public SerialMonPane() {
super();
}

@@ -33,10 +31,10 @@ public String getTitle() {
if (memo != null) {
x.append(memo.getUserName());
} else {
x.append(rb.getString("DefaultTag"));
x.append(Bundle.getMessage("DefaultTag"));
}
x.append(": ");
x.append(rb.getString("Title"));
x.append(Bundle.getMessage("Title"));
return x.toString();
}

0 comments on commit 82f4a9a

Please sign in to comment.
You can’t perform that action at this time.