Abstract:
A system and method is described for internationalization of web pages by extracting translatable content from extensible mark-up language (XML), or similar data-centric meta-language representations of web pages or data used to build web pages. The extracted translatable content is stored in a translation task repository (TTR) accessible by the web developer and the translator. The XML representation is then modified to include selection control logic to select the appropriate translations for insertion into the final web page. The translator accesses the TTR to translate the appropriate content and saves the translations back to the TTR associated with the original translatable data. The translations are obtained from the TTR as selection cases for the selection control logic of the XML representation. As the XML is converted into the web source code, the selection logic and translations are embedded therein facilitating building the web site in multiple different languages.

Description:
BACKGROUND OF THE INVENTION 
     With the unbelievable pace at which the Internet has grown over the last ten years, the business world has become integrally “wired” through e-commerce. As the reach and technology of the Internet increased, e-commerce became a natural extension of the old-business world. With this extension, the ability to market and sell goods and services across borders using the Internet became commonplace. However, as global e-commerce grows, new issues have emerged regarding the extension of an American-centric Internet to non-English speaking countries. In today&#39;s global village, web developers face the task of creating a new paradigm for the globalization of the Internet. 
     Much of the current discussion concerning web pages centers around the format in which electronic documents and programs are written. For example, Hypertext Mark-Up Language (HTML) is one of the languages that a programmer or web developer uses to design and present the format of a web site or web page. HTML is a tag-based, format-related language, meaning that specialized tags are used to “mark up” or format the content of the web pages (e.g., “&lt;b&gt; This text is bold. &lt;/b&gt;” would trigger the browser to format the enclosed text in bold-face type). When the HTML document is communicated to a desktop browser, such as Microsoft&#39;s INTERNET EXPLORER™, Netscape&#39;s NETSCAPE NAVIGATOR™, or the like, it generally knows by reading the HTML tags how to render and configure the appearance of the information in the browser. HTML tags include content tags, which describe the format of the tagged content, and containment tags, which delimit areas of containment in the HTML document. Other markup languages such as Wireless Markup Language (WML) which is used mostly for wireless devices, like cell phones are also used by developers. 
     HTML is a sub-application of a much more extensive meta language (i.e., a language that uses meta data or tags to describe or mark-up data), Standard Generalized Mark-up Language (SGML). SGML was designed to be a standard way of marking up data and was used extensively in large document management systems. However, because of its intended universal application, SGML is a very complicated language and, consequently, not generally suitable for data interchange across the Internet. Its complexity typically requires large parsers which would not be efficient or compact enough for effective Internet use. HTML was developed to capture the information display aspect of SGML in a much more compact and efficient package. 
     In developing multinational web sites, web developers typically design web pages in a single “spoken” language. This is due to file encoding restrictions. If a developer writes a document in Japanese and saves that document using English encoding, the Japanese character coding is often altered, and the characters may not be properly displayed on subsequent accesses to that file. Therefore, documents written in a different language, other than Latin-1 encoded language, should generally be saved according to its own specific language encoding requirements. Because of these encoding restrictions, one web page must typically be created and stored for each different language desired. 
     In the early stages of the Internet, web sites and web pages typically delivered only static content (i.e., information that did not change on a regular basis). Information and format were simply hard-coded in pure HTML to be presented to and displayed by the browser. However, with the expansion of the Internet and e-commerce, most information is now delivered dynamically. For example, a web site may include a product catalog, a shopping cart, or a section of new product descriptions that may require continual update of the underlying information. Depending on the nature of the business, the information may change anywhere from every month, to as often as every hour or less. Dynamic/distributed systems were developed to facilitate the flexibility of such web sites by allowing the dynamic information to be placed into a database accessible by the web/application server and the web developer. These dynamic/distributed web pages are coded with HTML and may include executable code that would facilitate accessing the databases for the necessary dynamic information exchange. Such web pages are often referred to as server pages. Server pages, which reside and are executed on the server-side, typically comprise HTML or similar format-sensitive mark-up code with embedded executable source code, such as Sun&#39;s JAVA™, Macromedia&#39;s COLDFUSION™ Mark-up Language (CFML), or the like. The embedded source code is executed by the server to provide processing or database interaction. The processed data is then filled into the server page which is eventually constructed into the displayed web page using the HTML format-descriptive code. 
     With the proliferation of dynamic/distributed web sites, another SGML-subset meta language is seeing more application. Extensible Mark-up Language (XML) was created with the same purpose in mind as SGML, but without much of the same complexities. XML allows tagging or marking of data for providing description of and/or structure to the data as opposed to simply effecting the formatting of the data, as in HTML. XML is generally used to increase the functionality of the dynamic Internet. More and more web applications are taking advantage of XML&#39;s power and flexibility by using it to facilitate data interaction. 
     Another problem exists with the current systems and methods for providing multilingual web sites. Typically, as discussed above, a web site will be designed and developed in a single, primary “spoken” language. The web developers may code the entire web site in this primary language. Once the site has been developed, it is then typically given to a translator to translate it into each of the languages desired for support. The problem arises when the web site is very large. The translations of such sites require a considerable amount of time. Furthermore, with full access to the web site source code, there exists a chance the translator may unintentionally damage or destroy some of the source code. These problems may unfavorably delay the roll out of the web site, depending on which languages are desired, and/or whether any damage is done to the source code. 
     A common solution for this problem is to involve the translator in the development process at the early stages. However, because developers will typically continue to change and refine the content, design, and layout of web pages, the translator would typically need to continually update the translations. Translators usually charge based on the number of words translated. Therefore, requiring multiple re-translations during development may not be the most cost-effective means of obtaining multiple language support. Furthermore, it is currently not possible, in the traditional web development process, to preserve previous translation to minimize subsequent translations. 
     BRIEF SUMMARY OF THE INVENTION 
     The present invention is directed to a system and method for optimizing the internationalization of web pages to, among other things, eliminate the need to maintain multiple copies of the web site. The system and method are directed to converting a single language document into a binary executable form by injecting multiple translations into the executable. One embodiment of the present invention optimizes internationalization by preferably extracting translatable content from XML or similar data-descriptive meta-language representation of web pages, data, or source code used to build web pages. The extracted translatable content is preferably stored in a translation task repository (TTR) accessible by the web developer and the translator. The XML representation is then preferably modified to include selection logic to select the appropriate translations for insertion into the final executable form (e.g. JAVA™ bytecodes). The translator preferably accesses the TTR to translate the appropriate content and saves the translations back to the TTR associated with the original translatable data. The translations are obtained from the TTR as selection-cases for the selection/control logic of the XML representation. As the XML is converted into the executable format, the selection logic and translations are preferably embedded therein facilitating building the web site in multiple different languages. Because XML or similar data-centric computer meta-language-based documents may be compiled into executable form or into new source code for the web site, the dynamic behavior, supported by the executable selection logic on choosing a display language, preferably removes the need for maintaining multiple copies of the same document in multiple languages. Furthermore, because the translatable content is extracted from web pages and stored in a more manageable repository, translators may now preferably focus generally on the translation works and do not typically have to worry about damaging business logic in the codes while doing translations. 
     The foregoing has outlined rather broadly the features and technical advantages of the present invention in order that the detailed description of the invention that follows may be better understood. Additional features and advantages of the invention will be described hereinafter which form the subject of the claims of the invention. It should be appreciated by those skilled in the art that the conception and specific embodiment disclosed may be readily utilized as a basis for modifying or designing other structures for carrying out the same purposes of the present invention. It should also be realized by those skilled in the art that such equivalent constructions do not depart from the spirit and scope of the invention as set forth in the appended claims. The novel features which are believed to be characteristic of the invention, both as to its organization and method of operation, together with further objects and advantages will be better understood from the following description when considered in connection with the accompanying figures. It is to be expressly understood, however, that each of the figures is provided for the purpose of illustration and description only and is not intended as a definition of the limits of the present invention. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
       For a more complete understanding of the present invention, reference is now made to the following descriptions taken in conjunction with the accompanying drawing, in which: 
         FIG. 1  is a partial code example of a typical JSP/XML document with HTML tags and translatable content; 
         FIG. 2  is a partial code example of two typical JSP/XML documents supporting two languages for a particular web site; 
         FIG. 3  is a graphical flowchart that illustrates an embodiment of the present invention for translating a JSP/XML document into a JAVA™ class file; 
         FIG. 4  is a graphical tree depiction of the JSP/XML document in  FIG. 1 ; 
         FIG. 5  is a partial code example of a TMX document without translatable content; 
         FIG. 6  is a partial code example of the TMX document in  FIG. 5  after adding translation units based on the JSP/XML document in  FIG. 1 ; 
         FIG. 7  is a partial code example of the TMX document in  FIG. 6  with translations; 
         FIG. 8  is a graphical tree depiction of a JSP/XML document after adding selection control logic and translations from the TMX document in  FIG. 7 ; 
         FIG. 9  is a text representation of the graphical tree structure in  FIG. 8 ; 
         FIG. 10  is an exemplary JAVA™ code snippet generated based on the content shown in  FIG. 9 . 
     
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     The present invention may be implemented for any type of source document. The concept is to convert a single language source document into an executable injected with multiple, selectable language translations. The system and method may be implemented using any server page technology, such as Sun&#39;s JAVA SERVER PAGES™ (JSP), Macromedia&#39;s COLDFUSION™, Microsoft&#39;s ASP™ (or ASP™.NET), PHP Hypertext Preprocessor (PHP), or the like. Additional embodiments of the present invention may also be implemented directly using a data-centric meta-language, such as XML. The embodiments described herein will note implementation in JSP and/or XML; however, it is not intended and should not be taken to limit implementation of the present invention solely to XML or JSP server page technology. Furthermore, while the embodiments described herein refer to the resulting executable file as a JAVA™ class file, it should be noted that any type of executable, including an .exe file, may be used to implement the present invention. 
       FIG. 1  is a partial code example of a typical JSP/XML document with HTML tags and translatable content, wherein JSP/XML document  10  includes html tag  100 , head tag  101 , title tag  102 , body tag  103 , and paragraph tag  104 . Translatable text  105  and  106  also exist in JSP/XML document  10 . 
     In providing an international presence for a web site, there is typically a separate file for each web page in the web site that will contain a different language. For example,  FIG. 2  is a partial code example of two typical JSP/XML documents supporting two languages for a particular web site. The English version is saved on file  20 , while the Spanish version is saved on file  21 . Each time a specific display language is selected for viewing the web site, the specific page corresponding to the selected language must be processed (i.e., either file  20  or file  21  is displayed), to produce the desired web page. The maintenance of multiple copies of the same page wastes valuable space on the web server or other database/server, and creates considerable additional work when elements on any of the particular pages need to be changed and propagated through each of other pages. 
       FIG. 3  is a graphical flowchart that illustrates an embodiment of the present invention for processing JSP/XML documents, such as JSP document  10  from  FIG. 1 , into JAVA™ class file  307 . The process begins with JSP document  301  or XML document  302  (e.g.  FIG. 1 ) authored by web developers. When beginning with JSP document  301 , an application will preferably be used to convert JSP document  301  into an XML representation, as in XML document  302 . XML document  302  is preferably a structural depiction or data representation of JSP document  301 . Translatable content is preferably extracted from XML document  302  and placed into TMX document  303 , as shown in  FIG. 6 , using an algorithm for detecting the translatable content at the leaves and subtrees of the tree structure. The workflow then splits into two parallel processes. Translators may add translations to turn TMX document  303  into multilingual TMX document  304  (e.g.  FIG. 7 ). When new translations are added in document  304 , the document transformation from document  302  to document  305 , such as is shown in  FIG. 9 , will preferably incorporate the new translations. Otherwise, document  305  may use the default content in document  302  for all the languages. Once the multilingual XML document  305  is created, it will preferably be converted or extrapolated into JAVA™ code  306  (e.g.  FIG. 10 ). After compiling or translating JAVA™ code  306  into executable bytecode format, JAVA™ class file  307 , the output of document  301  becomes dynamic based on a requested locale and/or language. 
     Instead of building each web page for each desired language in a web site, the above-described embodiment of the present invention preferably allows an “automated” process for selecting the desired language elements for the specific web page version to be inserted into the underlying structure of the web page design. This feature of the present invention is available through the ability to represent the server page or web page document in a data-descriptive meta-language, such as XML. 
     Since JSP specification 1.2, JSP documents have been representable in an XML tree structure. Once in the XML format, elements are well-known that may convert a simple XML structure into a document object model (DOM). The XML DOM is an object model that can typically model any XML document regardless of the XML structure of the particular file. The DOM may be represented as the tree structure, such as that shown in  FIG. 4 .  FIG. 4  is a graphical tree depiction of the JSP/XML document in  FIG. 1 . The tree structure of the DOM corresponds to JSP document  10  of  FIG. 1 , with translatable content at the edge nodes of content subtrees  401  and  402 . 
       FIG. 5  is a partial code example of TMX document  50  without translatable content. The TMX format is a preferable format for use in the TTR. TMX document  50  is an XML-compliant document format designed by the Localisation Industry Standards Association (LISA) for allowing easier exchange of translation memory data between translation tools and/or vendors with little or no loss of critical data during the process The TMX specification may be found at http://www.lisa.org and is incorporated herein for all purposes. 
     After running an extraction algorithm to traverse the tree structure of XML DOM  40  in  FIG. 4 , at least, content subtrees  401  and  402  are identified for translations of the translatable content in the leaves of the tree structure. Preprocessing continues with the linearization of content subtrees  401  and  402 . Linearization takes content subtrees, such as  401  and  402 , and extracts the translatable content for assembly into a linear translatable segment, as required by the TMX specification. The translatable segment is used to compare for existing translations in the TTR. 
       FIG. 6  is a partial code example of the TMX document in  FIG. 5  after adding translation units based on the JSP/XML document in  FIG. 1 . TTR  60  includes translatable segments  601  and  602 , known in TMX as translation units (&lt;tu&gt;&lt;/tu&gt;). In operation, after linearizing content subtrees  401  and  402 , the resulting linear translation segment is preferably compared to each translation unit segment, such as segments  601  and  602 , to determine whether the linear translation segment contains data which has already been translated. 
       FIG. 7  is a partial code example of the TMX document of TTR  60  in  FIG. 6  with translations. If no corresponding translation already exists in TTR  60 , the linear translation segment is preferably added. Once the translation segments  601  and  602  have been added to TTR  60 , a translator may preferably translate segment into the desired languages (segments  701  and  702 ). The translator preferably only needs to access TTR  60  to search for new translation requests and will, thus, not have access to the source code. The translator will preferably save the translated file back to TTR  60  when the translation is completed either automatically or manually. 
       FIG. 8  is a graphical tree depiction of a JSP/XML document after adding selection control logic and translations from the TMX document in  FIG. 7 . The process of localizing XML DOM  40  ( FIG. 4 ) includes making an infrastructure change to disconnect the static translatable content of content subtrees  401  and  402 , as shown in  FIG. 6 , and preferably replace it with a selection control structure, such as switch-case tag  805  and  806 , in order to facilitate automating the exchange of language content, thus, making XML DOM a dynamic document. 
     As illustrated in  FIG. 3 , multilingual document  305 , in the first iteration, may not contain all the languages it must contain if translations in multilingual TMX document  304  are not completely done. In this situation, a copy of the original content subtree will be used for branches  802  and  804 . Document  301  and  302  will be re-processed if they have been modified by web developers or document  304  has been modified by translators. 
       FIG. 9  is a text representation of the graphical tree structure in  FIG. 8 . Text tree  90  includes switch statements  900  and  903  for providing selection logic to the executable file. Each of switch statements  900  and  903  contain selectable case translations  901 ,  902 ,  904 , and  905 , respectively. Thus, the executable file with switch statement  900  may preferably select either of case translations  901  and  902  depending on the desired language. Similarly, with switch statement  903 , case translations  904  and  905  may also be selected. 
       FIG. 10  is an exemplary JAVA™ code snippet generated based on the content shown in  FIG. 9 . JAVA™ code snippet  1000  may be generated by a code-generator for the XML/DOM file or the final JSP representation. JAVA™ code snippet  1000  includes selection logic instructions, switch statements  1001  and  1006 . Switch statements  1001  and  1006  preferably select translation cases  1002 ,  1003 ,  1007 , or  1008 , respectively, depending on the specific locale returned from getLocale( ) method  1011 . Based on the desired locale, switch statements  1001  and  1006  may preferably select translations  1004 ,  1005 ,  1009 , or  1010 . 
     It should be noted that in additional embodiments of the present invention, the XML DOM may be converted directly into Java source code without necessity of first converting to a JSP document. It should also be noted that, in additional embodiments of the present invention, the TMX TTR document as shown in  FIG. 7  will preferably be used as a part of the pre-processing for many of the JSP/XML pages in an entire web application. It may, therefore, occur that some of the JSP/XML pages may share paragraphs in which case the translations may be shared and reused. This preferably saves translation costs by eliminating duplicate translation requests. 
     The descriptions presented herein for one or another embodiment of the present invention show partial code examples to illustrate typical or representative code that may be used in implementing such embodiments of the present invention. It should be noted that such partial code examples are merely representative and, in no way, are intended to limit or restrict the present invention to specific code. 
     Although the present invention and its advantages have been described in detail, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims. Moreover, the scope of the present application is not intended to be limited to the particular embodiments of the process, machine, manufacture, composition of matter, means, and methods and steps described in the specification. As one of ordinary skill in the art will readily appreciate from the disclosure of the present invention, processes, machines, manufacture, compositions of matter, means, methods, or steps, presently existing or later to be developed that perform substantially the same function or achieve substantially the same result as the corresponding embodiments described herein may be utilized according to the present invention. Accordingly, the appended claims are intended to include within their scope such processes, machines, manufacture, compositions of matter, means, methods or steps.