ContextmenuEntry for other languages

Forum
Marc Linde
2009-02-16
2013-05-08
  • Marc Linde
    Marc Linde
    2009-02-16

    Hello community,

    i encounter problems implementing the spellchecker in an application ...
    added a sub-directory "dicts" to project and placed several dictionaries in there

    placed this code 'SpellChecker.registerDictionaries(new URL("file",null,"./dicts/"),"en,de,fr","de") ;'

    Spellckecker finds laguahge according to locale, 'de' in this case.
    But i am unable to switch language in contextmenu ... no entires listed.

    What did i do wrong ?

    Cheers

    t1h8li

     
    • i-net software
      i-net software
      2009-02-16

      Hi,

      Can you answer some questions:

      Do you use the original JOrtho or a modfication version? Which version?

      Which files names has the files in your "dicts" directory?

      Is your working directory correct set?

      Do you can see the german language in the context menu?

      How you create the context menu?

      Volker

       
      • Marc Linde
        Marc Linde
        2009-02-16

        Hi Volker,

        that was a fast response :-)

        Ok, facts :
        JOrtho taken from SourceForge, latest Version, unmodified ...
        Name of DictFiles : dictonary_de.orth, ..._en and so forth
        No specific code for context menu added ...
        Contextmenu is in german ...

        This is the code i use :

        FileUserDictionary fileUserDictionary=new FileUserDictionary("./dicts/");
                SpellChecker.setUserDictionaryProvider(fileUserDictionary);
                File f = new File(".");
                try {
                    System.out.println(f.getCanonicalPath());
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                    try {
                        SpellChecker.registerDictionaries(new URL("file",null,"./dicts/"),"en,de,fr","de") ;
                    } catch (MalformedURLException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                    }

        Greets

        Marc

         
        • i-net software
          i-net software
          2009-02-17

          Hi Marc,

          > Name of DictFiles : dictonary_de.orth, ..._en and so forth
          Is this a typo? Do you means dictonary_de.ortho? By default it is searching for the extension ".ortho"

          > No specific code for context menu added ...
          Do you register the languages before you create the context menu?

          > Contextmenu is in german ...
          The question is not in which language you see the menu items. The question which items you see?

          I think you need to debug it. Download the source code.
          * In the method registerDictionaries() you need check what is in the variable "languages" at end.
          * In the method createLanguagesMenu() you should also check what is in the variable "languages".

          Volker