Browse Prior Art Database

National Language String Separation Support for Java

IP.com Disclosure Number: IPCOM000118475D
Original Publication Date: 1997-Feb-01
Included in the Prior Art Database: 2005-Apr-01
Document File: 2 page(s) / 52K

Publishing Venue

IBM

Related People

Boldt, GD: AUTHOR [+5]

Abstract

Disclosed is a method for separation of translatable strings from the Java source code. This is a requirement in order to be able to have a single code base that will be used for multiple country specific languages that are displayed to the user interface, normally via a Graphical User Interface.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 56% of the total text.

National Language String Separation Support for Java

      Disclosed is a method for separation of translatable strings
from the Java source code.  This is a requirement in order to be able
to have a single code base that will be used for multiple country
specific languages that are displayed to the user interface, normally
via a Graphical User Interface.

      The separation of translatable strings from the source code is
done by creating a class, or set of classes, that contains all of the
strings that are used in the user interface.  These strings are
created in a string array that is indexed by an unique identifier for
each string.  All of the strings and identifiers are created as
"public static  final" such that an instance of this class does not
need to be created,  they can be referenced in the common way of
referring to class variables.  A common static method is used to get
the strings, for example:

The class definition could be similar to the following:
  public class NLS {
     public static final int  String1Index = 0;
     public static final int  String2Index = 1;
     .......
     private static final String[]  NLSEnglishArray=
     {        "String1",
              "String2",
              ......
     }
     public static String get(int Index)
     {
         if English
            return NLSEnglishArray[index];
         ........
     }
  }
 ...