CN115904584A - Multi-language switching method, device, equipment and storage medium for application - Google Patents

Multi-language switching method, device, equipment and storage medium for application Download PDF

Info

Publication number
CN115904584A
CN115904584A CN202211419991.8A CN202211419991A CN115904584A CN 115904584 A CN115904584 A CN 115904584A CN 202211419991 A CN202211419991 A CN 202211419991A CN 115904584 A CN115904584 A CN 115904584A
Authority
CN
China
Prior art keywords
language
character
target
record
switching
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211419991.8A
Other languages
Chinese (zh)
Inventor
李志立
陈银
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202211419991.8A priority Critical patent/CN115904584A/en
Publication of CN115904584A publication Critical patent/CN115904584A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a multi-language switching method, a device, equipment and a storage medium for application Relates to the technical field of artificial intelligence service. The method comprises the following steps: pre-creating a language resource file matched with the application; receiving a language switching instruction of a user for an application; screening from the language resource file according to the designated area to obtain a target character record, and extracting a target language character from the target character record according to the target language type; and respectively carrying out language switching on the original characters on the application interface by the target language characters. The method has the advantages that the original characters are switched after the target language characters are acquired by inquiring from one language resource file according to the language switching instruction, the application keeps running without exiting during language switching, only one language resource file is required to be inquired, excessive time occupied by frequent switching inquiry in numerous language files is avoided, switching operation is simplified, and accordingly language switching speed and operation experience of users are improved.

Description

