[izpack-devel] Tr : Re : Localizing InstallationGroupPanel

Loic lbndev at yahoo.fr
Mon Jun 25 17:37:09 CEST 2007


Lionel, Markus,

Last october I had set up a patch to be able to localize group names and posted it to izPack-devel. The patch hadn't been applied as there was ongoing work that would conflict. Fabrice is the one who could be more precise on what was going on (I never knew). Please see the forwarded messages below : you will find my patch and Fabrice's answer.

As far as I know, my patch has not been applied so far. Maybe Fabrice didn't have time to finish his solution, or simply forgot my patch. Either way, don't blame him, as we are all busy people and he spends a lot more time on this project than most of us do. And since I had build my own izPack, I didn't remind him after one last try in november (blame me for that if you want, but as I said, I sometimes get busy too).

Feel free to use this patch to build your own custom version of izPack. Please ignore the last few lines : they are obsolete. They allowed localization of the columns headers, which are now localizable in the latest version of IzPack.

Maintainers (Julien, Fabrice and others) : it looks like we are at least 3 to be looking forward to having this feature implemented. Could you please consider applying my patch again ? If yes, I will happily send you an up-to-date version, along with the relevant documentation patch. Of course, I will expect it to be promptly reviewed & committed in return. If you agree, please say it.

Loïc

----- Original message ----
De : Markus Schlegel <schlm3 at gmail.com>
À : izpack-users at lists.berlios.de
Envoyé le : Lundi, 25 Juin 2007, 12h12mn 15s
Objet : Re: [izpack-users] InstallGroups name

Groupnames can't be I18n'ed.
I'
d like to have translated them myself in my project, and I could also
make the need changes in the sources, but since my patches won't get
applied to the code base, I will save my time (I recently implemented a
sort-order for Installationgroups which has not been applied, no answer
at all received).


Maybe you can try the new hierarchical Packs (but they are not officially released I think).

Markus

2007/6/25, calimucho calimucho <
lionel.ramos.work at gmail.com>:Hi guys,

 

I'd try to do an internationalization with the name of the different 

installgroup in the InstallationGroupPanel but with the PacksLang

I don't find a solution...

Any ideas?

 

cheers,

lionel






----- Forwarded message ----
De : miraodb <miraodb at hotmail.com>
À : izpack-devel at lists.berlios.de
Envoyé le : Mercredi, 11 Octobre 2006, 15h47mn 33s
Objet : Re: [izpack-devel] Localizing InstallationGroupPanel

Hi Loic,

First of all ,thanks for the patch and the interest you put in IzPack. I've 
looked to your code and it seems pretty good. I have however to ask you to 
wait a bit till i can commit such thing. The main reason is that a comming 
future will probably solve that problem not only for this panel but for all 
of
 them. I'm still on it and i have yet not finish it nor documented it 
properly. Once it's there i'll  post the whole thing.

Cheers,
Fabrice.

PS: I keep your solution in mind, in case mine doesnt show up... :-(
PS N°2: If anyone is against that idea, say it loud :-)
----- Original Message ----- 
From: "Loic" <lbndev at yahoo.fr>
To: <izpack-devel at lists.berlios.de>
Sent: Wednesday, October 11, 2006 5:52 AM
Subject: [izpack-devel] Localizing InstallationGroupPanel


Hi,

Looks like the InstallationGroupPanel included in IzPack 3.9 is not 
localizable beyond the groups descriptions.
May I suggest the patch below to allow for some more localization (table 
colums headers, group names) ?

Thanks,

Loïc

--- InstallationGroupPanel-orig.java    2006-10-02 15:23:20.879057552 +0200
+++ InstallationGroupPanel-modif.java    2006-10-02
 15:43:44.785995416 +0200
@@ -325,7 +325,8 @@
                 if (data == null)
                 {
                     String description = getGroupDescription(group);
-                    data = new GroupData(group, description);
+            String gname = getLocalizedGroupName(group);
+                    data = new GroupData(gname,
 description);
                     installGroups.put(group, data);
                 }
             }
@@ -399,9 +400,51 @@
         return description;
     }

+    /**
+     * Look for a key = InstallationGroupPanel.group.[group] entry:
+     * first using idata.langpackgetString(key+".html")
+     * next using idata.langpack.getString(key)
+     * next using idata.getVariable(key)
+     * lastly, defaulting to group
+     * @param group - the installation group name
+     *
 @return the localized group name
+     */
+    protected String getLocalizedGroupName(String group)
+    {
+        String gname = null;
+        String key = "InstallationGroupPanel.group." + group;
+        if( idata.langpack != null )
+        {
+            String htmlKey = key+".html";
+            String html = idata.langpack.getString(htmlKey);
+            // This will equal the key if there is no entry
+            if( htmlKey.equalsIgnoreCase(html)
 )
+                gname = idata.langpack.getString(key);
+            else
+                gname = html;
+        }
+        if (gname == null)
+            gname = idata.getVariable(key);
+        if (gname == null)
+            gname = group;
+        try
+        {
+            gname = URLDecoder.decode(description,
 "UTF-8");
+        }
+        catch (UnsupportedEncodingException e)
+        {
+            emitWarning("Failed to convert localized group name", 
e.getMessage());
+        }
+
+        return gname;
+    }
+
     protected TableModel getModel(HashMap groupData)
     {
-        String[] columns = { "Selected", "InstallType", "Size"};
+        String[] columns = { 
idata.langpack.getString("InstallationGroupPanel.header.selection"),
+ 
idata.langpack.getString("InstallationGroupPanel.header.description"),
+
 
idata.langpack.getString("InstallationGroupPanel.header.size"};
+
          DefaultTableModel model = new DefaultTableModel (columns, 0)
          {
             public boolean isCellEditable (int row, int column)








		 
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
_______________________________________________
izpack-devel mailing list
izpack-devel at lists.berlios.de
https://lists.berlios.de/mailman/listinfo/izpack-devel







	
	
		
___________________________________________________________________________ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses 
http://fr.answers.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.berlios.de/pipermail/izpack-devel/attachments/20070625/5ea53f5b/attachment.html 


More information about the izpack-devel mailing list