Good bye old help browser... hello new Java Help Browser using DocBook.
Vincent Couvert [Mon, 17 Mar 2008 13:52:56 +0000 (13:52 +0000)]
13 files changed:
scilab/modules/gui/etc/helpbrowser_menubar.xml [new file with mode: 0644]
scilab/modules/gui/includes/CallHelpBrowser.h
scilab/modules/gui/sci_gateway/c/sci_helpbrowser.c
scilab/modules/gui/src/cpp/CallHelpBrowser.cpp
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/CallScilabBridge.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/ScilabBridge.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/helpbrowser/SwingScilabHelpBrowser.java
scilab/modules/gui/src/java/org/scilab/modules/gui/helpbrowser/ScilabHelpBrowser.java
scilab/modules/gui/src/java/org/scilab/modules/gui/helpbrowser/ScilabHelpBrowserBridge.java
scilab/modules/gui/src/jni/CallScilabBridge.cpp
scilab/modules/gui/src/jni/CallScilabBridge.giws.xml
scilab/modules/gui/src/jni/CallScilabBridge.hxx
scilab/modules/helptools/macros/help.sci

diff --git a/scilab/modules/gui/etc/helpbrowser_menubar.xml b/scilab/modules/gui/etc/helpbrowser_menubar.xml
new file mode 100644 (file)
index 0000000..00991f3
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<menubar>
+    <menu label="File" mnemonic="F">
+        <submenu label="Close" mnemonic="C">
+            <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.closeHelpBrowser" type="3"/>
+        </submenu> 
+    </menu>
+
+    <menu label="?" mnemonic="?">
+        <submenu label="About Scilab..." mnemonic="A"> 
+            <callback instruction="about()" type="0"/>
+        </submenu>
+    </menu>
+</menubar>
\ No newline at end of file
index f41a82c..0e47015 100644 (file)
@@ -21,8 +21,9 @@
  *
  * @param helps help chapters and directories
  * @param helpsSize number of entries in helps
+ * @param language Scilab current locale
  */
-void launchHelpBrowser(char **helps, int helpsSize);
+void launchHelpBrowser(char **helps, int helpsSize, char *language);
 
 /**
  * Search a keyword in Scilab Help Browser
@@ -30,8 +31,9 @@ void launchHelpBrowser(char **helps, int helpsSize);
  * @param helps help chapters and directories
  * @param helpsSize number of entries in helps
  * @param keyword the keyword to search
+ * @param language Scilab current locale
  */
-BOOL searchKeyword(char **helps, int helpsSize, char *keyword);
+BOOL searchKeyword(char **helps, int helpsSize, char *keyword, char *language);
 
 #endif /* !__CALLHELPBROWSER_H__ */
 
