The invention relates generally to software localization, which is the configuration of software for use by users of various languages, for example, languages that are different from the language in which the software source code was originally written.
A common challenge to be overcome when developing software for a global market is localization. Localization is the process by which a software engineer customizes a piece of software for use in a local area. Among other tasks, the localization process requires that the software engineer translate words and phrases in the software's user interface into the locally used language.
In order to assist in the process of localization, software developers have conventionally relied on the use of resource libraries.
Software 100 also includes a resource manager 125. Resource manager 125 is a software module that executes a process that maps resource references into calls to resources that are defined in a resource library. In the example of the conventional arrangement of
Software 100 also includes a resource library 115. Resource library 115 is a user configurable database, table or list of resources that are called or accessed by procedures (e.g., 105) included in application 103. Resource library 115 includes a number of resources 120a, 120b. Resources 120a, 120b are software objects, for example, text strings, numerical values, pictures, functions or procedures, that correspond to resource references.
When application 103 executes procedure 105, the application 103 calls resources 120a, 120b (using the resource manager 125) that correspond to the resource references 110a, 110b. For example, resource reference 110a may be a string variable “f” in the source code that embodies application 103. When an instruction containing string variable “f” is executed, application 103 calls resource library 115 (through the resource manager 125) to find the value corresponding to string variable “f” in corresponding resource 120a. Resource 120a may be a string with the text content “fish”.
The use of resource libraries that are called by the applications allow software developers to write more compact and efficient source code because the software developer need define resources only once in the resource library, then including multiple references to the same resource in the source code. Typically, a resource reference will be reused by an application many times throughout the application's execution, by repeated calls to the same resource whenever the application needs to access that resource. The reuse of resources provides an efficiency advantage as the resource (e.g., 120a) need only be defined once in the resource library 115, and it is accessible by multiple resource references (i.e., multiple occurrences of the resource reference 110a in the executable code of procedure 105) in the application 103. The use of resource libraries also ideally allows for the customization of software without modification to source code by allowing a localization engineer to change the values or content of resources called by the application. Instead of going through the source code of the application in order to change every resource reference, a developer customizing a piece of software need only change the resources in the resource library that the application calls, and the changed resource will be accessed every time the application references the corresponding resource.
Conventional systems for localization of resources are found in several different forms. In a closed architecture where a software producer sells only executable code, the compiling and linking process can incorporate all of the resources referenced in source code directly into the resulting executable file. In this system, resource localization is done internally at the software producer, but the software localization process is usually performed by a localization engineer who works separately from the source code developer. In other more open systems, the resource library, and tools to perform localization are provided to end users or third-parties that perform local customization. In certain conventional systems, the application is still sold as an executable module but the software package includes a customization tool that allows a third-party to customize a resource library by changing default resources accessed by the executable module. In these conventional systems, there is a one to one correspondence between the resources referenced in the executable code of the application and the resources in the resource library.
Reliance on conventional methods of using resource libraries to perform software customization can cause problems. For example, suppose that an application is required to display the word “fish” multiple times during its execution. The conventional method of providing this function is to include resource references in the application source code, for example a string variable “f”, and a corresponding resource in the resource library, the text “fish”. Every occurrence of the variable “f” in the execution of the application calls the resource library and returns the text “fish”, which the application displays. Ideally, in order to customize an application for use in an area with a different language, a localization engineer only needs to change the content of the resource library. A localization engineer would replace the English text “fish” in the resource library with the appropriate word in the local language. Then, when the application runs, the application's resource calls return locally correct content.
This system is effective so long as there is a one-to-one correspondence between words of different languages. Unfortunately, this is seldom the case. In English, the same word “fish” is used to denote both an aquatic animal that breaths through gills, and that same animal prepared as food. In Spanish however, there are separate words for these two things: pez which denotes an aquatic animal and pescado which denotes a dish made from the aquatic animal. In English a one-to-one correspondence between a resource reference in source code and a single text resource in a library for the word “fish” is not a problem. If an application is being localized for a Spanish speaking locale, however, changing the resource in the library from “fish” to “pez” might create problems if “pez” is not contextually appropriate for all of the resource references in the application.
By way of actual example, during initialization of the Microsoft WINDOWS operating system, WINDOWS displays a screen that includes the word “Welcome”. In English, the word “welcome” has a variety of meanings depending on context. “Welcome” can be (1) a noun, meaning “a greeting upon arrival” (e.g. “A warm welcome”); (2) a verb, meaning “to greet hospitably” (e.g. “It is a pleasure to welcome you to our home”); (3) an adjective, meaning “received with gladness” (e.g. “Your letter was very welcome”); and, finally, (4) an interjection, an exclamation used to express a greeting to a guest or newcomer upon arrival (e.g. “Welcome to our home!”). For versions of WINDOWS XP that have been localized to Russian-speaking locales, the “welcome” on the home screen has been translated to the Russian as a noun (meaning “a greeting”), which is contextually inappropriate, since originally an exclamation was intended (namely, “Welcome [to WINDOWS XP Operating System!]”).
Unfortunately, source code developers cannot anticipate all of the various scenarios under which a resource reference will need to be mapped to multiple references during localization. A localization engineer, who is tasked with localizing an application to a particular locale will recognize that word resources are being inappropriately displayed, but the localization engineer can only edit the one resource in the resource library that is being called by all of the corresponding resource references in the application. The conventional solution for this problem is for the localization engineer to request a new source code build that includes the required multiple resource references. This requires another iteration of source code development, which may be repeated multiple times for different localizations for different locales.
In certain embodiments, the invention includes a computer program product embodied in a computer readable medium, the computer program product comprising a source code including a plurality of resource references, a resource library including a plurality of default resources, with each default resource corresponding to one or more of the plurality of resource references, a default resource manager including instructions for mapping one or more of the plurality of resource references to one or more of the default resource references in the resource library, and a resource call index reciting a list of all resource calls made by the source code, wherein each entry in the resource call index uniquely identifies each resource call.
In certain embodiments, the resource library includes a new resource not associated with any of the plurality of resource references included in said source code. Certain embodiments include a double resource lookup manager including instructions for mapping an entry in the resource call index to the new resource. Still other embodiments include an override file, wherein the override file includes resource calls that are not mapped to default resources, and wherein, the double resource lookup manager includes instructions de-referencing resource calls included in the override file from their default resources.
In certain embodiments a method of localizing software is provided, the method comprising providing a source code including computer executable instructions including a plurality of resource references, wherein each occurrence of a resource reference in the source code generates a resource call that retrieves a default resource corresponding to the resource reference that generated the resource call, providing a resource library having a plurality of default resources corresponding to the plurality of resource references in the source code; and providing an index of resource calls, wherein the index of resource calls includes a list of all resource calls made by the source code, and wherein each entry in the resource call index uniquely identifies each resource call.
In certain embodiments, the method includes not retrieving a default resource corresponding to a resource reference that generated a resource call, thereby generating a de-referenced resource call. In other embodiments, the method includes, adding a new resource to the resource library; and mapping the de-referenced resource call to the new resource in the resource library. In some embodiments, providing an index of resource calls comprises executing the source code and tracking resource calls made during execution of the source code. In other embodiments, providing an index of resource calls comprises including unique identifiers in the source code for each resource call. In still other embodiments, providing an index of resource calls comprises automatically scanning the source code for resource calls.
In certain embodiments, preventing at least one resource call from retrieving a corresponding default resource, thereby generating a de-referenced resource call comprises providing an override file containing the at least one resource call.
Certain embodiments provide a computer program product, encoded in computer readable medium. The computer program product comprises a source code comprising a plurality of resource references, wherein when said source code is executed each occurrence of a resource reference generates a resource call that retrieves an associated default resource, a resource library comprising a plurality of default resources, and an index of resource calls reciting each occurrence of a resource call that occurs when said source code is executed.
In certain embodiments, the computer program product further comprises computer readable program code which causes a programmable computer processor to detect an override file, computer readable program code which, if no override file is detected, causes a programmable computer processor to map each of said plurality of resource references to an associated default resource, and computer readable program code which, if an override file is detected, causes a programmable computer processor to identify each resource call included in said override file.
In other embodiments, the resource library further comprises one or more newly-defined resources, and the computer program product further comprising computer readable program code which, if an override file is detected, causes a programmable computer processor to map each resource call included in said override file to a newly defined resource.
Some of the functional units described in this specification have been labeled as modules (e.g., modules 240, 250
Modules (e.g., modules 240, 250
Indeed, a module of executable code (e.g., modules 240, 250
Reference throughout this specification to “one embodiment,” “an embodiment,” or similar language means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, appearances of the phrases “in one embodiment,” “in an embodiment,” and similar language throughout this specification may, but do not necessarily, all refer to the same embodiment.
The schematic flow chart diagrams included are generally set forth as logical flow-chart diagrams (e.g.,
The described operations may be implemented as a method, apparatus or article of manufacture using standard programming and/or engineering techniques to produce software, firmware, hardware, or any combination thereof. The described operations may be implemented as code maintained in a “computer readable medium”, where a processor may read and execute the code from the computer readable medium.
A computer readable medium may comprise media such as magnetic storage medium (e.g., hard disk drives, floppy disks, tape, etc.), optical storage (CD-ROMs, DVDs, optical disks, etc.), volatile and non-volatile memory devices (e.g., EEPROMs, ROMs, PROMs, RAMs, DRAMs, SRAMs, Flash Memory, firmware, programmable logic, etc.), etc. The code implementing the described operations may further be implemented in hardware logic implemented in a hardware device (e.g., an integrated circuit chip, Programmable Gate Array (PGA), Application Specific Integrated Circuit (ASIC), etc.). Still further, the code implementing the described operations may be implemented in “transmission signals”, where transmission signals may propagate through space or through a transmission media, such as an optical fiber, copper wire, etc.
The transmission signals in which the code or logic is encoded may further comprise a wireless signal, satellite transmission, radio waves, infrared signals, Bluetooth, etc. The transmission signals in which the code or logic is encoded is capable of being transmitted by a transmitting station and received by a receiving station, where the code or logic encoded in the transmission signal may be decoded and stored in hardware or a computer readable medium at the receiving and transmitting stations or devices.
An “article of manufacture” or “computer program product” comprises computer readable medium, hardware logic, and/or transmission signals in which code may be implemented. A device in which the code implementing the described embodiments of operations is encoded may comprise a computer readable medium or hardware logic. Of course, those skilled in the art will recognize that many modifications may be made to this configuration without departing from the scope of the present invention, and that the article of manufacture may comprise suitable information bearing medium known in the art.
Furthermore, the described features, structures, or characteristics of the invention may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided, such as examples of programming, software modules, user selections, network transactions, database queries, database structures, hardware modules, hardware circuits, hardware chips, etc., to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, materials, and so forth. In other instances, well-known structures, materials, or operations are not shown or described in detail to avoid obscuring aspects of the invention.
Embodiments of the invention are based on the idea of indexing all the resource calls performed by a procedure embodied in source code by providing each resource call with a unique identifier. Once resource calls have been indexed, the procedure accesses resources in a resource library indirectly through a double lookup resource manager or wrapper. The double lookup resource manager checks whether each uniquely identified resource call has been overridden by a flag set in an override file. In the case where a resource call has not been overridden, the resource call retrieves the resource originally associated with the resource reference in the source code. If a resource call has been overridden, the resource call is mapped to a new resource defined specifically for that call in the resource library. For example, in the event of a conflict in contextual meanings between the two different resource calls referencing the same resource (e.g. “pez” and “pescado” calls referencing the same resource “fish”), the localization engineer obtains the ability (1) to create a new resource in the resource library, (2) override the incorrect call, and (3) re-reference it to the newly created resource using the unique identifier of that resource call. The index of resource calls is created either at the stage of software development by the author of the source code, through an automated procedure that scans already drafted source code for resource calls, or by executing the procedure and tracking the resource calls made during the procedure's execution.
The arrangement of
The arrangement of
The arrangement of
In one embodiment, resource call index 230 is included in the source code that embodies procedure 205. In this embodiment, the source code author, when providing code including resources references 210a, 210b, 210c, also optionally includes an index of all resource calls in the source code. Where the resource call index 230 is included in the source code that embodies procedure 205, the resource call index 230 may be provided as an appendix to the source code, or may be distributed throughout the source code with each resource call being included with each resource reference. Alternatively, the resource call index 230 can exist as a separate file or database that exists apart from the source code that embodies application 205. Where the resource call index 230 exists as a separate file from the source code, the resource call index 230 can be built manually by an examination of the source code embodying procedure 205, or is generated automatically by an automated scan of the source code that embodies procedure 205.
The arrangement of
Double lookup resource manager 250 also includes resource mapping instructions 260. Resource mapping instructions 260 provide new mapping instructions for all resource calls that are included in the override file 260. For example, in the case where resource call 235a2 should not map to original resource 225a, resource mapping instructions 260 would include instructions sufficient to implement the rule, “resource call 235a2 maps to new resource 225a2.” The use of double lookup resource manager 250 as a process that overlays the conventionally provided default resource manager 240, allows for the efficiency advantages of resource libraries to be preserved while simultaneously allowing flexibility in customization. Since the default resource manager 240's default mapping instructions 245 map all resource reference calls to their default resources until a particular resource call is de-referenced by inclusion in the override file 260, a localization engineer can preserve all resource calls in their default condition and only re-reference the resource calls that require new resources.
In the example of
In the exemplary embodiment of
The mapping of resource calls to resource in the resource library can be achieved in other ways. For example, in one embodiment, the localization engineer adds override file 255 to the double lookup resource manager 250. In the absence of an override file 255, the default resource manager 240 executes default resource mapping instructions 245 normally, i.e., by mapping every resource reference in the procedure 203's source code to its corresponding default resource in the resource library 220. In one embodiment, the existence of override file 255 causes the double lookup resource manager 250 to look to the override file to locate resource calls that have been overridden. Where an entry exists in override file 255, double lookup resource manager 250 looks to resource mapping instructions 260 to map the resource call that has been overridden to a new resource that has been created. All other resources references are mapped to their original resources through the default resource mapping instructions 245.
The mapping of resource calls to new resources in the libraries can be achieved in still other ways. For example, in certain embodiments, resource calls 235a1, 235b1, 235c1, 235a2 include flags, which when set to a first default value, preserve the default mapping arrangement, but when set to a second predetermined value, disable the default mapping arrangement. This in the example of
It is important to note that the method of the present invention can be applied to resources of any type including text strings, numerical values, pictures, or even complex resources such as data structures or other procedures. Moreover, the method of the invention can be applied to any existing piece of software (compiled or interpreted) that uses resource libraries (or any type of resources), and is therefore not limited to modification of software for localization. Embodiments of the invention have additional advantages as well. For example, in certain cases, even in cases where translation of library resources into a local language is straightforward, a software user interface presented to a user after localization can be suboptimal. This may occur, for example, where an English word is translated into a longer word in the local language. Even where the local word is correct contextually, the user interface can appear strange or lack required text in such situations. The method of the present invention allows the localization engineer to correct this by defining resources differently for different user interface presentation situations.
While the preferred embodiments of the present invention have been illustrated in detail, it should be apparent that modifications and adaptations to those embodiments may occur to one skilled in the art without departing from the scope of the present invention as set forth in the following claims.