Proper application name in dialog informing for new updates

cusax-fix
Damian Minkov 18 years ago
parent b6791d6ca1
commit 093662bbb0

@ -1619,6 +1619,8 @@ javax.swing.event, javax.swing.border"/>
prefix="net/java/sip/communicator/plugin/updatechecker" />
<zipfileset dir="${resources}/languages/plugin/updatechecker"
prefix="resources/languages/plugin/updatechecker"/>
<zipfileset dir="${resources}" includes="application.properties"
prefix="resources"/>
</jar>
</target>

@ -29,9 +29,15 @@ public class Resources
private static final String LANG_BUNDLE_NAME
= "resources.languages.plugin.updatechecker.resources";
private static final String BUNDLE_APP_NAME
= "resources.application";
private static final ResourceBundle langBundle = ResourceBundle
.getBundle(LANG_BUNDLE_NAME);
private static final ResourceBundle APP_PROPERTIES_BUNDLE = ResourceBundle
.getBundle( BUNDLE_APP_NAME);
/**
* Returns an internationalized string corresponding to the given key.
@ -78,4 +84,24 @@ public static String getLangString(String key)
return null;
}
}
/**
* Returns an string corresponding to the given key.
*
* @param key The key of the string.
* @return An string corresponding to the given key.
*/
public static String getAppPropString(String key)
{
try
{
return APP_PROPERTIES_BUNDLE.getString(key);
}
catch (MissingResourceException e)
{
logger.error("Missing resources.", e);
return null;
}
}
}

@ -86,12 +86,12 @@ public void start(BundleContext bundleContext) throws Exception
String dialogMsg = MessageFormat.format(
Resources.getLangString("dialogMessage1"),
ver.getApplicationName());
Resources.getAppPropString("applicationName"));
if(lastVersion != null)
dialogMsg += MessageFormat.format(
Resources.getLangString("dialogMessage2"),
ver.getApplicationName(), lastVersion);
Resources.getAppPropString("applicationName"), lastVersion);
contentMessage.setText(dialogMsg);

Loading…
Cancel
Save