Inheritance of properties files with locale chain support

A method is provided of displaying a GUI of a first dialog. The method includes, for a localizable display element of a set of localizable display elements of the first dialog, each element having an element name, (a) searching through a first chain of properties files of the first dialog for a display term mapped to by the element, (b) in response, determining that the display term is not found within the first chain, (c) in response, further searching through a second chain of properties files associated with a second dialog for the display term, the first chain being pre-configured to inherit properties from the second chain, and (d) when the display term is found within the second chain, displaying the display term found within the second chain in place of the localizable display element of the first dialog box on the GUI of the first dialog.

RELATED APPLICATION

This Disclosure may be considered to be related to another disclosure, entitled “Specifying Sizes for User Interface Elements,” filed on even date herewith with the United States Patent and Trademark Office as a Patent Application, the first named inventor being Scott E. Joyce.

BACKGROUND

Graphical user interfaces (GUIs) often utilize dialog boxes to seek user input. In order to allow the dialog boxes to be localized to different languages and other localized configurations, some developers distribute each dialog box with one or more localized properties files to allow features of each dialog box to be properly localized.

SUMMARY

The above-described conventional systems for localizing dialog boxes suffers from deficiencies. For example, the developer is required to provide separate properties files for each dialog box even if some dialog boxes share common features; this can lead to inconsistent translations between similar features of different dialog boxes, and it also increases the translation burden on the translators.

Thus, it would be desirable to alleviate these concerns by permitting dialog boxes to inherit from one another so that common features may be easily harmonized across several related dialog boxes. Thus, embodiments are directed to techniques for enabling inheritance of properties files between related dialog boxes of a GUI while also providing for localization.

One embodiment is directed to a method of displaying a graphical user interface (GUI) of a first dialog box on a display screen of a computing device. The method includes, for a localizable display element of a set of localizable display elements of the first dialog box, each localizable display element having a non-localized element name, (a) searching through a first chain of properties files of the first dialog box for a display term mapped to by the non-localized element name of the localizable display element, (b) in response to searching through the first chain of properties files, determining that the display term mapped to by the non-localized element name of the localizable display element is not found within the first chain of properties files, (c) in response to determining that the display term mapped to by the non-localized element name of the localizable display element is not found within the first chain of properties files, further searching through a second chain of properties files associated with a second dialog box for the display term mapped to by the non-localized element name of the localizable display element, the first chain of properties files being pre-configured to inherit properties from the second chain of properties files, and (d) when the display term mapped to by the non-localized element name of the localizable display element is found within the second chain of properties files, displaying the display term mapped to by the non-localized element name of the localizable display element found within the second chain of properties files in place of the localizable display element of the first dialog box on the GUI of the first dialog box on the display screen of the computing device. Other embodiments are directed to a computerized apparatus and a computer program product for performing methods similar to that described above.

DETAILED DESCRIPTION

Embodiments are directed to techniques for enabling inheritance of properties files between related dialog boxes of a graphical user interface (GUI) while also providing for localization.

FIG. 1depicts an example system30. System30includes a computing device32which connects to a display34and an input device36via a user interface (UI)33. UI33allows the computing device32to interact with a user37by displaying a dialog box GUI35(as well as various other GUI elements) to the user37on the display34and receiving instructions from the user37via the input device36. Display34may be any kind of display device capable of displaying a GUI, such as, for example, a cathode ray tube, a liquid crystal display, a projection device, a plasma display, or a similar device as is well-known in the art. Display34may also include more than one display device, each of which may use the same or different display technologies. Input device36may include any kind of user input devices such as, for example, a keyboard, a keypad, a mouse, a trackpad, a tracking ball, a pen-based digitizer, a stylus-based digitzer, or a similar device as is well-known in the art. Input device36may also include more than one user input device. In some embodiments, display34and user input device36may be combined into a single device, such as, for example, a touch-sensitive display screen. UI33may include one or more of a graphics adapter, a touch-based input controller, a mouse interface, a keyboard interface, a universal serial bus, or other similar devices.

Computing device32may be any kind of computing device, such as, for example, a personal computer, a server computer, an enterprise server computer, a workstation computer, a cellular phone, a smart phone, a tablet, a laptop computer, etc. Computing device32also includes a processor38, local storage39, and memory40.

Processor38may be any kind of processor or set of processors configured to perform operations, such as, for example, a microprocessor, a multi-core microprocessor, a digital signal processor, a collection of electronic circuits, or any combination of the above.

