[izpack-devel] Patch: Pack name in PacksPanel

Markus Schlegel schlm3 at gmail.com
Fri Jun 1 09:41:55 CEST 2007

The Packspanel shows the Pack-Id instead of the Pack-Name in the Packspanel,
if the user chooses the default language and the installer does not contain
a langpack for the defaultlanguage (thus the installer.xml contains the name
and description of the default language directly).

Attached a patch for this.

Notice, that I had a similar problem a while ago, and I think the API of
LocalDatabase could be improved by adding that method:

public String getString(String key, String default){
        String val = (String) get(key);
        if (val == null)  return default;
        else return val;

There are a enough callers of getString(key) that check (or maybe forget to
check) if the returnvalue is equal to key and have to alter it afterwards,
that legitimates that change.
I could also make this change in the trunk (replacing current calls like the
one in the patch and "PacksPanelBase.getI18NPackName(Pack)") if you like.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.berlios.de/pipermail/izpack-devel/attachments/20070601/979dba5f/attachment.html 
-------------- next part --------------
Index: C:/deron/3rdParty/IzPack_3.10/src/lib/com/izforge/izpack/panels/PacksModel.java
--- C:/deron/3rdParty/IzPack_3.10/src/lib/com/izforge/izpack/panels/PacksModel.java	(revision 1857)
+++ C:/deron/3rdParty/IzPack_3.10/src/lib/com/izforge/izpack/panels/PacksModel.java	(working copy)
@@ -303,7 +303,11 @@
-                return langpack.getString(pack.id);
+                String tmp = langpack.getString(pack.id); //TODO should really change this. Getting back the Key does not help.
+                if (pack.id.equals(tmp))
+                    return pack.name;
+                else
+                    return tmp;
         case 2:

More information about the izpack-devel mailing list