At Shai Almog

What ever I do the error is still:

error: cannot find symbol
UIManager.getInstance().setBundle(theme.getL10N("Localization (L10N)","dk"));
  symbol:   method *getL10N*(String,String)
  location: variable theme of type Object

This may be due to changing Vector to ArrayList and Hashtable to HashMap - but I'm not sure. I will search on to see if I can find a solution. But I feel I circle round and end up the same place as I started, but til missing the solution.

((I also tried this solution: (https://stackoverflow.com/questions/62182526/codename-one-accessing-localized-string-resources)
|theme = UIManager.initFirstTheme("/theme");|||
|String lang= L10NManager.getInstance().getLanguage();|||
|UIManager.getInstance().setBundle(theme.getL10N("Localization (L10N)",lang));)) |

Thanks for your help

Regards

Henrik

Den 16/02/2021 kl. 03.50 skrev Shai Almog:
If you changed the name to "Localization (L10N)" then this:
UIManager.getInstance().setBundle(theme.getL10N("I","dk"));

Should be:
UIManager.getInstance().setBundle(theme.getL10N("Localization (L10N)","dk"));

No?

On Monday, February 15, 2021 at 4:02:16 PM UTC+2 [email protected] wrote:

    At Shai Almog

    Tried the following:

    You need to fix the classpath problem in Netbeans:
    
https://stackoverflow.com/questions/23532966/the-libs-copylibs-classpath-property-is-not-set-up/66079126#66079126
    
<https://stackoverflow.com/questions/23532966/the-libs-copylibs-classpath-property-is-not-set-up/66079126#66079126>

    Fresh import of the original ToDoApp

    Change of build.xml - 1.5 to 1.8

    Changed name of Localization (L10N) 1 to Localization (L10N) and
    synced with UI (you can now see the Danish text in the Designer.)

    Will not run in the simulator from the script

    Project properties changed to 1.8 from 1.6

    Run -> wm options set -Duser.language=dk

    Still not able to run because of several deprecated services

        Changed Vector to ArrayList

        Changed Hashtable to HashMap except from this line:

             Hashtable<String, Object> h = p.parse(new
            InputStreamReader(is));//change to Hashtable?? solves error

             //entries.addElement(value); entries commented out but
            are there an alternative??

    Now the simulator runs in English. So I am back to where I was before.

        Entering this code in toDoApp.java:

        public void start(Resources theme){

            theme = UIManager.initFirstTheme("/theme");

                   String lang = L10NManager.getInstance().getLanguage();
                   if(lang != null){
                       lang = lang.toLowerCase();
                       switch(lang){
                           case "da":
                           case "dk":


            UIManager.getInstance().setBundle(theme.getL10N("I","dk"));

                               break;
                       }
                   }
                  Toolbar.setGlobalToolbar(true);

    Not totally as when I run the Simulator after that it enters a
    black screen on the Simulator and then this error message:
    Couldn't find a main or a startup in com.codename1.demos.todo.TodoApp

    So stuck again -

    But I will search on for a solution

    Thanks for any input

    Henrik

    Den 14/02/2021 kl. 02.48 skrev Shai Almog:
    Do you mean it stopped working when you added the
    -Duser.language=dk ?
    Where did you add this to the project?

    On Saturday, February 13, 2021 at 5:18:06 PM UTC+2
    [email protected] wrote:

        At Shai Almog

        Thanks for your reply and your help

        As you say "ignore" in the video I have used a big I as in
        Iris. (And tried the other possibilities still no positive
        result)
         In the ToDoApp you can toggle the themes. I have not made
        any changes to the themes.

         When trying to debug the project ToDoApp the debugger says
        there is no main file - but when I remove the localisation
        script/snippet - the project debugs without any problem.

        I will continue to look for possibilities, but for now, I
        think you have done enough as my skills in Java are close to
        non-exsitent.

        I will revert

        Regards Henrik


        Den 13/02/2021 kl. 07.00 skrev Shai Almog:
        Are you sure you named the entry within the theme "l" or is
        it "I" (notice uppercase i and Lowercase L look the same in
        some fonts).
        Did you create a separate theme or is this part of a single
        theme file?

        Notice you can inspect the theme object in the debugger at
        that line and you should be able to find all the objects
        within it. This will let you verify that the content is
        stored within the theme and at what hierarchy.
        On Friday, February 12, 2021 at 2:06:57 PM UTC+2
        [email protected] wrote:

            At Shai Almog

            I have changed the name of the bundle to Localization
            (L10N) and
            tried to attach it but with no avail. Still when I look in
            the codename one designer - themes - advanced -

            the preview is in Danish,
            but when I run the simulator from the designer it is in
            English.

            I still get the same error in the line:
            UIManager.getInstance().setBundle(theme.getL10N("I","dk"));

            Regards Henrik

            Den 12/02/2021 kl. 06.07 skrev Shai Almog:
            > It looks like in the theme.getL10N() call the first
            parameter is
            > incorrect since the bundle name is: "Localization
            (L10N) 1".

-- You received this message because you are subscribed to the
        Google Groups "CodenameOne Discussions" group.
        To unsubscribe from this group and stop receiving emails
        from it, send an email to [email protected].
        To view this discussion on the web visit
        
https://groups.google.com/d/msgid/codenameone-discussions/24bca3a2-491a-4bcc-8f16-00b6b80bc6d3n%40googlegroups.com
        
<https://groups.google.com/d/msgid/codenameone-discussions/24bca3a2-491a-4bcc-8f16-00b6b80bc6d3n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- You received this message because you are subscribed to the
    Google Groups "CodenameOne Discussions" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to [email protected].
    To view this discussion on the web visit
    
https://groups.google.com/d/msgid/codenameone-discussions/6e18f992-c7b8-41a6-adf7-e7f12d34bf97n%40googlegroups.com
    
<https://groups.google.com/d/msgid/codenameone-discussions/6e18f992-c7b8-41a6-adf7-e7f12d34bf97n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
    Henrik Glensbo
    Lodkrog 10
    4684 Holmegaard
    allergiskhverdag.dk <https://www.allergiskhverdag.dk/>
    stofskiftesygdom.dk <https://www.stofskiftesygdom.dk/>
    dengodeklassekammerat.dk <https://www.dengodeklassekammerat.dk/>

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/caf2d6a6-b0d3-42c7-85f4-684ad8da9ec1n%40googlegroups.com <https://groups.google.com/d/msgid/codenameone-discussions/caf2d6a6-b0d3-42c7-85f4-684ad8da9ec1n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--

Henrik Glensbo
Lodkrog 10
4684 Holmegaard
allergiskhverdag.dk <https://www.allergiskhverdag.dk/>
stofskiftesygdom.dk <https://www.stofskiftesygdom.dk/>
dengodeklassekammerat.dk <https://www.dengodeklassekammerat.dk/>

--
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/e60a83fa-c707-de1b-e056-e1f38694a46a%40glensbo.dk.

Reply via email to