Memory40may be any kind of digital system memory, such as, for example, RAM. Memory40stores programs and applications (e.g., mobile apps) executing on processor38as well as data used by those programs. Memory40stores an operating system (not depicted) as well as various other software modules (some of which may be independent applications, while others are parts of other applications or the operating system).

Memory40thus includes one or more client applications42configured to display various dialog boxes44(depicted as dialog boxes44A,44B,44C, . . . ,44N) within dialog box GUI35of display34. Each dialog box44may be thought of as a logical object (e.g., an instantiation of a class within an object-oriented programming language) configured to display a particular dialog box GUI35. Each dialog box44is associated with a bundle46(depicted as bundles46A,46B,46C, . . . ,46N) of properties files48(depicted as sets of properties files48A,48B,48C, . . . ,48N stored within storage39, each set being associated with a particular bundle46) chained together and loaded into memory40. Resource manager43is a software module of application42configured to load and assemble each bundle46in association with its respective dialog box44(e.g., bundle A is associated with dialog box A, bundle B is associated with dialog box B, etc.) based upon a configuration provided by configuration manager45. Configuration manager45is a software module of application42configured to provide a localization order for the application42. Thus, for example, configuration manager45may be configured to provide that the localization order is first Spanish (es) followed by English for default properties. In another example, configuration manager45may be configured to provide that the localization order is first original equipment manufacturer (OEM)-specific Spanish (es.oem) followed by generic Spanish (es) followed by OEM-specific English (oem) followed by English for default properties. This latter example allows licensed OEM vendors to localize terminology displayed within dialog box GUIs35for various dialog boxes44to display terms unique or specific to that particular vendor. In addition to each bundle46having a localization order provided by the configuration manager45, one or more of the bundles46also has an inheritance instruction47(as depicted, bundles46B and46C have inheritance instructions47) which allows that bundle46to inherit properties from properties files48within a bundle46of another dialog box44.

Memory40may include both a system memory portion for storing programs and data in active use by the processor38as well as a persistent storage portion (e.g., solid-state storage and/or disk-based storage) for storing programs and data even while the computing device32is powered off. The operating system and the software modules (e.g.,43,44,45) are typically stored both in system memory and in persistent storage so that they may be loaded into system memory from persistent storage upon a system restart. Software modules43,44,45, when stored in non-transient form either in system memory or in persistent storage, form a computer program product. The processor38running one or more of these software modules43,44,45thus forms a specialized circuit constructed and arranged to carry out the various processes described herein.

In some embodiments, various components of the computing device32(e.g., the processor38, graphics adapter for the UI33, various ancillary components, etc.) may be integrated into a single integrated circuit as a system on a chip (SoC), as is known in the art.

FIG. 2depicts an example set50of related dialog boxes44and associated bundles46. As depicted, parent dialog box44A includes various localizable display elements52,54,56. In a default (English) configuration, the title element52displays as “Common Dialog,” the OK element54displays as “OK,” and the cancel element56displays as “Cancel.” However, localization with reference to associated bundle46A may allow one or more of the localizable display elements52,54,56to display differently. Thus, bundle46A includes a set48A of properties files48arranged in a chain order62A (generically chain order62) that prioritizes Spanish over English. So, when the parent dialog box44A is to be displayed as dialog box GUI35, parent dialog box44A issues a call to resource manager43to localize each localizable display element52,54,56with respect to the set48A of properties files48according to the chain order62A. Thus, in order to display OK element54, resource manager43first searches DialogA.es.oem.props for an OK property, and, if none is found, resource manager43continues to search DialogA.es.props for an OK property, followed by DialogA.oem.props and then DialogA.props. In some embodiments, each properties file48is arranged as a set of key-value pairs. Table 1 includes example code for the properties files48of the set48A associated with parent dialog box44A.

Thus, although the OK element54displays according to the default English even for Spanish and OEM systems, the cancel element56displays differently in Spanish, and the title element52varies between all combinations of English/Spanish and OEM/non-OEM.

As depicted, intermediate dialog box44B includes various localizable display elements52,54,56,58. In the default (English) configuration, elements52,54, and56display as in parent dialog box44A. New deletion confirmation element58displays as “Delete File.” However, localization with reference to associated bundle46B may allow one or more of the localizable display elements52,54,56,58to display differently. Thus, bundle46B includes a set48B of properties files48arranged in a chain order62B (generically chain order62) that prioritizes Spanish over English. So, when the intermediate dialog box44B is to be displayed as dialog box GUI35, intermediate dialog box44B issues a call to resource manager43to localize each localizable display element52,54,56,58with respect to the set48B of properties files48according to the chain order62B. Thus, in order to display OK element54, resource manager43first searches DialogB.es.oem.props for an OK property, and, if none is found, resource manager43continues to search DialogB.es.props for an OK property, followed by DialogB.oem.props and then DialogB.props. In some embodiments, each properties file48is arranged as a set of key-value pairs. Table 2 includes example code for the properties files48of the set48B associated with intermediate dialog box44B.