Multi-language switching method, device, equipment and storage medium for application
Technical Field
The invention relates to the technical field of artificial intelligence services, in particular to a multi-language switching method, device, equipment and storage medium for application.
Background
With the popularization of overseas mobile phone banks, more and more languages need to be supported, and the international multi-language processing is mainly configured based on a string file configuration mode of the system at present so as to realize multi-language of software. And for the languages supported by the system, string files of various languages need to be generated, corresponding contents are configured in the files, the format key = value, and the same key in different string files corresponds to different values respectively.
Because string files are specific to the system, if the language switching of the App application running on the system is needed, the App application needs to be quitted first, the system setting interface is switched to, a target string file is determined from a plurality of string files, then the system language switching is completed by using the string files, and because a certain time needs to be consumed for determining the target string file from the string files corresponding to a plurality of different languages, and a certain time needs to be consumed for restarting the application, the language switching operation of the existing App application is complicated, so that the operation experience of a user is reduced.
Disclosure of Invention
The invention provides a multi-language switching method, a multi-language switching device, multi-language switching equipment and a storage medium of an application, which can realize convenient and efficient language switching of the application.
In a first aspect, an embodiment of the present invention provides an application multi-language switching method, including: the method comprises the steps that a language resource file matched with an application is created in advance, wherein the language resource file comprises a general character record and a specific character record, and the specific character record comprises an area label;
receiving a language switching instruction of a user for the application, wherein the language switching instruction comprises a target language type and a specified area;
screening from the language resource file according to the designated area to obtain a target character record, and extracting a target language character from the target character record according to the target language type;
and respectively carrying out language switching on the original characters on the application interface by the target language characters.
In a second aspect, an embodiment of the present invention provides an applied multi-language switching device, including:
the language resource file creating module is used for creating a language resource file matched with the application in advance, wherein the language resource file comprises a general character record and a specific character record, and the specific character record comprises an area label;
the language switching instruction receiving module is used for receiving a language switching instruction of a user aiming at the application, wherein the language switching instruction comprises a target language type and a specified area;
the target language character acquisition module is used for screening from the language resource file according to the specified area to acquire a target character record and extracting a target language character from the target character record according to the target language type;
and the language switching module is used for respectively switching the languages of the original characters on the application interface by the target language characters.
In a third aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform a method for multiple language switching of an application according to any embodiment of the present invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement a multi-language switching method for an application according to any one of the embodiments of the present invention when the computer instructions are executed.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a multi-language switching method for an application according to any one of the embodiments of the present invention.
In a fifth aspect, an embodiment of the present invention further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program implements the multiple language switching method for an application as provided in any embodiment of the present application.
According to the technical scheme of the embodiment of the invention, when the language of the application is switched, only one language resource file containing the general character records and the specific character records needs to be inquired according to the language switching instruction to obtain the target language character, and the obtained target language character is adopted to switch the original character on the application interface.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a flowchart of a multilingual handover method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a multilingual handover method according to a second embodiment of the present invention;
FIG. 3 is a flowchart of a multilingual handover method according to a third embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a multilingual switching apparatus according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device implementing the method of the present invention in the fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention.
It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, software implementations, hardware implementations, and so on. According to the technical scheme, the data acquisition, storage, use, processing and the like meet the relevant regulations of national laws and regulations.
Example one
Fig. 1 is a flowchart of a multi-language switching method for an application according to an embodiment of the present invention, where the embodiment is applicable to a case of performing language switching on an application, and the method can be executed by a multi-language switching apparatus for an application, where the apparatus can be implemented in a hardware and/or software form, and the apparatus can be configured in a terminal or an electronic device having a multi-language switching function. As shown in fig. 1, the method includes:
step S101, a language resource file matched with the application is created in advance, and the language resource file comprises a general character record and a specific character record.
Optionally, the pre-creating a language resource file matched with the application includes: creating a language database table, wherein the database table comprises an ID field for identifying an original character, at least two language type fields and an area field; acquiring language type resources corresponding to each original character, wherein the number of the language type resources is the same as that of a language type field; and creating a language resource file according to the language database table and the language type resource.
Optionally, creating a language resource file according to the language database table and the language type resource includes: importing the language type resource into a language database table to obtain a universal character record; receiving an area label input by a user aiming at the appointed general character record, and splicing the appointed general record and the area label to generate a specific character record corresponding to the appointed general character record; and generating a language resource file according to the general character records and the specific character records.
Specifically, in this embodiment, a language database table is created according to the requirement of a developer, and the database table includes an ID field for identifying an original character, at least two language type fields and a region field, where the language type fields may include english-ENG, simplified chinese-CHS, and traditional-CHT, and this embodiment is merely an example and is not specifically limited to the language type fields, and the following table 1 shows an example of the created language database table:
TABLE 1
ID ENG CHS CHT AREA
The language data table shown in table 1 only has header fields, and data is not actually transmitted yet, so that language type resources corresponding to each original field can be obtained, and the number of the language type resources is the same as that of the language type fields. At this time, a pre-configured resource import execution script, such as a Python script, is obtained, and the language type resource is imported into table 1 by the Python script to obtain a universal character record, as shown in table 2 below, the language resource file includes the universal character record:
TABLE 2
Figure BDA0003942692550000061
Figure BDA0003942692550000071
It should be noted that the ID field in this embodiment is mainly formed by splicing the function module identifier, the sub-function number, the page number, and the character string number, and therefore, the position on the function page can be quickly located according to the ID.
In this embodiment, it is also possible to receive an area tag input by the user for the specified universal character record, and splice the specified universal record and the area tag to generate a specific character record corresponding to the specified universal character record, for example, for the specified universal record corresponding to ID =000010115, the area tag input by the user, hong kong HK, and the language type resource corresponding to the KH area, all the resources are loaded, that is, the user performs special setting for the specified universal character under ID =000010115, and therefore the specific character record includes the area tag. The language resource file containing the general character records and the specific character records is shown in table 3 below:
TABLE 3
Figure BDA0003942692550000072
Figure BDA0003942692550000081
It can be seen from table 3 that each character in the general character record or the specific character record is distinguished by using the associated primary key formed by the ID field and the area field, that is, one character record in table 3 can be uniquely determined by using the associated primary key.
It should be noted that, in the embodiment, different types of language resources are stored in the same language resource file as different fields, which is not only convenient for the user to query, but also, when a new language type needs to be added, only new fields need to be added to the language resource file to update the language resource file, and a new language type document does not need to be additionally added by the user, so that the updating efficiency of the language resource file is improved, the memory of the database is saved, and the operation of a developer is facilitated.
Step S102, receiving a language switching instruction of a user aiming at the application.
Optionally, receiving a language switching instruction for an application from a user includes: starting a language menu interface, wherein the language menu interface comprises a language type option and an area option; and receiving a language switching instruction input by a user through a trigger language menu interface.
Specifically, the terminal of the embodiment includes a human-computer interaction port, and when it is determined that an application is first run or a user trigger operation on a menu interface on the human-computer interaction port is received, a language menu interface is displayed on the human-computer interaction interface, and the language menu interface includes a language type option and a region option, for example, when the user selects a traditional language and HK, the terminal may input a language switching instruction including a target language type-CHT and a designated region-HK according to the user trigger.
And step S103, screening the language resource file according to the designated area to obtain a target character record, and extracting the target language character from the target character record according to the target language type.
Optionally, the screening from the language resource file according to the designated area to obtain the target character record includes: screening specific character records with the same area labels as the designated areas from the language resource files, and taking the screened specific character records as first character records; deleting the universal character records corresponding to the first character records in the language resource files, and taking the remaining universal character records as second character records, wherein the ID fields of the first character records and the deleted universal character records are the same; and taking the first character record and the second character record as target character records.
Optionally, extracting the target language character from the target character record according to the target language type includes: determining language type fields matched with the target language types in each target character record; and extracting language type resources under the matched language type field, and taking the extracted language type resources as target language characters.
The language switching instruction sent by the user comprises the target language type and the specified area, so that the first character record matched with the specified area can be screened out according to the language switching instruction, and the result obtained after deleting the general character record corresponding to the first character record from the rest general character records is used as the second character record. Taking table 3 as an example, the target character record composed of the first character record and the second character record includes the first to fourth character records in table 3, and the sixth character record.
In the present embodiment, each character record includes a plurality of language resources, so that a language type field matching the target language type — CHT, that is, a CHT field, needs to be determined from each target character record, the language type resources in the CHT field are extracted, and the extracted language type resources are used as target language characters. For example, the extracted language resources are set, the ID =000010111, the ID =000010112, the extracted language resources are completed, and the extracted language type resources are used as target language characters.
And step S104, respectively carrying out language switching on the original characters on the application interface by the target language characters.
Optionally, the language switching is performed on the original characters on the application interface by the target language characters, and the method includes: determining the position of an ID corresponding to the target language character on an application interface; and determining an original character at the position, and replacing the original character with the target language character to realize language switching of the original character.
In a specific implementation, when a target language character is acquired, for example, when the target language character is an "set", a target position on an application interface is determined according to ID =000010111 corresponding to the target language character "set", and an original character at the target position is replaced by "set". Of course, in this embodiment, only the replacement mode of one original character is illustrated, and other replacement modes of the original self-negative character are substantially the same, and are not described in detail in this embodiment.
According to the technical scheme of the embodiment of the invention, the original characters on the application interface are switched after the target language characters are acquired by querying from one language resource file according to the language switching instruction, and because the language resource file is matched with the application, the application keeps running without exiting during language switching, and only one language resource file is required to be queried, so that excessive time occupied by frequently switching queries among numerous language files is avoided, the switching operation is simplified, and the language switching speed and the operation experience of a user are improved.
Example two
Fig. 2 is a flowchart of an applied multilingual switching method according to a second embodiment of the present invention, which is based on the second embodiment and specifically illustrates the target character records obtained by filtering from the language resource file according to the designated area in the second embodiment. As shown in fig. 2, the method includes:
step S201, selecting a specific character record with the same area label as the designated area from the language resource file, and using the selected specific character record as a first character record.
Specifically, in the present embodiment, after the language resource file shown in table 3 is acquired, the language resource file includes the specific character record having the area tag and the general character record having no area tag as shown in table 3. Since the language switching instruction sent by the user includes the target language type and the designated area, for example, the target language type is CHT and the designated area is HK, it is needless to say that the embodiment is only an example, and the specific content included in the language switching instruction is not limited.
The specific character record identical to HK is screened 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 used as the first character record. Of course, this embodiment is merely an example, and the specific content of the first character record is not limited.
Step S202, 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.
After the first character record is screened out, general character records not carrying the area label are screened out from the rest character records, namely, the general character records corresponding to the first to fifth character records are obtained.
It should be noted that, in the present embodiment, a common character record corresponding to the first character record is identified from the common character records corresponding to the first to fifth character records, for example, in the present embodiment, the sixth character record corresponding to the first character record is specifically the same ID =000010115, and the fifth character record not carrying an area tag is deleted, and therefore the fifth character record which is the same as the ID field of the first character record is deleted, and therefore, the ID fields of the first character record and the deleted common character record in the present embodiment are the same. Thereby, the first to fourth character records remaining after deletion are taken as the second character record. Of course, this embodiment is merely an example, and the specific contents of the second character record are not limited.
Step S203, using the first character record and the second character record as the target character record.
In this embodiment, first character records, for example, the sixth character record carrying an area label and the first to fourth character records not carrying an area label shown in table 3, are acquired as target character records. The specific number of target character records is not limited in this embodiment.
According to the technical scheme of the embodiment of the invention, the original characters on the application interface are switched after the target language characters are acquired by querying from one language resource file according to the language switching instruction, and because the language resource file is matched with the application, the application keeps running without exiting during language switching, and only one language resource file is required to be queried, so that excessive time occupied by frequently switching queries among numerous language files is avoided, the switching operation is simplified, and the language switching speed and the operation experience of a user are improved. And the target character record is formed by screening out a first character record with the same area label as the designated area from the language resource file and screening out a second character record from the language resource file according to the first character record, so that the acquired target character record is more accurate.
EXAMPLE III
Fig. 3 is a flowchart of an applied multi-language switching method according to a third embodiment of the present invention, which is a supplement to the first embodiment. Specifically, after the original character memorability language is switched, a language switching result is detected. As shown in fig. 3, the method includes:
step S301, a language resource file matched with the application is created in advance, and the language resource file comprises a general character record and a specific character record.
Optionally, the pre-creating a language resource file matched with the application includes: creating a language database table, wherein the database table comprises an ID field for identifying an original character, at least two language type fields and an area field; acquiring language type resources corresponding to each original character, wherein the number of the language type resources is the same as that of a language type field; and creating a language resource file according to the language database table and the language type resource.
Step S302, receiving a language switching instruction of the user aiming at the application.
Optionally, receiving a language switching instruction of a user for an application includes: starting a language menu interface, wherein the language menu interface comprises a language type option and an area option; and receiving a language switching instruction input by a user through a trigger language menu interface.
Step S303, screening from the language resource file according to the designated area to obtain a target character record, and extracting the target language character from the target character record according to the target language type.
Optionally, the screening from the language resource file according to the designated area to obtain the target character record includes: screening specific character records with the same area labels as the designated areas from the language resource files, and taking the screened specific character records as first character records; deleting the general character records corresponding to the first character records in the language resource files, and taking the rest 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; and taking the first character record and the second character record as target character records.
And step S304, respectively carrying out language switching on the original characters on the application interface by the target language characters.
Optionally, the language switching is performed on the original characters on the application interface by the target language characters, and the method includes: determining the position of an ID corresponding to the target language character on an application interface; and determining an original character at the position, and replacing the original character with the target language character to realize language switching of the original character.
Step S305, determining whether the language switching result matches the target language type, if yes, executing step S306, otherwise, executing step S307.
Specifically, after the terminal completes language switching, the language displayed on the application interface is compared with the target language triggered by the user through the language menu interface, and if the language displayed on the application interface is English and a single user selects a complex language on the language menu interface, the switching result is not matched with the type of the target language.
And step S306, determining that the application language is successfully switched.
And step S307, determining that the application language switching fails and sending an alarm prompt.
When the switching result is determined to be not matched with the target language type, the language switching is determined to be failed, the failure reason may be that hardware equipment fails or a software system fails, and at the moment, an alarm prompt is sent to prompt a user to maintain in time, so that the efficiency and the accuracy of the language switching are further improved. The alarm prompt in the present embodiment may specifically be in a form of voice or in a form of image, and the present embodiment does not limit the specific form of alarm, and is within the scope of the present application as long as the alarm prompt can be provided to the user, and the present embodiment is not limited thereto.
According to the technical scheme of the embodiment of the invention, the original characters on the application interface are switched after the target language characters are acquired by querying from one language resource file according to the language switching instruction, and because the language resource file is matched with the application, the application keeps running without exiting during language switching, and only one language resource file is required to be queried, so that excessive time occupied by frequently switching queries among numerous language files is avoided, the switching operation is simplified, and the language switching speed and the operation experience of a user are improved. When the switching failure is determined, the user is prompted to maintain in time by sending an alarm prompt, so that the efficiency and the accuracy of language switching are further improved.
Example four
Fig. 4 is a schematic structural diagram of a multilingual switching apparatus according to a fourth embodiment of the present invention. As shown in fig. 4, the apparatus includes: a language resource file creating module 410, a language switching instruction receiving module 420, a target language character obtaining module 430 and a language switching module 440.
A language resource file creating module 410, configured to create a language resource file matched with the application in advance, where the language resource file includes a general character record and a specific character record, and the specific character record includes an area tag;
a language switching instruction receiving module 420, configured to receive a language switching instruction for an application by a user, where the language switching instruction includes a target language type and a specified area;
a target language character acquisition module 430, configured to filter from the language resource file according to the specified area to acquire a target character record, and extract a target language character from the target character record according to the target language type;
the language switching module 440 is configured to switch the target language characters to the original characters on the application interface respectively.
Optionally, the language resource file creating module includes:
the database table creating submodule is used for creating a language database table, wherein the database table comprises an ID field for identifying an original character, at least two language type fields and an area field;
the language type resource acquisition submodule is used for acquiring language type resources corresponding to each original character, wherein the number of the language type resources is the same as that of the language type fields;
and the language resource file creating submodule is used for creating the language resource file according to the language database table and the language type resource.
Optionally, the language resource file creating sub-module is configured to import the language type resource into a language database table to obtain a universal character record;
receiving an area label input by a user aiming at the appointed general character record, and splicing the appointed general record and the area label to generate a specific character record corresponding to the appointed general character record;
and generating a language resource file according to the general character records and the specific character records.
Optionally, the language resource file creating sub-module is further configured to obtain a pre-configured resource import execution script;
and importing the language type resources into a language database table through a resource import execution script to obtain the universal character records.
Optionally, each character in the general character record or the specific character record is distinguished by using a joint main key, wherein the joint main key comprises an ID field and an area field.
Optionally, the target language character acquisition module includes a target character record acquisition submodule, configured to screen out a specific character record with an area tag identical to that of the designated area from the language resource file, and use the screened specific character record as a first character record;
deleting the general character records corresponding to the first character records in the language resource files, and taking the rest 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;
and taking the first character record and the second character record as target character records.
Optionally, the target language character acquisition module includes a target language character sub-module, configured to determine a language type field matching the target language type in each target character record;
and extracting language type resources under the matched language type field, and taking the extracted language type resources as target language characters.
Optionally, the language switching module is configured to determine a position of an ID corresponding to the target language character on the application interface;
and determining an original character at the position, and replacing the original character with the target language character to realize language switching of the original character.
Optionally, the language switching instruction receiving module is configured to start a language menu interface, where the language menu interface includes a language type option and an area option;
and receiving a language switching instruction input by a user through a trigger language menu interface.
Optionally, the apparatus further comprises a language switching result checking module, configured to determine whether the language switching result matches the target language type, and if so, determine that the application language switching is successful,
otherwise, determining that the application language switching fails and sending an alarm prompt.
Optionally, the ID field is formed by splicing a function module identifier, a subfunction number, a page number, and a string sequence number.
According to the technical scheme of the embodiment of the invention, the original characters on the application interface are switched after the target language characters are acquired by querying from one language resource file according to the language switching instruction, and because the language resource file is matched with the application, the application keeps running without exiting during language switching, and only one language resource file is needed to be queried, so that excessive time occupied by frequently switching queries among numerous language files is avoided, the switching operation is simplified, and the language switching speed and the operation experience of a user are improved.
The multi-language switching device of the application provided by the embodiment of the invention can execute the session keeping method based on the server cluster provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE five
FIG. 5 illustrates a schematic diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, 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 meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 may also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having 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 specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as the multilingual handover method of the application.
Wherein, include:
pre-creating a language resource file matched with the application, wherein the language resource file comprises a general character record and a specific character record, and the specific character record comprises an area label;
receiving a language switching instruction of a user for application, wherein the language switching instruction comprises a target language type and a specified area;
screening from the language resource file according to the designated area to obtain a target character record, and extracting a target language character from the target character record according to the target language type;
and respectively carrying out language switching on the original characters on the application interface by the target language characters.
In some embodiments, the applied multilingual handoff method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto 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 multi language switching method of the application described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured by any other suitable means (e.g. by means of firmware) to execute a multi-language switching method of an application.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may 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 may 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, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, 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 compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
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 a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; 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 may be received in any form, including acoustic, speech, or tactile input.
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: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may 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. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
EXAMPLE six
An embodiment of the present invention further provides a computer program product, including a computer program, where the computer program, when executed by a processor, implements a multi-language switching method for an application as provided in any embodiment of the present application.
Computer program product in implementing the computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may 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 case of a remote computer, the remote computer may 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 may be made to an external computer (for example, through the Internet using an Internet service provider).
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (21)