index 0657d78..ca349de 100644 (file)
@@ -23,36 +23,64 @@ int sci_helpbrowser(char *fname,unsigned long fname_len)
 {
   int nbRow = 0, nbCol = 0, keywordAdr = 0;
   int nbRowHelp = 0, nbColHelp = 0, helpAdr = 0;
+  int languageAdr = 0;
   
-  CheckRhs(1,2);
+  CheckRhs(2,3);
   CheckLhs(0,1);
 
-  if (Rhs == 1)
+  if (VarType(1) == sci_strings)
     {
-      if (VarType(1) == sci_strings)
+      GetRhsVar(1, MATRIX_OF_STRING_DATATYPE, &nbRowHelp, &nbColHelp, &helpAdr);
+    }
+  else
+    {
+      if (VarType(1) == sci_matrix)
         {
-          GetRhsVar(1, MATRIX_OF_STRING_DATATYPE, &nbRowHelp, &nbColHelp, &helpAdr);
+          if (nbRow*nbCol == 0)
+            {
+              helpAdr = -1; /* No toolboxes installed */
+            }
+          else
+            {
+              Scierror(999, _("%s: Wrong type for first input argument: String matrix expected.\n"), "helpbrowser");
+              return FALSE;
+            }
         }
       else
         {
           Scierror(999, _("%s: Wrong type for first input argument: String matrix expected.\n"), "helpbrowser");
           return FALSE;
         }
-
-      launchHelpBrowser(getStringMatrixFromStack(helpAdr), nbRowHelp*nbColHelp);
     }
-  else
+  
+  if (Rhs == 2)
     {
-      if (VarType(1) == sci_strings)
+      if (VarType(2) == sci_strings)
         {
-          GetRhsVar(1, MATRIX_OF_STRING_DATATYPE, &nbRowHelp, &nbColHelp, &helpAdr);
+          GetRhsVar(2, MATRIX_OF_STRING_DATATYPE, &nbRow, &nbCol, &languageAdr);
+          if (nbRow*nbCol != 1)
+            {
+              Scierror(999, _("%s: Wrong size for second input argument: Single string expected.\n"), "helpbrowser");
+              return FALSE;
+            }
         }
       else
         {
-          Scierror(999, _("%s: Wrong type for first input argument: Single matrix expected.\n"), "helpbrowser");
+          Scierror(999, _("%s: Wrong type for second input argument: String matrix expected.\n"), "helpbrowser");
           return FALSE;
         }
 
+      if (helpAdr == -1) /* No toolboxes loaded */
+        {
+          launchHelpBrowser(NULL, nbRowHelp*nbColHelp, getStringMatrixFromStack(languageAdr)[0]);
+        }
+      else
+        {
+          launchHelpBrowser(getStringMatrixFromStack(helpAdr), nbRowHelp*nbColHelp, getStringMatrixFromStack(languageAdr)[0]);
+        }
+    }
+  else
+    {
       if (VarType(2) == sci_strings)
         {
           GetRhsVar(2, MATRIX_OF_STRING_DATATYPE, &nbRow, &nbCol, &keywordAdr);
@@ -68,9 +96,35 @@ int sci_helpbrowser(char *fname,unsigned long fname_len)
           return FALSE;
         }
       
-      if (!searchKeyword(getStringMatrixFromStack(helpAdr), nbRowHelp*nbColHelp, getStringMatrixFromStack(keywordAdr)[0])) {
-        sciprint(_("Could not find help page for function: %s.\n"),getStringMatrixFromStack(keywordAdr)[0]);
-      }
+      if (VarType(3) == sci_strings)
+        {
+          GetRhsVar(3, MATRIX_OF_STRING_DATATYPE, &nbRow, &nbCol, &languageAdr);
+          if (nbRow*nbCol != 1)
+            {
+              Scierror(999, _("%s: Wrong size for third input argument: Single string expected.\n"), "helpbrowser");
+              return FALSE;
+            }
+        }
+      else
+        {
+          Scierror(999, _("%s: Wrong type for third second argument: Single string expected.\n"), "helpbrowser");
+          return FALSE;
+        }
+      
+      if (helpAdr == -1) /* No toolboxes loaded */
+        {
+          if (!searchKeyword(NULL, nbRowHelp*nbColHelp, getStringMatrixFromStack(keywordAdr)[0], getStringMatrixFromStack(languageAdr)[0]))
+            {
+              sciprint(_("Could not find help page for function: %s.\n"),getStringMatrixFromStack(keywordAdr)[0]);
+            }
+        }
+      else
+        {
+          if (!searchKeyword(getStringMatrixFromStack(helpAdr), nbRowHelp*nbColHelp, getStringMatrixFromStack(keywordAdr)[0], getStringMatrixFromStack(languageAdr)[0]))
+            {
+              sciprint(_("Could not find help page for function: %s.\n"),getStringMatrixFromStack(keywordAdr)[0]);
+            }
+        }
     }
   
   LhsVar(1) = 0;
index 8414eb3..3e5fc02 100644 (file)
 
 using namespace org_scilab_modules_gui_bridge;
 
-void launchHelpBrowser(char **helps, int helpsSize)
+void launchHelpBrowser(char **helps, int helpsSize, char* language)
 {
-  CallScilabBridge::launchHelpBrowser(getScilabJavaVM(), helps, helpsSize);
+  CallScilabBridge::launchHelpBrowser(getScilabJavaVM(), helps, helpsSize, language);
 }
 
-BOOL searchKeyword(char **helps, int helpsSize, char *keyword)
+BOOL searchKeyword(char **helps, int helpsSize, char *keyword, char* language)
 {
-  return CallScilabBridge::searchKeyword(getScilabJavaVM(), helps, helpsSize, keyword);
+  return CallScilabBridge::searchKeyword(getScilabJavaVM(), helps, helpsSize, keyword, language);
 }
index 7a362c9..fb8fd78 100644 (file)
@@ -1847,19 +1847,21 @@ public class CallScilabBridge {
        /**
         * Launch Scilab help browser if not already created
         * @param helps help chapters and directories
+        * @param language Scilab current language
         */
-       public static void launchHelpBrowser(String[] helps) {
-               ScilabHelpBrowser.createHelpBrowser(helps);
+       public static void launchHelpBrowser(String[] helps, String language) {
+               ScilabHelpBrowser.createHelpBrowser(helps, language);
        }
        
        /**
         * Search a keyword in Scilab Help Browser
         * @param keyword the keyword to search
         * @param helps help chapters and directories
+        * @param language Scilab current language
         * @return true if the keyword is a function name
         */
-       public static boolean searchKeyword(String[] helps, String keyword) {
-               return ScilabHelpBrowser.createHelpBrowser(helps).searchKeywork(keyword);
+       public static boolean searchKeyword(String[] helps, String keyword, String language) {
+               return ScilabHelpBrowser.createHelpBrowser(helps, language).searchKeywork(keyword);
        }
 
        /**
index f7c7d2a..a92c543 100644 (file)
@@ -4164,10 +4164,11 @@ public class ScilabBridge {
        /**
         * Create a new Help Browser
         * @param helps help chapters and directories
+        * @param language Scilab current language
         * @return the created Help Browser
         */
-       public static SimpleHelpBrowser createHelpBrowser(String[] helps) {
-               return ScilabHelpBrowserBridge.createHelpBrowser(helps);
+       public static SimpleHelpBrowser createHelpBrowser(String[] helps, String language) {
+               return ScilabHelpBrowserBridge.createHelpBrowser(helps, language);
        }
 
        /**
index 3616b07..8c7242c 100644 (file)
 package org.scilab.modules.gui.bridge.helpbrowser;
 
 import java.io.File;
+import java.io.FilenameFilter;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
-import java.util.StringTokenizer;
 
 import javax.help.BadIDException;
 import javax.help.DefaultHelpModel;
@@ -32,30 +32,69 @@ import org.scilab.modules.gui.helpbrowser.SimpleHelpBrowser;
 public class SwingScilabHelpBrowser extends JHelp implements SimpleHelpBrowser {
        
        private static final long serialVersionUID = 5306766011092074961L;
-
+       
+       private String jarExtension = "_help.jar";
+       private String mainJarPath = System.getenv("SCI") + "/modules/helptools/scilab_";
+       private String defaultLanguage = "en_US";
     private HelpSet helpSet;
 
     /**
         * Constructor
         * @param helps help chapters and directories
+        * @param language Scilab current language
         */             
-       public SwingScilabHelpBrowser(String[] helps) {
+       public SwingScilabHelpBrowser(String[] helps, String language) {
                super();        
                
-           File[] jarFiles = new File[helps.length];
-           String moduleName = "";
-           for (int k = 0; k < helps.length; k++) {
-                       /* Search module name */
-                       StringTokenizer tok = new StringTokenizer(helps[k], "/");
-                       while (tok.hasMoreTokens()) {
-                               if (tok.nextToken().equals("modules")) {
-                                       moduleName = tok.nextToken();
-                                       break;
-                               }
-                       }
-                       /* Jar file name */
-                       jarFiles[k] =  new File(helps[k] + moduleName + "_help.jar");
+               File[] jarFiles;
+               if (helps == null) {
+                       jarFiles = new File[helps.length + 1]; /* +1 because of Scilab main help jar file */
+               } else {
+                       jarFiles = new File[1]; /* Scilab main help jar file */
                }
+
+           /* Main Jar file */
+           File mainJar = new File(mainJarPath + language + jarExtension);
+           if (!mainJar.exists()) {
+               mainJar = new File(mainJarPath + defaultLanguage + jarExtension);
+           }
+           
+           jarFiles[0] = mainJar;
+           
+           /* Toolboxes jar files */
+           if (helps != null) {
+               for (int k = 0; k < helps.length; k++) {
+                       File toolboxJarPath = new File(helps[k]);
+
+                       /* Find all Jars */
+                       String[] all = toolboxJarPath.list(new FilenameFilter() {
+                               public boolean accept(File pathname, String arg1) {
+                                       return pathname.getAbsolutePath().matches("*_help.jar");
+                               }
+                       });
+
+                       /* Get the default language help and the current language help */
+                       int defaultHelpIndex = -1;
+                       int localeHelpIndex = -1;
+                       for (int fileIndex = 0; fileIndex < all.length; fileIndex++) {
+                               if (all[fileIndex].indexOf(defaultLanguage) != -1) {
+                                       defaultHelpIndex = fileIndex;
+                               }
+                               if (all[fileIndex].indexOf(language) != -1) {
+                                       localeHelpIndex = fileIndex;
+                               }
+                       }
+
+                       /* Add the toolbox help file */
+                       if (localeHelpIndex != -1) {
+                               jarFiles[k + 1] =  new File(all[localeHelpIndex]);
+                       } else if (defaultHelpIndex != -1) {
+                               jarFiles[k + 1] =  new File(all[defaultHelpIndex]);
+                       } else if (all != null) {
+                               jarFiles[k + 1] =  new File(all[0]); /* First file as default */
+                       }
+               }
+           }
            this.setModel(new DefaultHelpModel(new HelpSet()));
         
            for (int i = 0; i < jarFiles.length; ++i) {
@@ -81,7 +120,6 @@ public class SwingScilabHelpBrowser extends JHelp implements SimpleHelpBrowser {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        }
-            //this.setModel(new DefaultHelpModel(helpSet));
                        this.getModel().getHelpSet().add(helpSet);
         }
 
index 5fe5a6e..9a1e5b1 100644 (file)
@@ -15,14 +15,12 @@ package org.scilab.modules.gui.helpbrowser;
 import org.scilab.modules.gui.bridge.ScilabBridge;
 import org.scilab.modules.gui.dockable.ScilabDockable;
 import org.scilab.modules.gui.events.callback.ScilabCallBack;
-import org.scilab.modules.gui.menu.Menu;
-import org.scilab.modules.gui.menu.ScilabMenu;
 import org.scilab.modules.gui.menubar.MenuBar;
-import org.scilab.modules.gui.menubar.ScilabMenuBar;
 import org.scilab.modules.gui.tab.ScilabTab;
 import org.scilab.modules.gui.tab.Tab;
 import org.scilab.modules.gui.textbox.ScilabTextBox;
 import org.scilab.modules.gui.textbox.TextBox;
+import org.scilab.modules.gui.utils.MenuBarBuilder;
 import org.scilab.modules.gui.utils.Position;
 import org.scilab.modules.gui.utils.Size;
 import org.scilab.modules.gui.window.ScilabWindow;
@@ -34,6 +32,8 @@ import org.scilab.modules.gui.window.Window;
  */
 public class ScilabHelpBrowser extends ScilabDockable implements HelpBrowser {
 
+       private static final String MENUBARXMLFILE = System.getenv("SCI") + "/modules/gui/etc/helpbrowser_menubar.xml";
+
        private static HelpBrowser instance;
        
        private static Tab helpTab;
@@ -43,34 +43,30 @@ public class ScilabHelpBrowser extends ScilabDockable implements HelpBrowser {
        /**
         * Constructor
         * @param helps help chapters and directories
+        * @param language Scilab current language
         */
-       protected ScilabHelpBrowser(String[] helps) {
-               component = ScilabBridge.createHelpBrowser(helps);
+       protected ScilabHelpBrowser(String[] helps, String language) {
+               component = ScilabBridge.createHelpBrowser(helps, language);
        }
 
        /**
         * Creates a Scilab Help Browser
         * @param helps help chapters and directories
+        * @param language Scilab current language
         * @return the created Help Browser
         */
-       public static HelpBrowser createHelpBrowser(String[] helps) {
+       public static HelpBrowser createHelpBrowser(String[] helps, String language) {
                if (instance == null) {
-                       instance = new ScilabHelpBrowser(helps);
+                       
+                       instance = new ScilabHelpBrowser(helps, language);
+                       
                        helpTab = ScilabTab.createTab("Help Browser");
                        helpTab.addMember(instance);
+                        /* Action when the Browser tab is closed */
                        helpTab.setCallback(ScilabCallBack
                                        .createCallback("org.scilab.modules.gui.bridge.CallScilabBridge.closeHelpBrowser", ScilabCallBack.JAVA));
                        
-                       MenuBar menubar = ScilabMenuBar.createMenuBar();
-                       
-                       Menu menu = ScilabMenu.createMenu();
-                       menu.setText("File");
-                       menubar.add(menu);
-                       
-                       menu = ScilabMenu.createMenu();
-                       menu.setText("?");
-                       menubar.add(menu);
-                       
+                       MenuBar menubar = MenuBarBuilder.buildMenuBar(MENUBARXMLFILE);
                        helpTab.addMenuBar(menubar);
 
                        TextBox infobar = ScilabTextBox.createTextBox();
@@ -79,6 +75,7 @@ public class ScilabHelpBrowser extends ScilabDockable implements HelpBrowser {
                        Window helpWindow = ScilabWindow.createWindow();
                        helpWindow.addTab(helpTab);
                        helpWindow.draw();
+                       
                }
                return instance;
        }
@@ -88,11 +85,10 @@ public class ScilabHelpBrowser extends ScilabDockable implements HelpBrowser {
         * @return the console
         */
        public static HelpBrowser getHelpBrowser() {
-               throw new UnsupportedOperationException();
-//             if (instance == null) {
-//                     instance = new ScilabHelpBrowser();
-//             }
-//             return instance;
+               if (instance == null) {
+                       instance = new ScilabHelpBrowser(null, "en_US");
+               }
+               return instance;
        }
        
        /**
index e5c5d58..f97e4b4 100644 (file)
@@ -29,10 +29,11 @@ public class ScilabHelpBrowserBridge {
        /**
         * Creates a Scilab HelpBrowser
         * @param helps help chapters and directories
+        * @param language Scilab current language
         * @return the created HelpBrowser
         */
-       public static SimpleHelpBrowser createHelpBrowser(String[] helps) {
-               return new SwingScilabHelpBrowser(helps);
+       public static SimpleHelpBrowser createHelpBrowser(String[] helps, String language) {
+               return new SwingScilabHelpBrowser(helps, language);
        }
 
        /**
index f054e91..e853ae1 100644 (file)
@@ -233,8 +233,8 @@ voidsetWaitBarMessagejintjobjectArrayID=NULL;
 voidsetWaitBarValuejintjintID=NULL; 
 voiddestroyWaitBarjintID=NULL; 
 voidsetWaitBarIndeterminateModejintjbooleanID=NULL; 
-voidlaunchHelpBrowserjobjectArrayID=NULL; 
-jbooleansearchKeywordjobjectArrayjstringID=NULL; 
+voidlaunchHelpBrowserjobjectArrayjstringID=NULL; 
+jbooleansearchKeywordjobjectArrayjstringjstringID=NULL; 
 
 
 }
@@ -391,8 +391,8 @@ voidsetWaitBarMessagejintjobjectArrayID=NULL;
 voidsetWaitBarValuejintjintID=NULL; 
 voiddestroyWaitBarjintID=NULL; 
 voidsetWaitBarIndeterminateModejintjbooleanID=NULL; 
-voidlaunchHelpBrowserjobjectArrayID=NULL; 
-jbooleansearchKeywordjobjectArrayjstringID=NULL; 
+voidlaunchHelpBrowserjobjectArrayjstringID=NULL; 
+jbooleansearchKeywordjobjectArrayjstringjstringID=NULL; 
 
 
 }
@@ -3820,14 +3820,14 @@ curEnv->ExceptionDescribe() ;
                         
 }
 
-void CallScilabBridge::launchHelpBrowser (JavaVM * jvm_, char ** helps, int helpsSize){
+void CallScilabBridge::launchHelpBrowser (JavaVM * jvm_, char ** helps, int helpsSize, char * language){
 
 JNIEnv * curEnv = NULL;
 jvm_->AttachCurrentThread((void **) &curEnv, NULL);
 jclass cls = curEnv->FindClass( className().c_str() );
 
-jmethodID voidlaunchHelpBrowserjobjectArrayID = curEnv->GetStaticMethodID(cls, "launchHelpBrowser", "([Ljava/lang/String;)V" ) ;
-if (voidlaunchHelpBrowserjobjectArrayID == NULL) {
+jmethodID voidlaunchHelpBrowserjobjectArrayjstringID = curEnv->GetStaticMethodID(cls, "launchHelpBrowser", "([Ljava/lang/String;Ljava/lang/String;)V" ) ;
+if (voidlaunchHelpBrowserjobjectArrayjstringID == NULL) {
 std::cerr << "Could not access to the method " << "launchHelpBrowser" << std::endl;
 exit(EXIT_FAILURE);
 }
@@ -3856,7 +3856,9 @@ curEnv->SetObjectArrayElement( helps_, i, TempString);
 // avoid keeping reference on to many strings
 curEnv->DeleteLocalRef(TempString);
 }
-                         curEnv->CallStaticVoidMethod(cls, voidlaunchHelpBrowserjobjectArrayID ,helps_);
+jstring language_ = curEnv->NewStringUTF( language );
+
+                         curEnv->CallStaticVoidMethod(cls, voidlaunchHelpBrowserjobjectArrayjstringID ,helps_, language_);
                         
 if (curEnv->ExceptionOccurred()) {
 curEnv->ExceptionDescribe() ;
@@ -3867,14 +3869,14 @@ curEnv->DeleteLocalRef(helps_);
 
 }
 
-bool CallScilabBridge::searchKeyword (JavaVM * jvm_, char ** helps, int helpsSize, char * keyword){
+bool CallScilabBridge::searchKeyword (JavaVM * jvm_, char ** helps, int helpsSize, char * keyword, char * language){
 
 JNIEnv * curEnv = NULL;
 jvm_->AttachCurrentThread((void **) &curEnv, NULL);
 jclass cls = curEnv->FindClass( className().c_str() );
 
-jmethodID jbooleansearchKeywordjobjectArrayjstringID = curEnv->GetStaticMethodID(cls, "searchKeyword", "([Ljava/lang/String;Ljava/lang/String;)Z" ) ;
-if (jbooleansearchKeywordjobjectArrayjstringID == NULL) {
+jmethodID jbooleansearchKeywordjobjectArrayjstringjstringID = curEnv->GetStaticMethodID(cls, "searchKeyword", "([Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z" ) ;
+if (jbooleansearchKeywordjobjectArrayjstringjstringID == NULL) {
 std::cerr << "Could not access to the method " << "searchKeyword" << std::endl;
 exit(EXIT_FAILURE);
 }
@@ -3905,7 +3907,9 @@ curEnv->DeleteLocalRef(TempString);
 }
 jstring keyword_ = curEnv->NewStringUTF( keyword );
 
-                        jboolean res =  (jboolean) curEnv->CallStaticBooleanMethod(cls, jbooleansearchKeywordjobjectArrayjstringID ,helps_, keyword_);
+jstring language_ = curEnv->NewStringUTF( language );
+
+                        jboolean res =  (jboolean) curEnv->CallStaticBooleanMethod(cls, jbooleansearchKeywordjobjectArrayjstringjstringID ,helps_, keyword_, language_);
                         
 if (curEnv->ExceptionOccurred()) {
 curEnv->ExceptionDescribe() ;
index b4cb8bc..32141a3 100644 (file)
 <!-- Help Browser -->
        <method name="launchHelpBrowser" returnType="void" modifier="static">
           <parameter type="String[]" name="helps"/>
+          <parameter type="String" name="language"/>
         </method>      
         <method name="searchKeyword" returnType="boolean" modifier="static">
           <parameter type="String[]" name="helps"/>
           <parameter type="String" name="keyword"/>
+          <parameter type="String" name="language"/>
         </method>
   </object>
 </package>
\ No newline at end of file
index 8cc0937..4c078ea 100644 (file)
@@ -184,8 +184,8 @@ jmethodID voidsetWaitBarMessagejintjobjectArrayID; // cache method id
 jmethodID voidsetWaitBarValuejintjintID; // cache method id
 jmethodID voiddestroyWaitBarjintID; // cache method id
 jmethodID voidsetWaitBarIndeterminateModejintjbooleanID; // cache method id
-jmethodID voidlaunchHelpBrowserjobjectArrayID; // cache method id
-jmethodID jbooleansearchKeywordjobjectArrayjstringID; // cache method id
+jmethodID voidlaunchHelpBrowserjobjectArrayjstringID; // cache method id
+jmethodID jbooleansearchKeywordjobjectArrayjstringjstringID; // cache method id
 
 
 /**
@@ -489,9 +489,9 @@ static void destroyWaitBar(JavaVM * jvm_, long objID);
 
 static void setWaitBarIndeterminateMode(JavaVM * jvm_, long objID, bool status);
 
-static void launchHelpBrowser(JavaVM * jvm_, char ** helps, int helpsSize);
+static void launchHelpBrowser(JavaVM * jvm_, char ** helps, int helpsSize, char * language);
 
-static bool searchKeyword(JavaVM * jvm_, char ** helps, int helpsSize, char * keyword);
+static bool searchKeyword(JavaVM * jvm_, char ** helps, int helpsSize, char * keyword, char * language);
 
 
                         /**
index 47337a1..6c4440d 100644 (file)
@@ -25,9 +25,9 @@ function help(key)
                        INDEX=make_help_index()
                        
                        if argn(2)==0 then
-                               //global %helps
-                               //helpbrowser(%helps(:,1));
-                               browsehelp(INDEX,"index");
+                               global %helps
+                               helpbrowser(%helps(:,1), getlanguage());
+                               //browsehelp(INDEX,"index");
                                return
                        end
                        
@@ -41,9 +41,9 @@ function help(key)
                        path=gethelpfile(key)
                        
                        if path<>[] then
-                               //global %helps
-                               //helpbrowser(%helps(:,1), key);
-                               browsehelp(path,key)
+                               global %helps
+                               helpbrowser(%helps(:,1), key, getlanguage());
+                               //browsehelp(path,key)
                        else
                                apropos(key)
                        end