[OpenMap Users] i18n?

From: Carsten Ø. Madsen <com_at_navicon.dk>
Date: Fri, 16 Dec 2005 17:07:45 +0100

Hi

I'm in the process of translating the parts of OM I'm using to danish. I
have been patching OM using the I18n class. Now I have a problem with
LocationLayer and the GUI it generates when acessed from the layer
editor. The code goes like this:

  protected I18n i18n = Environment.getI18n();

    /**
     * Provides the palette widgets to control the options of showing
     * maps, or attribute text.
     *
     * _at_return Component object representing the palette widgets.
     */
    public java.awt.Component getGUI() {
        if (box == null) {
            box = Box.createVerticalBox();
            int nHandlers = 0;

            if (dataHandlers != null) {
                nHandlers = dataHandlers.length;
            }

            JPanel[] panels = new JPanel[nHandlers];
            Box box2 = Box.createVerticalBox();
            for (int i = 0; i < nHandlers; i++) {

                String handlerName;
                if (dataHandlerNames != null && i <
dataHandlerNames.length) {
                    handlerName = dataHandlerNames[i];
                } else {
                    handlerName = "";
                }

                panels[i] = PaletteHelper.createPaletteJPanel(handlerName);
                panels[i].add(dataHandlers[i].getGUI());
                // box.add(panels[i]);
                box2.add(panels[i]);
            }

            JScrollPane scrollPane = new JScrollPane(box2,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);

            scrollPane.setAlignmentX(java.awt.Component.CENTER_ALIGNMENT);
            scrollPane.setAlignmentY(java.awt.Component.TOP_ALIGNMENT);

            box.add(scrollPane);

            if (declutterMatrix != null) {
                JPanel dbp = new JPanel(new GridLayout(0, 1));
                //JCheckBox declutterButton = new JCheckBox("Declutter
Names", useDeclutterMatrix);
                JCheckBox declutterButton = new JCheckBox(i18n.get(this,
"declutterNames", "No info found!"), useDeclutterMatrix);


                declutterButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent ae) {
                        JCheckBox jcb = (JCheckBox) ae.getSource();
                        useDeclutterMatrix = jcb.isSelected();
                        if (isVisible()) {
                            doPrepare();
                        }
                    }
                });
                //declutterButton.setToolTipText("<HTML><BODY>Move
location names so they don't overlap.<br>This may take awhile if you are
zoomed out.</BODY></HTML>");
        declutterButton.setToolTipText(i18n.get(this, "declutterNames",
I18n.TOOLTIP, "Delutter Names"));

                dbp.add(declutterButton);
                box.add(dbp);
            }
        }
        return box;
    }

and in my I18N.properties

LocationLayer.declutterNames=Declutter Names XXX
LocationLayer.declutterNames.tooltip=<HTML><BODY>Move location names so
they don't overlap.<br>This may take awhile if you are zoomed
out.</BODY></HTML>

and I18_da_DK.properties

LocationLayer.declutterNames=Declutter Navne
LocationLayer.declutterNames.tooltip=<HTML><BODY>Flytter rundt p\u00E5
labels s\u00E5 de ikke overlapper.<br>Hvis du er zommet ud og der er
mange labels kan det være tidskrævende.</BODY></HTML>

Not matter what LANG is I always get "No info found!" back from the i18n
thing.

Any ideas?

/carsten








Don Dietrick wrote:

> Hi John,
>
> There is one in the beta, you need to add it to the
> openmap.properties file as an openmap.component.
>
> You might want to update the cvs tree for that, I just checked in
> some improvements to the mode yesterday.
>
> - Don
>
> On Dec 15, 2005, at 12:47 PM, John Pearson wrote:
>
>> Got it all downloaded, rebuilt & working.
>>
>> I was wondering, in the next release will there be some sort of
>> sticky hand
>> pan mode? I've seen references in the mailing list of people
>> working on
>> this/wanting it...
>>
>> JP
>>
>> -----Original Message-----
>> From: owner-openmap-users_at_bbn.com [mailto:owner-openmap-
>> users_at_bbn.com]On
>> Behalf Of Don Dietrick
>> Sent: Wednesday, December 14, 2005 8:34 PM
>> To: John Pearson
>> Cc: Openmap-Users
>> Subject: Re: [OpenMap Users] Starting OpenMap
>>
>>
>> Hi John,
>>
>> You need a CVS client (there are several available for free, just
>> Google), configured as described on the download page near where you
>> found the link for the beta.
>>
>> Once you set up the 'cvs root', you do a 'checkout' to initially get
>> the code downloaded onto your machine. Then you can 'update' to
>> merge any changes into your files at later dates.
>>
>> - Don
>>
>>
>> On Dec 14, 2005, at 5:46 PM, John Pearson wrote:
>>
>>> What do I need to have in order to access CVS?
>>>
>>> JP
>>>
>>> -----Original Message-----
>>> From: Don Dietrick [mailto:dietrick_at_bbn.com]
>>> Sent: Wednesday, December 14, 2005 4:46 PM
>>> To: John Pearson
>>> Cc: Openmap-Users
>>> Subject: Re: [OpenMap Users] Starting OpenMap
>>>
>>>
>>> Hi John,
>>>
>>> It just downloaded OK for me, but I don't have access to a windows
>>> box right now. I'll have to try it out tomorrow.
>>>
>>> I see what the problem is, though, I didn't realize you were running
>>> from that download. That file is a snapshot of the CVS repository of
>>> that day, and the class files and jar files (except for the symbol
>>> jar) aren't checked into CVS. If you download the beta, you have to
>>> compile the code to use it. If you have a jdk installed with javac,
>>> you can run the ant.bat file to create the classes and jars. From
>>> the openmap directory, run
>>>
>>>> bin\ant.bat
>>>
>>>
>>> Ant might want you to have the JAVA_HOME environment variable set,
>>> and you should also have the OPENMAP_HOME environment set to where
>>> ever openmap is.
>>>
>>> - Don
>>>
>>> On Dec 14, 2005, at 5:21 PM, John Pearson wrote:
>>>
>>>> Don...
>>>>
>>>> I think the problem may be that the file I downloaded
>>>> (ftp://openmap.bbn.com/pub/customer-redirect/openmap/openmap-
>>>> beta-2005071210
>>>> 28.tar.gz) may be corrupt. I tried to open it on a Windows 2000
>>>> SP4 system
>>>> using WinRAR 3.5.1.
>>>>
>>>> The following messages were displayed:
>>>> ! C:\Documents and Settings\Administrator\My
>>>> Documents\openmap\openmap-beta-200507121028.tar.gz: Unexpected end of
>>>> archive
>>>> ! C:\Documents and Settings\Administrator\My
>>>> Documents\openmap\openmap-beta-200507121028.tar.gz: The archive is
>>>> corrupt
>>>>
>>>>
>>>> I made the changes you described below, but still get the same
>>>> error.. I
>>>> have discovered that there is no openmap.jar in the lib directory.
>>>>
>>>> I treid redownloading the beta file above, and it still appears to be
>>>> corrupt.
>>>>
>>>> JP
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: owner-openmap-users_at_bbn.com [mailto:owner-openmap-
>>>> users_at_bbn.com]On
>>>> Behalf Of Don Dietrick
>>>> Sent: Wednesday, December 14, 2005 10:06 AM
>>>> To: John Pearson
>>>> Cc: Openmap-Users
>>>> Subject: Re: [OpenMap Users] Starting OpenMap
>>>>
>>>>
>>>> Hi John,
>>>>
>>>> On Dec 9, 2005, at 10:30 AM, John Pearson wrote:
>>>>
>>>>> Hi List:
>>>>>
>>>>> I recently downloaded the OpenMap 4.6.3 beta version, and set my
>>>>> paths as
>>>>> required by openmap.bat in the bin directory, but OpenMap fails to
>>>>> start,
>>>>> throwing the following exception
>>>>>
>>>>> C:\openmap\bin>openmap.bat
>>>>> Exception in thread "main" java.lang.NoClassDefFoundError:
>>>>> com/bbn/openmap/app/OpenMap
>>>>>
>>>>> I looked in the directory and didn't see any ".class" files, but
>>>>> neither did
>>>>> I see them in the directory tree for the 4.6.2 release.
>>>>
>>>>
>>>> The .class files are in the jar file, they are what the jvm actually
>>>> uses when running a java program.
>>>>
>>>> The problem is that the jar file isn't in your classpath.
>>>>
>>>>> As you can see I have OpenMap installed on my C:\ drive in "C:
>>>>> \openmap".,
>>>>> Java is installed in "C:\Program Files\Java\jdk1.5.0_05".
>>>>> The contents of openmap.bat are as follows:
>>>>>
>>>>> _at_echo off
>>>>>
>>>>> rem This will launch the OpenMap application
>>>>> rem YOU MUST EDIT THE SETTINGS IN THIS FILE TO MATCH YOUR
>>>>> CONFIGURATION
>>>>>
>>>>> rem Java Virtual Machine
>>>>> rem CHANGE THIS TO POINT TO YOUR JAVA INSTALLATION IF JAVA
>>>>> ISN"T IN
>>>>> YOUR PATH
>>>>> set JAVABIN=C:\PROGRA~1\JAVA\jdk1.5.0_05\bin\java.exe
>>>>>
>>>>> rem OpenMap top-level directory
>>>>> rem THIS POINTS TO THE DIRECTORY ABOVE "BIN". CHANGE THIS IF YOU
>>>>> MOVE THE
>>>>> rem BATCH FILE.
>>>>> set OPENMAP_HOME=C:\openmap
>>>>>
>>>>> rem CLASSPATH points to toplevel OpenMap directory and share
>>>>> rem subdirectory. Add other jar files as available.
>>>>> set
>>>>> CLASSPATH=%OPENMAP_HOME%;%OPENMAP_HOME%\classes\openmap;%
>>>>> OPENMAP_HOME%\share
>>>>> ;%OPENMAP_HOME%\lib\milStd2525_png.jar;%OPENMAP_HOME%\lib
>>>>> \openmap.jar;%OPENM
>>>>> AP_HOME%\lib\omsvg.jar;%OPENMAP_HOME%\lib\omj3d.jar;%OPENMAP_HOME%
>>>>> \lib\omcor
>>>>> ba_vb.jar;
>>>>>
>>>>> rem OK, now run OpenMap
>>>>> %JAVABIN% -Xmx64m -Dopenmap.configDir=%OPENMAP_HOME%\share
>>>>> -Ddebug.showprogress com.bbn.openmap.app.OpenMap
>>>>>
>>>>>
>>>>> Any Ideas why I can't get OpenMap to start?
>>>>
>>>>
>>>> Is the OpenMap installation at c:/openmap?
>>>>
>>>> You could also modify the bin.bat script so that it contains a jvm
>>>> flag that explicitly sets the classpath:
>>>>
>>>>
>>>> %JAVABIN% -Xmx64m -Dopenmap.configDir=%OPENMAP_HOME%\share
>>>> -Ddebug.showprogress -classpath %CLASSPATH%
>>>> com.bbn.openmap.app.OpenMap
>>>>
>>>>
>>>> Hope this helps,
>>>>
>>>> Don
>>>>
>>>>
>>>> --
>>>> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
>>>> with the following text in the BODY of the message "unsubscribe
>>>> openmap-users"]
>>>>
>>>>
>>>> --
>>>> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
>>>> with the following text in the BODY of the message "unsubscribe
>>>> openmap-users"]
>>>
>>>
>>>
>>> --
>>> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
>>> with the following text in the BODY of the message "unsubscribe
>>> openmap-users"]
>>
>>
>> --
>> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
>> with the following text in the BODY of the message "unsubscribe
>> openmap-users"]
>>
>
> --
> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Dec 16 2005 - 11:09:11 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:07 EDT