1. A multi-language switching method for an application, comprising:
the method comprises the steps that a language resource file matched with an application is created in advance, wherein the language resource file comprises a general character record and a specific character record, and the specific character record comprises an area label;
receiving a language switching instruction of a user for the application, wherein the language switching instruction comprises a target language type and a specified area;
screening from the language resource file according to the designated area to obtain a target character record, and extracting a target language character from the target character record according to the target language type;
and respectively carrying out language switching on the original characters on the application interface by the target language characters.
2. The method according to claim 1, wherein the pre-creating of the language resource file matching the application comprises:
creating a language database table, wherein the database table comprises an ID field for identifying the original character, at least two language type fields and a region field;
obtaining language type resources corresponding to each original character, wherein the number of the language type resources is the same as that of the language type field;
and creating the language resource file according to the language database table and the language type resource.
3. The method of claim 2, wherein creating the language resource file from the language database table and the language type resource comprises:
importing the language type resource into the language database table to obtain the general character record;
receiving an area label input by a user aiming at a specified general character record, splicing the specified general record and the area label to generate the specific character record corresponding to the specified general character record;
and generating the language resource file according to the general character records and the specific character records.
4. The method of claim 3, wherein importing the language type resource into the language database table to obtain the generic character record comprises:
acquiring a pre-configured resource import execution script;
and importing the language type resource into the language database table through the resource import execution script to acquire the general character record.
5. The method of claim 3, wherein the characters in the generic character record or the specific character record are distinguished using a joint primary key, wherein the joint primary key comprises an ID field and a region field.
6. The method according to claim 1, wherein the filtering from the language resource file according to the designated area to obtain the target character record comprises:
screening specific character records with the same area labels as the designated areas from the language resource files, and taking the screened specific character records as first character records;
deleting a general character record corresponding to the first character record in the language resource file, and taking the rest general character records as second character records, wherein the ID fields of the first character record and the deleted general character records are the same;
and taking the first character record and the second character record as the target character record.
7. The method of claim 6, wherein extracting target language characters from the target character record according to the target language type comprises:
determining a language type field matched with the target language type in each target character record;
and extracting language type resources under the matched language type field, and taking the extracted language type resources as the target language characters.
8. The method according to claim 1, wherein the language switching the target language characters to the original characters on the application interface respectively comprises:
determining the position of the ID corresponding to the target language character on the application interface;
and determining an original character at the position, and replacing the original character with the target language character to realize language switching of the original character.
9. The method of claim 1, wherein receiving a language switching instruction of a user for the application comprises:
starting a language menu interface, wherein the language menu interface comprises a language type option and an area option;
and receiving the language switching instruction input by the user through triggering the language menu interface.
10. The method according to claim 1, wherein after the language switching the target language characters to the original characters on the application interface respectively, further comprising:
judging whether the language switching result is matched with the target language type, if so, determining that the application language switching is successful,
otherwise, determining that the application language switching fails and sending an alarm prompt.
11. The method of claim 2, wherein the ID field is formed by function module identification, subfunction number, page number, and string order number concatenation.
12. An apparatus for multi-language switching of applications, comprising:
the language resource file creating module is used for creating a language resource file matched with the application in advance, wherein the language resource file comprises a general character record and a specific character record, and the specific character record comprises an area label;
the language switching instruction receiving module is used for receiving a language switching instruction of a user aiming at the application, wherein the language switching instruction comprises a target language type and a specified area;
the target language character acquisition module is used for screening from the language resource file according to the designated area to acquire a target character record and extracting a target language character from the target character record according to the target language type;
and the language switching module is used for respectively switching the languages of the original characters on the application interface by the target language characters.
13. The apparatus of claim 12, wherein the language resource file creation module comprises:
the database table creating submodule is used for creating a language database table, wherein the database table comprises an ID field for identifying the original character, at least two language type fields and an area field;
a language type resource obtaining submodule, configured to obtain a language type resource corresponding to each original character, where the number of the language type resources is the same as that of the language type field;
and the language resource file creating submodule is used for creating the language resource file according to the language database table and the language type resource.
14. The apparatus according to claim 13, wherein the language resource file creating submodule is configured to import the language type resource into the language database table to obtain the universal character record;
receiving an area label input by a user aiming at a specified general character record, and splicing the specified general record and the area label to generate the specific character record corresponding to the specified general character record;
and generating the language resource file according to the general character records and the specific character records.
15. The apparatus according to claim 12, wherein the target language character acquisition module includes a target character record acquisition sub-module, configured to screen out a specific character record with a region label that is the same as that of the designated region from the language resource file, and use the screened specific character record as the first character record;
deleting a general character record corresponding to the first character record in the language resource file, and taking the rest general character records as second character records, wherein the ID fields of the first character record and the deleted general character records are the same;
and taking the first character record and the second character record as the target character record.
16. The apparatus of claim 15, wherein the target language character acquisition module comprises a target language character sub-module configured to determine a language type field in each of the target character records that matches the target language type;
and extracting language type resources under the matched language type field, and taking the extracted language type resources as the target language characters.
17. The apparatus of claim 12, wherein the language switching module is configured to determine a location of an ID corresponding to the target language character on the application interface;
and determining an original character at the position, and replacing the original character with the target language character to realize language switching of the original character.
18. The apparatus of claim 12, further comprising a language switching result recognition module for determining whether the language switching result matches the target language type, and if yes, determining that the application language switching is successful,
otherwise, determining that the application language switching fails and sending an alarm prompt.
19. An electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory to implement the method of any of claims 1-11.
20. A computer-readable storage medium having computer-executable instructions stored therein, which when executed by a processor, are configured to implement the method of any one of claims 1-11.
21. A computer program product, characterized in that it comprises a computer program which, when being executed by a processor, carries out the method of any one of claims 1-11.
CN202211419991.8A 2022-11-14 2022-11-14 Multi-language switching method, device, equipment and storage medium for application Pending CN115904584A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211419991.8A CN115904584A (en) 2022-11-14 2022-11-14 Multi-language switching method, device, equipment and storage medium for application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211419991.8A CN115904584A (en) 2022-11-14 2022-11-14 Multi-language switching method, device, equipment and storage medium for application

