Method for generating localizable message catalogs for Java-based applications
AssigneeHewlett-Packard Development Company, L.P.
InventorsCaroline Nan Koff, William Girard McCollom
Life of this patent
Estimating the term…
Abstract
A method for generating localizable message catalogs for Java-based applications is disclosed. Message catalogs that are automatically flagged for what needs to be manually translated are generated from a given Java source code file, which can then be used for translation. ListResourceBundle data structures that are compatible with Java's internationalization model are also generated from the message catalogs that were previously generated and manually translated into desired local language(s). This provides a more efficient means of maintaining a language-specific version of Java software after if has been released.
Claims11
A method for generating localizable message catalogs for Java-based applications, comprising:
- identifying one or more localizable strings of a Java source code;
- marking the one or more localizable strings to produce one or more marked localizable strings by inserting a marker into each localizable string of the one or more localizable strings;
- extracting the one or more marked localizable strings;
- storing the one or more marked localizable strings into an external text file;
- generating a new version of the Java source code from which an internationalization tool is run;
- retrieving the marked localizable strings from a ListResourceBundle class;
- generating a merged external text file containing the one or more marked localizable strings;
- generating one or more ListResourceBundle files corresponding to the merged external text file with each ListResourceBundle file of the one or more ListResourceBundle files corresponding to a desired language;
- and
- compiling the one or more ListResourceBundle files and the Java source code.
A method for generating localizable message catalogs for Java-based applications, comprising:
- opening an original Java source code file;
- opening a first message catalog file;
- copying the first message catalog file to a second message catalog file;
- creating a modified Java source code file from the original Java source code file;
- reading the contents of the original Java source code file into a buffer;
- if the buffer contains one or more marked localizable strings, for each marked localizable string of the one or more marked localizable strings comprising:
- determining if the marked localizable string is stored in the first message catalog file;
- if the marked localizable string is stored in the first message catalog file, comprising:
- obtaining a message number corresponding to the marked localizable string;
- and
- replacing the marked localizable string in the buffer with a method call that can obtain the marked localizable string;
- if the marked localizable string is not stored in the first message catalog file, comprising:
- appending the marked localizable string to the second message catalog file;
- and
- removing a marker from the marked localizable string in the buffer to convert the marked localizable string to a default localized string;
- writing to the modified Java source code file from the buffer;
- and
- closing the original Java source code file, the first message catalog file, the second message catalog file, and the modified Java source code file.
A method for generating localizable message catalogs for Java-based applications, comprising:
- generating a plurality of modified Java source code files;
- generating a message catalog file having one or more localizable strings for a Java package;
- translating the message catalog file manually;
- generating a plurality of ListResourceBundle data structure files for the one or more localizable strings of the translated message catalog file, wherein the ListResourceBundle data structure files are not manually translated;
- and
- compiling the plurality of modified Java source code files and the plurality of ListResourceBundle data structure files.
Dependencies are inferred from the claim text.