Home
Categories
Dictionary
Download
Project Details
Changes Log
What Links Here
How To
Syntax
FAQ
License

Setting the help locale



By default the localization of the help GUI is the Platform default localization but it is possible to change it.

Supported locales

The supported language names are:
  • "en": English
  • "fr": French
  • "de": German
  • "es": Spanish
  • "it": Italian
  • "ru": Russian

Localized keys

The localized keys are:
  • The Articles name
  • The Titles name
  • The Anchors name
  • The "Search..." hint text in the Search box
  • The "Containing..." text in the full text Search

Setting the locale in the JavaHelpFactory

The JavaHelpFactory.setLocale(locale) allows to override the Locale to use in the viewer.

For example:
      // get the zip file as an URL
      URL url = ...

      try {
        // create the Help factory
        JavaHelpFactory factory = new JavaHelpFactory(url);
        factory.setLocale(Locale.FRENCH);
        factory.create();
        ArticlesModel model = factory.getModel();

        // create the viewer component
        SwingHelpContentViewer viewer = new SwingHelpContentViewer();
        viewer.installModel(model);
      }

Setting the locale in the HelpContentViewer

The HelpContentViewer.setLocale(locale) allows to override the Locale to use directly in the viewer.

For example:
      // get the zip file as an URL
      URL url = ...

      try {
        // create the Help factory
        JavaHelpFactory factory = new JavaHelpFactory(url);
        factory.create();
        ArticlesModel model = factory.getModel();

        // create the viewer component
        SwingHelpContentViewer viewer = new SwingHelpContentViewer();
        viewer.setLocale(Locale.FRENCH);
        viewer.installModel(model);
      }

See also


Categories: javahelp

docJGenerator Copyright (c) 2016-2023 Herve Girod. All rights reserved.