A method, device and storage medium for switching languages in an application
By creating language resource files that match the application and switching languages according to user instructions, the problem of cumbersome language switching in apps is solved, and a convenient and efficient language switching experience is achieved.
Patent Information
- Application Number
- CN202211419991.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-14
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2042-11-14
AI Technical Summary
The language switching operation in existing apps is cumbersome and time-consuming, which reduces the user experience.
A language resource file matching the application is pre-created, containing general character records and specific character records. The program receives the user's language switching command, selects the target character record from the language resource file according to the command, and replaces the original characters on the application interface with the target language character.
It enables convenient and efficient language switching, avoids frequent searches in multiple language files, and improves language switching speed and user experience.
Smart Images

Figure CN115904584B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence services, and in particular to a multi-language switching method and device for an application, an application device and a storage medium. BACKGROUND
[0002] With the promotion of overseas mobile banking, more and more languages need to be supported. Currently, the configuration of international multi-language processing is mainly based on the string file configuration mode provided by the system to realize multi-language of software. For the languages supported by the system, various language string files need to be generated, and the corresponding content is configured in the files in the format key = value. The same key in different string files corresponds to different values.
[0003] Since the string file is for the system, if language switching is required for the App application running on the system, the App application needs to be exited first, switched to the system setting interface, and then the target string file is determined from the plurality of string files. The system language is switched by using the string file. Since it takes a certain amount of time to determine the target string file from the plurality of string files corresponding to different languages, and it also takes a certain amount of time to restart the application, the existing language switching operation of the application is cumbersome, thereby reducing the user's operation experience. SUMMARY
[0004] The present application provides a multi-language switching method, device, equipment and storage medium for an application, which can realize convenient and efficient language switching for the application.
[0005] In a first aspect, the present application embodiment provides a multi-language switching method for an application, comprising: creating a language resource file matched with the application in advance, the language resource file containing general character records and specific character records, wherein the specific character records contain a region tag;
[0006] Receiving a language switching instruction of the user for the application, wherein the language switching instruction contains a target language type and a specified region;
[0007] According to the specified region, the target character record is obtained by screening from the language resource file, and the target language character is extracted from the target character record according to the target language type;
[0008] The target language character is used to switch the original character on the application interface.
[0009] In a second aspect, the present application embodiment provides a multi-language switching device for an application, comprising:
[0010] The language resource file creation module is used to pre-create a language resource file that matches the application. The language resource file contains general character records and specific character records, wherein the specific character records contain region tags.
[0011] A language switching instruction receiving module is used to receive a user's language switching instruction for the application, wherein the language switching instruction includes the target language type and a specified region;
[0012] The target language character acquisition module is used to filter and acquire target character records from the language resource file according to the specified region, and extract target language characters from the target character records according to the target language type;
[0013] The language switching module is used to switch the target language characters to the original characters on the application interface.
[0014] Thirdly, embodiments of the present invention provide an electronic device, the electronic device comprising:
[0015] At least one processor; and
[0016] A memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform a multilingual switching method for an application according to any embodiment of the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement a multilingual switching method for an application according to any embodiment of the present invention.
[0019] Fourthly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a multilingual switching method for an application as described in any of the embodiments of the present invention.
[0020] Fifthly, embodiments of the present invention also provide a computer program product, including a computer program that, when executed by a processor, implements a multilingual switching method for an application as provided in any embodiment of the present application.
[0021] The technical scheme of the embodiment of the application, when switching the language of the application, only needs to acquire target language characters from a language resource file containing general character records and specific character records according to a language switching instruction, and switches original characters on the application interface by using the acquired target language characters. Since the language resource file is matched with the application, the application remains running without exiting when the language is switched, and only needs to be queried in one language resource file, thereby avoiding occupying too much time for frequent switching and querying in numerous language files, simplifying the switching operation, and thereby improving the language switching speed and the operation experience of the user.
[0022] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the application, nor is it used to limit the scope of the application. Other features of the application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0023] In order to more clearly illustrate the technical scheme of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some of the embodiments of the application, and therefore should not be regarded as limiting the scope. For those skilled in the art, other related drawings can also be obtained without creative labor.
[0024] Figure 1 is a flow chart of a multi-language switching method of an application according to the first embodiment of the application;
[0025] Figure 2 is a flow chart of a multi-language switching method of an application according to the second embodiment of the application;
[0026] Figure 3 is a flow chart of a multi-language switching method of an application according to the third embodiment of the application;
[0027] Figure 4 is a structural schematic diagram of a multi-language switching device of an application according to the fourth embodiment of the application;
[0028] Figure 5 is a structural schematic diagram of an electronic device for implementing the method of the application according to the fifth embodiment of the application. DETAILED DESCRIPTION
[0029] The application will be further described in detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the application, and not to limit the application.
[0030] It should also be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, rather than all the parts. Before discussing the example embodiments in more detail, it should be mentioned that some example embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The processes can be terminated when the operations are completed, but can also have additional steps not included in the drawings. The processes can correspond to methods, software implementations, hardware implementations, etc. The acquisition, storage, use, processing, etc. of data in the technical solutions of the present application comply with the relevant provisions of national laws and regulations.
[0031] Embodiment one
[0032] Figure 1 A flowchart of an application multilingual switching method is provided for the first embodiment of the present application. The present embodiment can be applied to the case of switching the language of an application. The method can be performed by an application multilingual switching device. The device can be implemented in the form of hardware and / or software. The device can be configured in a terminal or electronic device with multilingual switching function. As shown in the figure, the method comprises the following steps. Figure 1
[0033] Step S101, creating a language resource file matched with the application in advance. The language resource file contains general character records and specific character records.
[0034] Optionally, the language resource file matched with the application is created in advance, comprising: creating a language database table, wherein the data table contains an ID field for identifying original characters, at least two language type fields and a region field; obtaining language type resources corresponding to each original character, wherein the number of language type resources is the same as the number of language type fields; creating a language resource file according to the language database table and the language type resources.
[0035] Optionally, the language resource file is created according to the language database table and the language type resources, comprising: importing the language type resources into the language database table to obtain general character records; receiving a region tag input by a user for a specified general character record, splicing the specified general record with the region tag to generate a specific character record corresponding to the specified general character record; generating a language resource file according to the general character records and the specific character records.
[0036] Specifically, the language database table is created according to the needs of the developer in the embodiment, and the database table includes an ID field for identifying original characters, at least two language type fields and a region field. The language type field can include English-ENG, Simplified Chinese-CHS, Traditional Chinese-CHT, and the embodiment is only an example and does not specifically limit the language type field. As shown in Table 1 below, the language database table created is as follows:
[0037] Table 1
[0038] ID ENG CHS CHT AREA
[0039] The language data table shown in Table 1 only has a table header field and does not actually have imported data, so the language type resources corresponding to each original field are obtained. The number of language type resources is the same as the number of language type fields. At this time, the pre-configured resource import execution script, such as a Python script, is obtained, and the language type resources are imported into Table 1 through the Python script to obtain general character records. As shown in Table 2 below, the language resource file containing the general character records is as follows:
[0040] Table 2
[0041]
[0042]
[0043] It should be noted that the ID field in the embodiment is mainly composed of function module identification, sub-function number, page number and string serial number, so the position on the function page can be quickly located according to the ID.
[0044] In the embodiment, the region tag input by the user for the specified general character record can also be received, and the specified general record and the region tag are spliced to generate a specific character record corresponding to the specified general character record. For example, for the specified general record corresponding to ID=000010115, the region tag-Hong Kong HK input by the user is received, and the language type resource corresponding to the KH region-All data has been loaded, that is, the user has made special settings for the specified general character under ID=000010115, so the region tag is included in the specific character record. As shown in Table 3 below, the language resource file containing the general character record and the specific character record is as follows:
[0045] Table 3
[0046]
[0047]
[0048] As can be seen from Table 3, each character in the general character record or the specific character record is distinguished by a joint primary key composed of the ID field and the area field, i.e., the joint primary key can uniquely determine a character record in Table 3.
[0049] It should be noted that in the embodiment, different types of language resources are saved as different fields in the same language resource file, which not only facilitates user query, but also when a new language type needs to be added, only a new field needs to be added in the language resource file to update the language resource file, without the need for the user to additionally add a new language type document, thereby improving the update efficiency of the language resource file, saving database memory, and facilitating the operation of developers.
[0050] In step S102, a language switching instruction of the user for the application is received.
[0051] Optionally, the language switching instruction of the user for the application is received, including: starting a language menu interface, wherein the language menu interface contains a language type option and an area option; and receiving a language switching instruction input by the user through triggering the language menu interface.
[0052] Specifically, the terminal of the embodiment contains a human-computer interaction port, when it is determined that the application is run for the first time or a triggering operation of the user on the menu interface of the human-computer interaction port is received, the language menu interface is displayed on the human-computer interaction interface, and the language menu interface contains the language type option and the area option, for example, when the user selects the traditional Chinese and HK, the terminal will input the language switching instruction containing the target language type-CHT and the specified area-HK according to the triggering of the user.
[0053] In step S103, the target character record is obtained by filtering from the language resource file according to the specified area, and the target language character is extracted from the target character record according to the target language type.
[0054] Optionally, the target character record is obtained by filtering from the language resource file according to the specified area, including: filtering the specific character record with the same area tag as the specified area from the language resource file, and taking the filtered specific character record as a first character record; deleting the general character record corresponding to the first character record in the language resource file, and taking the remaining general character record as a second character record, wherein the ID field of the first character record is the same as that of the deleted general character record; and taking the first character record and the second character record as the target character record.
[0055] Optionally, extracting target language characters from the target character record based on the target language type includes: determining the language type field in each target character record that matches the target language type; extracting the language type resources under the matching language type field; and using the extracted language type resources as the target language characters.
[0056] Since the user's language switching command includes the target language type and specified region, the first character record matching the specified region can be selected based on the language switching command. Then, from the remaining general character records, the result obtained after deleting the general character record corresponding to the first character record is used as the second character record. Taking Table 3 as an example, the target character record composed of the first and second character records includes the first to fourth character records in Table 3, as well as the sixth character record.
[0057] In this embodiment, since each character record contains multiple language resources, it is necessary to determine the language type field (CHT field) that matches the target language type -CHT from each target character record, and extract the language type resources under the CHT field. The extracted language type resources are then used as the target language characters. For example, ID = 000010111, the extracted language resource is "setting", ID = 000010112, the extracted language resource is "complete", etc., and each extracted language type resource is used as the target language character.
[0058] Step S104: Switch the target language characters to the original characters on the application interface.
[0059] Optionally, the target language characters are used to switch the original characters on the application interface, including: determining the position of the ID corresponding to the target language character on the application interface; determining the original character at the position, and replacing the original character with the target language character to achieve language switching of the original character.
[0060] In one specific implementation, when the target language character is obtained, for example, when the target language character is "setting", the target location on the application interface is determined according to the ID = 000010111 corresponding to the target language character "setting", and the original character at the target location is replaced with "setting". In this embodiment, the original character can be Simplified Chinese, French, or a code symbol; the specific form of the original character is not limited. Of course, this embodiment only illustrates one method of replacing an original character; other methods of replacing original characters are largely the same and will not be elaborated upon in this embodiment.
[0061] The technical scheme of the embodiment of the present application switches the original character on the application interface after obtaining the target language character from one language resource file according to the language switching instruction. Since the language resource file is matched with the application, the application remains running without exiting during language switching. Only one language resource file is queried, the excessive time consumed by frequent switching and querying in numerous language files is avoided, the switching operation is simplified, and thus the language switching speed and the user's operation experience are improved.
[0062] Embodiment Two
[0063] Figure 2 A flowchart of an application multi-language switching method provided by the second embodiment of the present application is based on the above-described embodiment and specifically describes the obtaining of the target character record from the language resource file according to the specified area in the above-described embodiment. As shown in Figure 2 The method comprises the following steps.
[0064] In step S201, a specific character record with the same area tag as the specified area is filtered out from the language resource file, and the filtered specific character record is taken as a first character record.
[0065] Specifically, after obtaining the language resource file shown in Table 3, the specific character record with the area tag and the general character record without the area tag are contained in the language resource file as shown in Table 3. Since the language switching instruction sent by the user contains the target language type and the specified area, for example, the target language type is CHT and the specified area is HK. Of course, the present embodiment is only an example and does not limit the specific content contained in the language switching instruction.
[0066] Among them, the specific character record same as HK is filtered out from the language resource file shown in Table 3 according to the language switching instruction, that is, the sixth character record corresponding to ID = 000010115 & AREA = HK is taken as the first character record. Of course, the present embodiment is only an example and does not limit the specific content of the first character record.
[0067] In step S202, the general character record corresponding to the first character record in the language resource file is deleted, and the remaining general character record is taken as a second character record.
[0068] Among them, after the first character record is filtered out, the general character record without carrying the area tag is filtered out from the remaining character records, that is, the general character records corresponding to the first to fifth character records are obtained.
[0069] It should be noted that in the embodiment, the first to fifth character records corresponding to the general character records are determined, and the sixth character record corresponding to the first character record is determined, for example, the sixth character record corresponding to the first character record in the embodiment is the fifth character record without carrying a region label, and the fifth character record with the same ID field as the first character record is deleted, so that the ID field of the first character record in the embodiment is the same as that of the deleted general character record. The first to fourth character records remaining after deletion are taken as the second character record. Of course, the embodiment is only an example, and the specific content of the second character record is not limited.
[0070] Step S203, taking the first character record and the second character record as the target character record.
[0071] In the embodiment, the first character record, for example, the sixth character record carrying a region label shown in Table 3, and the first to fourth character records without carrying a region label are taken as the target character record. The specific number of the target character record is not limited in the embodiment.
[0072] The technical scheme of the embodiment of the application switches the original character on the application interface according to the language switching instruction and obtains the target language character from one language resource file. Since the language resource file is matched with the application, the application remains running without exiting during language switching. Only one language resource file is queried, the time-consuming of frequent switching and querying in numerous language files is avoided, the switching operation is simplified, and the language switching speed and the user's operation experience are improved. In addition, the first character record with the same region label as the specified region is screened from the language resource file, and the second character record is screened from the language resource file according to the first character record to form the target character record, so that the obtained target character record is more accurate.
[0073] Embodiment Three
[0074] Figure 3 A flowchart of an application multilingual switching method provided for the third embodiment of the application, which is a supplement to the above-mentioned embodiments. Specifically, after the original character record is switched, the language switching result is detected. As shown in the embodiment, the method comprises the steps of: Figure 3
[0075] Step S301, a language resource file matched with the application is created in advance, and the language resource file contains general character records and specific character records.
[0076] Optionally, the language resource file matched with the application is created in advance, including: creating a language database table, wherein the data table contains an ID field for identifying original characters, at least two language type fields and a region field; obtaining language type resources corresponding to each original character, wherein the number of language type resources is the same as the number of language type fields; and creating a language resource file according to the language database table and the language type resources.
[0077] Step S302, receiving a language switching instruction of the user for the application.
[0078] Optionally, the language switching instruction of the user for the application is received, including: starting a language menu interface, wherein the language menu interface contains language type options and region options; and receiving the language switching instruction input by the user through triggering the language menu interface.
[0079] Step S303, filtering and obtaining target character records from the language resource file according to the specified region, and extracting target language characters from the target character records according to the target language type.
[0080] Optionally, the target character records are filtered and obtained from the language resource file according to the specified region, including: filtering specific character records with the same region label as the specified region from the language resource file, and taking the filtered specific character records as first character records; deleting general character records corresponding to the first character records in the language resource file, and taking the remaining general character records as second character records, wherein the first character records have the same ID field as the deleted general character records; and taking the first character records and the second character records as the target character records.
[0081] Step S304, switching the target language characters to the original characters on the application interface respectively.
[0082] Optionally, the target language characters are switched to the original characters on the application interface respectively, including: determining the position of the ID corresponding to the target language characters on the application interface; determining the original characters at the position, and replacing the original characters with the target language characters to realize the language switching of the original characters.
[0083] Step S305, judging whether the language switching result matches the target language type, if yes, executing step S306, otherwise, executing step S307.
[0084] Specifically, after the terminal completes the language switching, the language displayed on the application interface is compared with the target language triggered by the user on the language menu interface, if the language displayed on the application interface is English and the user selects traditional Chinese on the language menu interface, it is indicated that the switching result does not match the target language type.
[0085] Step S306, determining the application language switching success.
[0086] Step S307, determining the application language switching failure and issuing an alarm prompt.
[0087] Wherein, when the switching result is determined to be not matched with the target language type, it is determined that the language switching fails, and the cause of the failure can be a hardware device failure or a software system failure, at this time, an alarm prompt is issued to prompt the user to timely repair, so as to further improve the efficiency and accuracy of language switching. And the alarm prompt in the embodiment can be in the form of voice or image, the specific form of the alarm in the embodiment is not limited, as long as it can play a prompt role to the user, it is within the protection scope of the application, and the embodiment does not limit it.
[0088] The technical scheme of the embodiment of the application, according to the language switching instruction, the target language character is obtained from one language resource file, and the original character on the application interface is switched. Since the language resource file is matched with the application, the application remains running without exiting during language switching, and only one language resource file is queried, avoiding the occupation of too much time by frequent switching and querying in numerous language files, simplifying the switching operation, thereby improving the language switching speed and user operation experience. When the switching fails, an alarm prompt is issued to prompt the user to repair in time, so as to further improve the efficiency and accuracy of language switching.
[0089] Embodiment four
[0090] Figure 4 A structure schematic view of a multi-language switching device for application provided by the fourth embodiment of the application. As shown in the figure, the device comprises a language resource file creation module 410, a language switching instruction receiving module 420, a target language character obtaining module 430 and a language switching module 440. Figure 4
[0091] The language resource file creation module 410 is used for creating a language resource file matched with the application in advance, and the language resource file contains general character records and specific character records, wherein the specific character records contain region tags.
[0092] The language switching instruction receiving module 420 is used for receiving a language switching instruction of the application by the user, wherein the language switching instruction contains a target language type and a specified region.
[0093] The target language character obtaining module 430 is used for screening and obtaining target character records from the language resource file according to the specified region, and extracting target language characters from the target character records according to the target language type.
[0094] The language switching module 440 is configured to apply the target language character to the original character on the application interface for language switching.
[0095] Optionally, the language resource file creation module comprises:
[0096] The database table creation submodule is configured to create a language database table, wherein the data table comprises an ID field for identifying an original character, at least two language type fields and a region field;
[0097] The language type resource acquisition submodule is configured to acquire language type resources corresponding to each original character, wherein the number of language type resources is the same as that of the language type fields;
[0098] The language resource file creation submodule is configured to create a language resource file according to the language database table and the language type resources.
[0099] Optionally, the language resource file creation submodule is configured to import the language type resources into the language database table to acquire a general character record;
[0100] The application receives a region tag input by a user for a specified general character record, and splices the specified general record and the region tag to generate a specific character record corresponding to the specified general character record;
[0101] The language resource file is generated according to the general character record and the specific character record.
[0102] Optionally, the language resource file creation submodule is further configured to acquire a pre-configured resource import execution script;
[0103] The language type resources are imported into the language database table by the resource import execution script to acquire a general character record.
[0104] Optionally, each character in the general character record or the specific character record is distinguished by a joint primary key, wherein the joint primary key comprises an ID field and a region field.
[0105] Optionally, the target language character acquisition module comprises a target character record acquisition submodule configured to filter out a specific character record with a region tag identical to a specified region from the language resource file, and take the filtered specific character record as a first character record;
[0106] The general character record corresponding to the first character record in the language resource file is deleted, and the remaining general character record is taken as a second character record, wherein the first character record is identical to the ID field of the deleted general character record;
[0107] The first character record and the second character record are target character records.
[0108] Optionally, the target language character acquisition module comprises a target language character submodule configured to determine a language type field in each target character record that matches the target language type.
[0109] The language type resource under the matched language type field is extracted, and the extracted language type resource is taken as the target language character.
[0110] Optionally, the language switching module is configured to determine the position of the ID corresponding to the target language character on the application interface.
[0111] The original character at the position is determined, and the target language character is used to replace the original character, so as to realize language switching of the original character.
[0112] Optionally, the language switching instruction receiving module is configured to start a language menu interface, wherein the language menu interface comprises a language type option and a region option.
[0113] The language switching instruction input by the user through triggering the language menu interface is received.
[0114] Optionally, the device further comprises a language switching result checking module configured to determine whether the language switching result matches the target language type, and if yes, it is determined that the application language switching is successful.
[0115] Otherwise, it is determined that the application language switching fails, and an alarm prompt is issued.
[0116] Optionally, the ID field is composed of a function module identifier, a sub-function number, a page number and a character string serial number.
[0117] According to the technical scheme of the embodiment of the application, after the target language character is obtained from the language resource file according to the language switching instruction, the original character on the application interface is switched, since the language resource file is matched with the application, the application remains running without exiting during language switching, only one language resource file is queried, the time consumed by frequent switching and querying in numerous language files is avoided, the switching operation is simplified, and thus the language switching speed and the user operation experience are improved.
[0118] The application language switching device provided by the embodiment of the application can execute the server cluster-based session maintaining method provided by any embodiment of the application, and has the corresponding function modules and beneficial effects.
[0119] Embodiment five
[0120] Figure 5A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0121] like Figure 5 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0122] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0123] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the multilingual switching methods of an application.
[0124] This includes:
[0125] The language resource file matched with the application is created in advance, and the language resource file includes general character records and specific character records, wherein the specific character records include a region label;
[0126] The language switching instruction of the user for the application is received, and the language switching instruction includes a target language type and a specified region;
[0127] The target character records are obtained from the language resource file according to the specified region, and the target language characters are extracted from the target character records according to the target language type;
[0128] The target language characters are used for language switching of the original characters on the application interface.
[0129] In some embodiments, the multilingual switching method of the application can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the multilingual switching method of the application described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the multilingual switching method of the application by any other appropriate means (for example, by means of firmware).
[0130] The various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0131] Computer programs for implementing the methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer program, when executed, can cause instructions defined in the flow charts and / or block diagrams to be implemented. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package and partially on a remote machine or entirely on a remote machine or server.
[0132] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0133] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0134] The systems and techniques described here can be implemented in a computing system that includes a back end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front end component, e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here, or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0135] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.
[0136] Embodiment six
[0137] The embodiment six of the present application further provides a computer program product comprising a computer program which, when executed by a processor, implements the multilingual switching method of the application as provided in any embodiment of the present application.
[0138] The computer program code implementing the application can be written in one or more programming languages or combinations of languages including object oriented languages such as Java, Smalltalk, C++ or conventional procedural programming languages, e.g., the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). The application is not limited to a specific programming language or computer system.
[0139] It should be understood that the various forms of flow shown above can be used to reorder, add, or remove steps. For example, the steps recited in the present application can be performed in parallel, in series, or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, which are not limited herein.
[0140] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for switching a language of an application, the method comprising: The application comprises the following steps: creating a language database table, wherein the database table contains an ID field for identifying original characters, at least two language type fields and a region field; the ID field is composed of a function module identifier, a sub-function number, a page number and a string serial number; obtaining language type resources corresponding to each original character, wherein the number of language type resources is the same as the number of language type fields; creating a language resource file according to the language database table and the language type resources, wherein the language resource file contains general character records and specific character records, and the specific character records contain region tags; receiving a language switching instruction of a user for the application, wherein the language switching instruction contains a target language type and a specified region; selecting specific character records with the same region tag as the specified region from the language resource file, and taking the selected specific character records as first character records; deleting general character records corresponding to the first character records in the language resource file, and taking the remaining general character records as second character records, wherein the ID fields of the first character records and the deleted general character records are the same; taking the first character records and the second character records as target character records, and extracting target language characters from the target character records according to the target language type; performing language switching on original characters on the application interface by the target language characters.
2. The method of claim 1, wherein, The creation of the language resource file according to the language database table and the language type resources comprises the following steps: importing the language type resources into the language database table to obtain the general character records; receiving a region tag input by a user for a specified general character record, and splicing the specified general record with the region tag to generate a specific character record corresponding to the specified general character record; generating the language resource file according to the general character records and the specific character records.
3. The method of claim 2, wherein, The importing of the language type resources into the language database table to obtain the general character records comprises the following steps: obtaining a pre-configured resource import execution script; importing the language type resources into the language database table by the resource import execution script to obtain the general character records.
4. The method of claim 2, wherein, Each character in the general character records or the specific character records is distinguished by a joint primary key, wherein the joint primary key comprises an ID field and a region field.
5. The method of claim 1, wherein, The extraction of target language characters from the target character records according to the target language type comprises the following steps: determining language type fields in each target character record that match the target language type; extracting language type resources under the matched language type fields, and taking the extracted language type resources as the target language characters.
6. The method of claim 1, wherein, The language switching of the target language characters on original characters on the application interface comprises the following steps: determining the positions of IDs corresponding to the target language characters on the application interface; Determine the original character at the position, and replace the original character with the target language character to realize language switching of the original character.
7. The method of claim 1, wherein, The language switching instruction receiving module is configured to receive a language switching instruction of the application by a user, wherein the language switching instruction comprises a target language type and a specified region. Start a language menu interface, wherein the language menu interface comprises a language type option and a region option; The language switching instruction receiving module is configured to receive a language switching instruction of the application by a user, wherein the language switching instruction comprises a target language type and a specified region.
8. The method of claim 1, wherein, The language switching module is configured to perform language switching on the original characters on the application interface with the target language characters respectively. Determine whether the language switching result matches the target language type, if yes, determine that the application language switching is successful, otherwise, determine that the application language switching fails, and issue an alarm prompt.
9. The method of claim 1, wherein, The ID field is composed of a function module identifier, a sub-function number, a page number and a string sequence number.
10. A multi-language switching device for applications, characterized by, The language resource file creation module is configured to create a language database table, wherein the database table comprises an ID field for identifying an original character, at least two language type fields and a region field; the ID field is composed of a function module identifier, a sub-function number, a page number and a string sequence number; language type resources corresponding to each original character are obtained, wherein the number of the language type resources is the same as that of the language type fields; the language resource file is created according to the language database table and the language type resources, and the language resource file comprises general character records and specific character records, wherein the specific character records comprise a region tag; The language switching instruction receiving module is configured to receive a language switching instruction of the application by a user, wherein the language switching instruction comprises a target language type and a specified region; The target language character obtaining module is configured to filter specific character records with the same region tag as the specified region from the language resource file, and take the filtered specific character records as first character records; delete general character records corresponding to the first character records from the language resource file, and take the remaining general character records as second character records, wherein the ID fields of the first character records and the deleted general character records are the same; take the first character records and the second character records as target character records, and extract target language characters from the target character records according to the target language type; The language switching module is configured to perform language switching on the original characters on the application interface with the target language characters respectively. The language resource file creation submodule is configured to import the language type resources into the language database table to obtain the general character records; 11. The apparatus of claim 10, wherein, The region tag receiving module is configured to receive a region tag input by a user for a specified general character record, splice the specified general record with the region tag to generate a specific character record corresponding to the specified general character record; The language resource file generation module is configured to generate the language resource file according to the general character records and the specific character records. 12. The apparatus of claim 10, wherein, The target language character obtaining module comprises a target language character submodule, configured to determine a language type field in each of the target character records that matches the target language type; extract a language type resource under the matched language type field, and use the extracted language type resource as the target language character.
13. The apparatus of claim 10, wherein, The language switching module is configured to determine a position of an ID corresponding to the target language character on the application interface; determine an original character at the position, and replace the original character with the target language character to achieve language switching of the original character.
14. The apparatus of claim 10, wherein, The device further comprises a language switching result identifying module, configured to determine whether a language switching result matches the target language type, and if yes, determine that the language switching is successful, otherwise, determine that the language switching fails, and issue an alarm prompt.
15. An electronic device, comprising: Comprise: a processor, and a memory connected with the processor in communication; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement the method in any one of claims 1-9.
16. A computer readable storage medium characterized by: The computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by the processor to implement the method in any one of claims 1-9.
17. A computer program product, characterised in that, comprise a computer program, which is executed by the processor to implement the method in any one of claims 1-9.
Citation Information
Patent Citations
APP multi-language switching method and system
CN105867920A