Because the OK element54is not defined within any of the properties files48of the set48B associated with intermediate dialog box44B, resource manager43looks for an inherit instruction. As shown in Table 2, the DialogB.props file includes an inherit statement indicating inheritance from parent dialog box44A. Thus, resource manager43continues to search bundle46A for the OK property, ultimately finding it within DialogA.props. However, deletion confirmation element58displays differently in Spanish, and the title element52varies between all combinations of English/Spanish and OEM/non-OEM.

As depicted, child dialog box44C includes various localizable display elements52,54,56,58(twice), and60. In the default (English) configuration, elements52,54,56, and58display as in intermediate dialog box44B. New conjunction element60displays as “and.” However, localization with reference to associated bundle46B may allow one or more of the localizable display elements52,54,56,58,60to display differently. Thus, bundle46C includes a set48C of properties files48arranged in a chain order62C (generically chain order62) that prioritizes Spanish over English. So, when the child dialog box44C is to be displayed as dialog box GUI35, child dialog box44C issues a call to resource manager43to localize each localizable display element52,54,56,58,60with respect to the set48C of properties files48according to the chain order62C. However, as depicted, OEM properties files are absent from the storage39for child dialog box44C, so chain order62C only has two properties files. In some embodiments, each properties file48is arranged as a set of key-value pairs. Table 3 includes example code for the properties files48of the set48C associated with child dialog box44C.

Because the OK element54is not defined within any of the properties files48of the set48C associated with child dialog box44C, resource manager43looks for an inherit instruction. As shown in Table 3, the DialogC.props file includes an inherit statement indicating inheritance from intermediate dialog box44B. Thus, resource manager43continues to search bundle46B for the OK property. However, as before, since the OK element54is not defined within any of the properties files48of the set48B associated with intermediate dialog box44B, inheritance proceeds to the bundle46A of parent dialog box44A.

In another arrangement, instead of child dialog box44C inheriting from intermediate dialog box44B, which, in turn, inherits from parent dialog box44A, a similar result can be achieved by child dialog box44C first inheriting from intermediate dialog box44B, and then child dialog box44C further inheriting directly from parent dialog box44A. In another, less efficient arrangement, both child dialog box44C and intermediate dialog box44B may inherit from parent dialog box44A; in such an arrangement, parent dialog box44A will be searched twice.

FIG. 3depicts a similar result using an inheritance matrix70. In order to display a localizable display element52,54,56,58,60of child dialog box44C, resource manager43first searches the properties files48of the local child bundle46C according to order62C. Upon not finding a localization for localizable display element52,54,56,58,60within child bundle46C, inheritance order72C proceeds towards searching the properties files48of the intermediate bundle46B according to intermediate order62B. Upon not finding a localization for localizable display element52,54,56,58,60within intermediate bundle46B, inheritance order72B proceeds towards searching the properties files48of the parent bundle46A according to parent order62A.

FIG. 4illustrates, as method100, the operation of resource manager43on computing device32for displaying a localizable display element of a dialog box44with an inheritance scheme. It should be understood that any time a piece of software, such as, for example, client application42, resource manager43, dialog boxes44, and/or configuration manager45is described as performing a method, process, step, or function, in actuality what is meant is that a computing device (e.g., computing device32) on which that piece of software is running performs the method, process, step, or function when executing that piece of software on its processor (e.g., processor38). It should also be understood that, in some embodiments, instead of processor38executing code of client application42, resource manager43, dialog boxes44, and/or configuration manager45, specialized circuitry of the mobile computing device32operates to perform the method, process, step, or function directly in hardware. Method100may be performed by resource manager43upon receiving a command from a dialog box44(e.g., child dialog box44C) to localize a localizable display element for display within dialog box GUI35.

In step110, resource manager43searches the bundle46associated with the current dialog box44for a display term mapped to be the non-localized element name of the localizable display element. The current dialog box44is the dialog box atop a search stack. The search stack starts off including only the dialog box44that issued the original localization request (e.g., child dialog box44C), although in later iterations, the top element of the search stack will be a different dialog box44). As depicted, searching the bundle46includes first searching a first properties file48of the bundle46according to the chain order62for that dialog box44(sub-step112), and proceeding to the remaining properties files48of the bundle46according to the chain order62until reaching the last (default) properties file48of the bundle in the chain order62(sub-step114). In some embodiments, searching the bundle46includes searching through the properties files48of the bundle46(according to the chain order62, as described above) for a key-value pair having a key equal to the non-localized element name of the localizable display element and selecting the value mapped to by that key, if the key is found within the bundle46. An example non-localized element name is the key DeletionConfirmation for localizable display element58, which localizes to values “Delete Key” or “Borrar el Archivo” depending whether the language is English or Spanish within intermediate bundle46B.

In step120, resource manager43evaluates whether or not the display term for the localizable display element has been found within step110. If it has, then execution proceeds to step130, in which resource manager causes the found display term to be displayed within the dialog box GUI35in the place indicated by the location of the localizable display element within the dialog box44that originally issued the localization call to the resource manager43. In some embodiments, step130may be performed by the dialog box44itself rather than the resource manager43.

On the other hand, if step120evaluates negatively, then execution proceeds to step140. In step140, resource manager43checks whether the current bundle46(i.e., the bundle46associated with the dialog box44currently at the top of the search stack) inherits from any other dialog box44. This step may be performed by the resource manager43looking for an #inherit instruction within the last properties file48within bundle46according to the chain order62. In some embodiments, #inherit instructions may be found in any properties files48of the bundle46, but in many embodiments, #inherit instructions are ignored unless located within the last properties file48within bundle46according to the chain order62. If there is an #inherit instruction, then the current dialog box is deemed to inherit from the listed dialog box. If there are multiple #inherit instructions (or if there is a single instruction listing multiple dialog boxes), then an order is assigned (typically the order in which the inheritances are listed) for inheritance to proceed in. In some embodiments, in order to prevent infinite loops, if the listed dialog box44from which the current dialog box44inherits is already listed within the search stack, then the listed dialog box44is skipped, proceeding to the next inherited dialog box (or, if there are no more, then returning a negative value for inheritance). If there is a dialog box44from which the current dialog box44inherits, then step140yields a positive value, and execution proceeds with step150.

In step150, resource manager43adds the dialog box44from which the current dialog box44inherits to the top of the search stack, thereby updating the identity of the current dialog box44. Then execution proceeds to step110for a search of the new current dialog box44for the display term mapped to be the non-localized element name of the localizable display element.

On the other hand, when step140yields a negative result, execution proceeds with step160. In step160, resource manager43evaluates whether or not the search stack can be popped. If the current dialog box44is the last element on the stack, then the stack cannot be popped; since the display term mapped to be the non-localized element name of the localizable display element has not yet been found and the search stack is empty, there has been an error. Thus, execution proceeds to step180, in which resource manager43logs an error. This may happen, for example, during development and de-bugging. As another example, an error may occur when an installation has been corrupted or when the localization for an obscure locale has been insufficiently tested. The logged error may help system administrators to determine what is wrong with the localization configuration.

On the other hand, if step160yields a positive result (i.e., the search stack can be popped), the operation proceeds to step170, in which resource manager43pops the stack, thereby returning to the previous current dialog box44. Then operation proceeds with step140to determine whether the current dialog box44inherits from any additional dialog boxes44.

Ultimately, execution will terminate either with step130or with step180. Method100can then be repeated for every localizable display element for each dialog box44that is to be displayed within dialog box GUI35.

It should be understood that although method100has been described as being performed by resource manager43, some steps of method100may, in fact, be delegated to other classes and functions, not being performed directly be resource manager43.

Thus, techniques have been described for enabling inheritance of properties files48between related dialog boxes44of a dialog box GUI35while also providing for localization.

For example, although various embodiments have been described as being methods, software embodying these methods is also included. Thus, one embodiment includes a tangible non-transitory computer-readable storage medium (such as, for example, a hard disk, a floppy disk, an optical disk, computer memory, flash memory, etc.) programmed with instructions, which, when performed by a computer or a set of computers, cause one or more of the methods described in various embodiments to be performed. Another embodiment includes a computer which is programmed to perform one or more of the methods described in various embodiments.

Furthermore, it should be understood that all embodiments which have been described may be combined in all possible combinations with each other, except to the extent that such combinations have been explicitly excluded.

Finally, even if a technique, method, apparatus, or other concept is specifically labeled as “conventional,” Applicants make no admission that such technique, method, apparatus, or other concept is actually prior art under 35 U.S.C. §102, such determination being a legal determination that depends upon many factors, not all of which are known to Applicants at this time.