A method for multilingual support in an application and related components
By establishing a preset font library and calling appropriate font files according to the language environment, the problem of garbled text and incomplete character display caused by inconsistent fonts in Windows programs on Linux systems was solved, and normal character display of the application was achieved.
Patent Information
- Application Number
- CN202211164689.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-23
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2042-09-23
AI Technical Summary
When running Windows programs on a Linux system, inconsistent font files can cause garbled text and incomplete character display. Existing solutions are either not stable enough or require a high level of technical expertise.
A preset font library is established. By detecting the application's language environment, it is determined whether there is a mapping relationship between the font files in the preset font library and the language environment, and the appropriate font file is called to start the application, avoiding the direct use of the operating system's built-in font library.
This ensures that the application displays all characters correctly after startup, avoiding garbled text and incomplete character display, simplifying operating system compatibility issues and reducing technical requirements.
Smart Images

Figure CN115454514B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of text display, and in particular to a method for multilingual support in an application and related components thereof. Background Technology
[0002] Because Windows programs are closed-source, developers can only design them from the lowest level. To make a Windows program run on a Linux system, significant time and effort are required to modify its underlying code. To save time and effort, current technology typically uses Wine to run Windows programs. Wine is a Linux-based program that allows Windows programs to run on Linux. However, the font files used by Linux may be incompatible with those required by Windows programs, potentially causing garbled text and incomplete character display when running Windows programs with Wine. Summary of the Invention
[0003] The purpose of this invention is to provide a multilingual support method for applications and related components, which enables the application to display all characters correctly after startup, and avoids problems such as garbled text and incomplete character display caused by inconsistent font files.
[0004] To address the aforementioned technical problems, this invention provides a method for multilingual support in applications, comprising:
[0005] When an application launch command is detected in a preset program, the language environment of the application is determined;
[0006] Determine whether there is a mapping relationship between the font file and the locale in each font file in the preset font library;
[0007] If a mapping relationship exists between the font file and the locale, then the application is started by calling the font file that is mapped to the locale.
[0008] Preferably, before determining whether there is a mapping relationship between the font file and the locale in each font file of the preset font library, the method further includes:
[0009] Determine the file path of the preset font library;
[0010] Establish a soft link between the preset program and the file path, and proceed to the step of determining whether there is a mapping relationship between the font file and the locale in each font file of the preset font library.
[0011] Preferably, before determining the locale of the application, the method further includes:
[0012] When a font file to be stored is received, it is determined whether there is a font file in the preset font library that is consistent with the font file to be stored.
[0013] If it does not exist, the font file to be stored is stored in the preset font library;
[0014] If it exists, the font file to be stored will not be stored in the preset font library.
[0015] Preferably, determining the locale of the application includes:
[0016] Obtain the language identifier from the application's configuration file;
[0017] The language environment of the application is determined based on the language identifier.
[0018] Preferably, after determining whether there is a mapping relationship between the font file and the locale in each font file of the preset font library, the method further includes:
[0019] If there is no mapping relationship between the font file and the locale, a prompt signal containing the locale is generated and sent to the prompt module so that the prompt module can issue a prompt.
[0020] Preferably, when there are N font files that have a mapping relationship with the locale, where N is an integer not less than 2, calling the font file that has a mapping relationship with the locale to start the application includes:
[0021] Determine whether a pre-specified font file corresponding to the locale exists among the N font files;
[0022] If it exists, the application is launched by calling the pre-specified font file;
[0023] If it does not exist, then any of the font files will be used to launch the application.
[0024] Preferably, after launching the application by calling the font file that has a mapping relationship with the locale, the method further includes:
[0025] When a font selection instruction is received, the corresponding font file is determined from the N font files according to the font selection instruction;
[0026] Modify the text font in the application according to the font file corresponding to the font selection instruction.
[0027] This application also provides a multilingual support device for an application, including:
[0028] Memory, used to store computer programs;
[0029] A processor, used to implement the multilingual support method for an application as described above when executing the computer program.
[0030] This application also provides a multilingual support system for an application, including:
[0031] The language environment determination unit is used to determine the language environment of the application when a startup command of the application in a preset program is detected;
[0032] The judgment unit is used to determine whether there is a mapping relationship between the font file and the locale in each font file in the preset font library; if there is a mapping relationship between the font file and the locale, the calling unit is triggered.
[0033] The calling unit is used to call the font file that has a mapping relationship with the locale to start the application.
[0034] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the multilingual support method for the application described above.
[0035] This invention provides a multilingual support method for applications and related components, relating to the field of text display. When an application launch command is detected in a preset program, the application's language environment is determined. It is then determined whether a mapping relationship exists between font files in a preset font library and the language environment. If such a mapping exists, the application is launched by calling the font file with the mapping relationship. Upon application launch, the corresponding font file is first located in the preset font library based on the application's language environment, and then that font file is used to continue launching the application. Because of the mapping relationship between the font file and the language environment, the application can display all characters correctly after launch, avoiding problems such as garbled text and incomplete character display caused by inconsistent font files. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the prior art and embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 A flowchart illustrating a method for multilingual support in an application provided in this application;
[0038] Figure 2 A schematic diagram of the structure of a multilingual support device for an application provided in this application;
[0039] Figure 3 This is a schematic diagram of the structure of a multilingual support system for an application provided in this application. Detailed Implementation
[0040] The core of this invention is to provide a multilingual support method for applications and related components, which enables applications to display all characters correctly after startup, avoiding problems such as garbled text and incomplete character display caused by inconsistent font files.
[0041] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0042] Please refer to Figure 1 , Figure 1 A flowchart of a multilingual support method for an application provided in this application includes:
[0043] S1: When an application's launch command in the preset program is detected, the application's locale is determined;
[0044] As users increasingly demand program compatibility, requiring programs to launch and execute on multiple operating systems, Windows programs face challenges. Since Windows DLLs (Dynamic Link Libraries) are closed-source, enabling a Windows program to run on other operating systems, such as Linux, requires designing from the lowest level of the Windows program's code. This is time-consuming, involving extensive code design and testing for Linux compatibility. Furthermore, code design demands a certain level of technical skill and is susceptible to human error, such as typos or bugs. Therefore, Wine is commonly used to achieve this. Wine is a program that can launch and run on Linux, Mac, and FreeBSD. Windows programs can be launched and run within Wine. Thus, by launching Wine on a Linux system and then launching a Windows program within Wine, the goal of running a Windows program on Linux is achieved without requiring any redesign of the Windows program itself. However, due to differences in font libraries, font file encoding formats, and text configurations between other systems and Windows fonts, Wine often encounters garbled characters or incomplete character display when running Windows programs. Currently, there are two solutions: one is to update the Wine version, as higher versions offer better language environment optimization and text support; the other is to manually modify the Wine registry to update its text support. However, updating the Wine version requires waiting for updates from the Wine developers, and the update frequency and content are unstable. If the latest version of Wine still cannot resolve the text display problem, it may remain unresolved for a considerable period. Manually modifying the registry requires a certain level of technical expertise and is not suitable for widespread use.
[0045] To address the aforementioned technical issues, this application establishes a new preset font library to store various font files. When a Windows program is launched within Wine, i.e., when an application is launched within a preset program, the font files from the preset font library are used to launch the Windows program, thereby avoiding text display errors after the Windows program starts. Specifically, when a user launches a Windows program within Wine, i.e., when the application's launch command is detected within a preset program, the application is not launched directly. Instead, the locale of the application is first determined. The locale can be determined based on parameters such as the application's language identifier, language configuration file, text syntax, or character format. For example, the language environment of an application can be determined based on language configuration files and text grammar. If the language configuration file is detected to be in English, it means that all characters displayed in the application are English letters. Then, based on the text grammar, it can be determined whether the application displays British English, American English, or another form of English. Alternatively, the language environment can be determined based on the language identifier. If the application's language identifier is CN, it means that the text in the application is Chinese; if the application's language identifier is EN, it means that the text in the application is English. Therefore, terms like Simplified Chinese or British English can be considered the language environment of an application; that is, each branch of a major language is considered a language environment. It is understandable that applications usually use more than one language; their language environment may be a combination of multiple languages, such as Simplified Chinese plus American English. Therefore, when determining the language environment, it is necessary to consider all the text in the application, not just a portion of the text.
[0046] S2: Determine whether there is a mapping relationship between font files and locale in each font file in the preset font library;
[0047] After determining the application's locale, it's necessary to find font files suitable for that locale. Specifically, because different operating systems have different font file encoding formats and text configurations, to avoid situations where the application cannot display text correctly due to these differences, a default font library can be created within the operating system. This default font library is independent of the operating system's built-in font library, and the font files stored in these two libraries are also different and independent. The default font library can store font files specific to the operating system the application is running. For example, if the application is a Windows program, a default font library specifically for storing Windows font files can be created in a Linux operating system. Storing Windows font files such as simsun.ttc or other Windows font files with extensions like .ttc or .ttf in the default font library is equivalent to moving the Windows operating system's font library to the Linux system. The default font library stores font files used by the Windows system. Although the Linux system itself cannot use these Windows font files, because the Wine program can execute various files and programs in the Windows system, a default font library can be created to provide font files for Wine. In practical applications, after determining the locale, font files with a mapping relationship can be found. Specifically, each font file has its corresponding metadata, which refers to data containing information such as the font file's character format, encoding format, and attributes. Metadata is essentially a description of the font file's basic information. Based on the font file's metadata, it can be determined which locale the font file is used in. Therefore, once the locale of the application is determined, the font file used in that locale is a font file with a mapping relationship to that locale. In addition to the font file's metadata, its locale can also be determined based on the font file's language identifier. For example, the language identifier CN indicates that the font file is used in a Chinese environment. After determining that the locale is Chinese, the font file used in the preset font library for the Chinese environment is found; this is the font file with a mapping relationship to the Chinese environment. This application does not limit how the mapping relationship between font files and locales is determined.
[0048] S3: If there is a mapping relationship between font files and locales, then the application is started by calling the font file that is mapped to the locale.
[0049] After finding a font file that maps to the application's locale, the application can be launched using that font file. Since the font file is designed for that locale, the application will display all characters correctly after launch. Furthermore, considering that an application may support multiple languages, the mapping relationship needs to be determined for each language in the application, and the application should be launched using all mapped font files. For example, if the application includes Simplified Chinese and American English, separate font files for each language need to be determined, resulting in font files for Simplified Chinese and American English. Finally, these two font files are used to launch the application, and the text in different languages will be displayed according to the corresponding font file.
[0050] In summary, when an application's launch command is detected in the preset program, the application's locale is determined. It is then checked whether a mapping exists between font files in the preset font library and the locale. If a mapping exists, the corresponding font file is used to launch the application. Upon application launch, the corresponding font file is first located in the preset font library based on the application's locale, and then used to launch the application. Because of the mapping between the font file and the locale, the application can display all characters correctly after launch, avoiding text garbled characters and incomplete character display issues caused by inconsistent font files.
[0051] Based on the above embodiments:
[0052] As a preferred embodiment, before determining whether there is a mapping relationship between font files and locales in each font file of the preset font library, the method further includes:
[0053] Determine the file path of the preset font library;
[0054] Establish a symbolic link between the preset program and the file path, and proceed to the step of determining whether there is a mapping relationship between the font files and the locale in each font file of the preset font library.
[0055] To ensure the proper use of font files, this application considers that Wine is a program running on a Linux system. Wine also uses the Linux system's built-in font library after startup. To prevent the incorrect use of font files from the Linux system's built-in font library instead of the default font library when launching Windows programs from Wine, a link needs to be established between Wine and the default font library. Specifically, since symbolic links can cross file systems and link directories based on file paths, offering greater flexibility and wider applicability compared to hard links, the file path of the default font library in the Linux system can be identified first. Then, a symbolic link can be established between Wine and this file path, effectively establishing a connection between Wine and the default font library. During subsequent steps, the required font library can be determined based on the symbolic link, thus avoiding the incorrect use of the Linux system's built-in font library. Furthermore, to prevent other programs in the operating system from accessing font files normally, the default font library can be set in an isolated path within the Wine program, such as in the directory [ / .wine / drive_c / windows / fonts / ]. This isolates the default font library from other programs in the operating system, ensuring that other programs can only use the font library built into the operating system, thus enabling normal font access for other programs. Based on this, normal font file access can be guaranteed.
[0056] As a preferred embodiment, before determining the locale of the application, the following is also included:
[0057] When a font file to be stored is received, it is determined whether there is a font file in the preset font library that matches the font file to be stored.
[0058] If it does not exist, the font file to be stored will be stored in the preset font library;
[0059] If it exists, the font file to be stored will not be stored in the preset font library.
[0060] To save storage space, this application considers the increasing richness of text, including characters, languages, and symbols, used by users in daily communication. Therefore, font files need to be continuously updated to support users' diverse text needs. Thus, new font files can be added to the preset font library, or existing font files in the preset font library can be updated to increase the richness of the stored font files. Specifically, users can manually send font files to the preset font library, or the system can detect whether there are any newly added or updated font files in the online font library and download them to the preset font library. These font files sent or downloaded to the preset font library can be referred to as font files to be stored before they are actually stored in the preset font library. Before storing a font file, it's necessary to first determine if a matching font file already exists in the preset font library. If it does, considering that repeatedly storing the same font file is largely meaningless for actual use, the font file can be omitted from the preset font library. This might be because the system downloads a new font file from the online font library to the preset font library, and the user then manually sends the new font file to the preset font library. If the font file doesn't exist, it means the font file to be stored is either a newly added font file or an updated version of an existing font file. If the font file to be stored is an updated version of an existing font file, the previously stored older version of the font file can be deleted after storing the font file to be stored. This saves storage space in the preset font library.
[0061] As a preferred embodiment, determining the locale of the application includes:
[0062] Retrieve the language identifier from the application's configuration file;
[0063] The locale of an application is determined by its language identifier.
[0064] To easily determine the language environment of an application, this application utilizes a language identifier. Specifically, each application has a corresponding configuration file containing configuration parameters and default settings for normal operation, such as window size, font size, font style, and language environment. The configuration file typically sets a language identifier as a configuration parameter for the application's language environment. Since there is a one-to-one correspondence between the language identifier and the language environment, the application's language environment can be determined based on the language identifier. For example, the language identifier CN_S indicates a Simplified Chinese language environment, and the language identifier EN_US indicates an American English language environment. When the application's language identifier is CN_S, it can be determined that the application's language environment is Simplified Chinese. Therefore, the language environment of an application can be easily determined using the language identifier.
[0065] As a preferred embodiment, after determining whether there is a mapping relationship between font files and locales in each font file of the preset font library, the method further includes:
[0066] If there is no mapping relationship between the font file and the locale, a prompt signal containing the locale is generated and sent to the prompt module so that the prompt module can issue a prompt.
[0067] To promptly alert users, this application, after determining the application's language environment, if a font file for that language environment is not found in the preset font library, it indicates that the application may experience garbled characters or incomplete character display due to the lack of suitable font support. To promptly add the font file for that language environment to the preset font library, a prompt can be issued to the user after confirming the absence of such a font file. Specifically, when generating the prompt signal, information related to the application's language environment can be included. For example, assuming the application's language environment includes Simplified Chinese, American English, and French, if American English and French are not in the preset font library, their corresponding language identifiers can be added to the prompt signal. The prompt module can be a pop-up window within the Wine program. After generating the prompt signal, the user is notified via a pop-up window, which displays which language environments lack their corresponding font files, allowing the user to identify the missing font file based on the information displayed. This ensures timely user notification.
[0068] In a preferred embodiment, when there are N font files mapped to a locale, where N is an integer not less than 2, launching the application by calling the font files mapped to the locale includes:
[0069] Determine whether a pre-specified font file corresponding to a locale exists among N font files;
[0070] If it exists, the application will be launched by calling the pre-specified font file;
[0071] If it does not exist, the application will start by calling any font file.
[0072] To ensure proper character display in the application, this application considers that the preset font library may store multiple font files for a single language environment. If multiple font files are used to launch the application simultaneously, inconsistent text display styles may occur during normal operation. Therefore, when launching the application using a font file, only one font file needs to be selected. Specifically, when storing font files in the preset font library, for multiple font files within a single language environment, one font file can be designated as the default font file for that language environment. This default font file will be used every time an application for that language environment is launched. If no font file is specified for that language environment, a font file for that language environment can be randomly selected each time it is launched. For example, if the preset font library stores SimSun, KaiTi, and HeiTi font files for a Simplified Chinese environment, the SimSun font file can be used as the default font file. Therefore, when launching an application for a Simplified Chinese environment, the SimSun font file can be used to launch the application. Based on this, proper character display in the application can be guaranteed.
[0073] As a preferred embodiment, after launching the application by calling a font file that has a mapping relationship with the locale, the method further includes:
[0074] When a font selection instruction is received, the corresponding font file is determined from N font files according to the font selection instruction;
[0075] Modify the text font in the application according to the font file corresponding to the font selection instruction.
[0076] To change the font style of text, this application considers that different users have different font preferences and needs to be able to change the font style of the displayed text according to user requirements during normal application operation. Specifically, when the application is running normally, if a user needs to modify the font style of the currently displayed text, the user will select the desired font style in the font selection settings of the Wine program. When the user confirms that the font style needs to be modified, a font selection instruction corresponding to that font style is generated. At this time, the font file corresponding to the font selection instruction is found among the N font files corresponding to the locale, and the font style of the text displayed by the application is modified according to the font file. For example, if the application is in a Simplified Chinese environment and the currently displayed text font style is SimSun, but the user needs to change the font style to KaiTi, the KaiTi font file will be found among the N font files corresponding to the Simplified Chinese environment stored in the preset file library, and the KaiTi font file will be used to modify the font style of the text displayed by the application, so that the actual font style displayed by the application changes from SimSun to KaiTi. Based on this, the font style of text can be changed during normal application operation.
[0077] Please refer to Figure 2 , Figure 2 A schematic diagram of a multilingual support device for an application provided in this application includes:
[0078] Memory 21 is used to store computer programs;
[0079] Processor 22 is used to implement the steps of multilingual support methods for applications such as those described above when executing computer programs.
[0080] For a detailed description of the multilingual support device for an application provided in this application, please refer to the embodiments of the multilingual support method for the application described above; further details will not be repeated here.
[0081] Please refer to Figure 3 , Figure 3 A schematic diagram of the structure of a multilingual support system for an application provided in this application includes:
[0082] The language environment determination unit 31 is used to determine the language environment of the application when a startup command of the application in the preset program is detected;
[0083] The judgment unit 32 is used to determine whether there is a mapping relationship between the font files and the locale in each font file in the preset font library; if there is a mapping relationship between the font files and the locale, the calling unit is triggered.
[0084] Calling unit 33 is used to call a font file that has a mapping relationship with the locale to start the application.
[0085] Specifically, a systemd unit can be created as the language environment determination unit 31 and named language_distinguish.service. language_distinguish.service identifies the application's language environment. Another systemd unit can be created as a combination of the judgment unit 32 and the calling unit 33, named language_change.service. This unit is responsible for finding the corresponding font file based on the application's language environment and changing the application's language accordingly.
[0086] For a detailed description of the multilingual support system for an application provided in this application, please refer to the embodiments of the multilingual support method for the application described above; further details will not be repeated here.
[0087] Based on the above embodiments:
[0088] As a preferred embodiment, it also includes:
[0089] The path determination unit is used to determine the file path of the preset font library before determining whether there is a mapping relationship between the font files and the locale in each font file of the preset font library;
[0090] The symbolic link creation unit is used to create a symbolic link between a preset program and a file path and to trigger the judgment unit.
[0091] As a preferred embodiment, it also includes:
[0092] The consistency judgment unit is used to determine whether there is a font file in the preset font library that matches the font file to be stored when a font file to be stored is received, before determining the language environment of the application. If the font file does not match the font file to be stored, the storage unit is triggered; if the font file matches the font file to be stored, the rejection unit is triggered.
[0093] The storage unit is used to store the font file to be stored into the preset font library;
[0094] The rejection unit is used to prevent the font file to be stored from being stored in the preset font library.
[0095] In a preferred embodiment, the language environment determination unit 31 includes:
[0096] The identifier acquisition unit is used to acquire the language identifier from the application's configuration file;
[0097] The determination unit is used to determine the locale of the application based on the language identifier.
[0098] As a preferred embodiment, it also includes:
[0099] The prompt signal generation unit is used to determine whether there is a mapping relationship between font files and locale in each font file in the preset font library. If there is no mapping relationship between font files and locale, the unit generates a prompt signal containing locale and sends the prompt signal to the prompt module so that the prompt module can issue a prompt.
[0100] In a preferred embodiment, when there are N font files mapped to a locale, where N is an integer not less than 2, the calling unit 33 includes:
[0101] The specified file judgment unit determines whether a pre-specified font file corresponding to the locale exists among N font files; if it exists, the first calling unit is triggered; if it does not exist, the second calling unit is triggered.
[0102] The first calling unit is used to call a pre-specified font file to start the application;
[0103] The second calling unit is used to call any font file to start the application.
[0104] As a preferred embodiment, it also includes:
[0105] The multi-file determination unit is used to determine the corresponding font file from N font files after the application is started by calling a font file that has a mapping relationship with the locale.
[0106] The font modification unit is used to modify the text font in the application according to the font file corresponding to the font selection instruction.
[0107] This application also provides a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the steps of the multilingual support method of the application described above.
[0108] For a detailed description of the computer-readable storage medium provided in this application, please refer to the embodiments of the multilingual support method for the above-described application; further details will not be repeated here.
[0109] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0110] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for supporting multiple languages of an application program, characterized by, The application is a Windows program, and the default program is Wine, which runs on a Linux operating system. The method includes: A preset font library is established in the Linux operating system. The preset font library is independent of the font library that comes with the Linux operating system. The font files stored in the preset font library are all Windows font files, and the font files in the preset font library are independent of the font files in the font library that comes with the Linux operating system. When a font file to be stored is received, it is determined whether there is a font file in the preset font library that matches the font file to be stored; if not, the font file to be stored is stored in the preset font library; if it does, the font file to be stored is not stored in the preset font library. When a startup command for the Windows program is detected in the Wine program, the Windows program is not launched directly. Instead, the language environment of the Windows program is determined, which includes every language present in the Windows program. Determine the file path of the preset font library in the Linux operating system, and establish a symbolic link between the Wine program and the file path; For each language present in the Windows program, determine whether there is a font file in the preset font library that has a mapping relationship with that language; If a font file exists that maps to each language in the Windows program, then the Windows program is launched by calling all the determined font files through the symbolic link, so that the text in different languages in the Windows program is displayed according to the corresponding font file.
2. The method for supporting multiple languages of an application program according to Claim 1, wherein, Determining the locale of the Windows program includes: Obtain the language identifier from the configuration file of the Windows program; The language environment of the Windows program is determined based on the language identifier.
3. The method for supporting multiple languages of an application program according to Claim 1, wherein, After determining whether a font file with a mapping relationship to the language exists in the preset font library, the method further includes: If no font file exists that maps the font file to the locale, a prompt signal containing the locale is generated and sent to the prompt module so that the prompt module can issue a prompt.
4. The method for supporting multiple languages of an application program according to any one of claims 1 to 3, wherein, For any language present in the Windows program, when there are N font files that have a mapping relationship with the locale, where N is an integer not less than 2, the corresponding font file is determined for that language, including: Determine whether a pre-specified font file corresponding to the locale exists among the N font files; If it exists, the application is launched by calling the pre-specified font file; If it does not exist, then any of the font files will be used to launch the application.
5. The method for supporting multiple languages of an application program according to Claim 4, wherein, After launching the Windows program by calling all the identified font files through the symbolic link, the process also includes: When a font selection instruction is received, the corresponding font file is determined from the N font files according to the font selection instruction; Modify the text font in the Windows program according to the font file corresponding to the font selection instruction.
6. An apparatus for supporting multiple languages of an application program, characterized by comprising: include: Memory, used to store computer programs; A processor, configured to implement the steps of the multilingual support method for an application as described in any one of claims 1 to 5 when executing the computer program.
7. A multi-lingual support system for an application program, characterized by The application is a Windows program, and the default program is Wine, which runs on a Linux operating system. The system includes: A preset font library is built into the Linux operating system. The preset font library is independent of the font library that comes with the Linux operating system. The font files stored in the preset font library are all Windows font files, and the font files in the preset font library are independent of the font files in the font library that comes with the Linux operating system. The consistency judgment unit is used to determine whether there is a font file in the preset font library that is consistent with the font file to be stored when a font file to be stored is received; if it does not exist, the storage unit is triggered; if it exists, the rejection unit is triggered. The storage unit is used to store the font file to be stored into the preset font library; The rejection unit is used to prevent the font file to be stored from being stored in the preset font library; The language environment determination unit is configured to, when a startup instruction of the Windows program is detected in the Wine program, not to directly launch the Windows program, but to determine the language environment of the Windows program, wherein the language environment includes every language present in the Windows program; A path determination unit is used to determine the file path of the preset font library in the Linux operating system; A symbolic link establishment unit is used to establish a symbolic link between the Wine program and the file path, and to trigger the font file judgment unit; The font file determination unit is used to determine whether there is a font file in the preset font library that has a mapping relationship with each language in the Windows program, and to trigger the calling unit when there is a font file that has a mapping relationship with each language in the Windows program. The calling unit is used to call all the determined font files through the soft link to start the Windows program at the same time, so that the text of different languages in the Windows program can be displayed according to the corresponding font files.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the multilingual support method for the application as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Method for changing system font and user terminal
CN106528144A