Publications (1)

Publication Number Publication Date
CN115904584A true CN115904584A (en) 2023-04-04

Family

ID=86479888

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211419991.8A Pending CN115904584A (en) 2022-11-14 2022-11-14 Multi-language switching method, device, equipment and storage medium for application

Country Status (1)

Country Link
CN (1) CN115904584A (en)

Similar Documents

Publication Publication Date Title
WO2019161620A1 (en) Application dependency update method, terminal and device, and storage medium
CN114996288A (en) Data comparison method and device, computer storage medium and electronic equipment
CN116611411A (en) Business system report generation method, device, equipment and storage medium
CN110109981B (en) Information display method and device for work queue, computer equipment and storage medium
CN117454817B (en) Engineering processing method and device based on FPGA, electronic equipment and storage medium
CN108959294B (en) Method and device for accessing search engine
CN115454971A (en) Data migration method and device, electronic equipment and storage medium
CN115904584A (en) Multi-language switching method, device, equipment and storage medium for application
CN115328898A (en) Data processing method and device, electronic equipment and medium
EP4071633A1 (en) Task query method and device
CN114281981B (en) News brief report generation method and device and electronic equipment
CN108459914B (en) Middleware command execution method and device
CN116185363A (en) Application construction method, device, equipment and program product
CN113360689B (en) Image retrieval system, method, related device and computer program product
CN114860312A (en) Mobile terminal adaptation method, device, equipment and medium based on credit business
CN115220722A (en) Method, device, equipment and medium for back-end internationalization
CN113849170A (en) Code sharing method and device, electronic equipment and storage medium
CN113535857A (en) Data synchronization method and device
CN117667897A (en) Data migration detection method, device, equipment and medium
CN114449031A (en) Information acquisition method, device, equipment and storage medium
CN116341538A (en) Text rendering method and device and electronic equipment
CN115878668A (en) Incremental identification backup method and device, client device and storage medium
CN114428891A (en) Network resource processing method, device, system, equipment and storage medium
CN116436883A (en) Method, device, electronic equipment and readable storage medium for link transmission
CN115658698A (en) Data query method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination