Development method, system and electronic device based on automatic interface support for multiple languages

Through code conversion and automatic translation technology, it solves the problem that multi-language support for user interfaces in software application development requires a lot of work, realizes automated development of multi-language interfaces, and improves development efficiency.

CN112486623BActive Publication Date: 2024-09-17ENYIKE (BEIJING) DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011483274.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-16
Publication Date
2024-09-17
Estimated Expiration
2040-12-16

AI Technical Summary

Technical Problem

In software application development, multi-language support for user interfaces requires a lot of extra work, and existing technologies cannot effectively solve this problem.

Method used

Through the code conversion method, the Chinese string in the interface is automatically obtained and processed to determine whether it exists in the resource library. If it does not exist, a new resource ID is generated and written to the resource library. The external resource library is used to supplement the text items and pass t Functions perform code conversion to achieve automatic translation and resource library updates, reducing development workload.

Benefits of technology

It greatly improves the efficiency of multi-language application development, simplifies the development process, supports automatic search and replacement of multi-language interfaces, and is suitable for the conversion of existing single-language development applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112486623B
    Figure CN112486623B
Patent Text Reader

Abstract

The present application relates to a development method, system and electronic device based on automatic interface support for multiple languages, which includes: a Chinese character string acquisition step, scanning a directory where an interface file is located, and acquiring the Chinese character string of the corresponding interface; a code conversion step, judging whether the Chinese character string exists in a resource library, if so, returning the corresponding resource id, and performing code conversion through the t function; if not, generating a new resource id based on the Chinese character string and writing it into the resource library, supplementing the corresponding text of the Chinese character string to the resource library based on an external resource library, and performing code conversion through the t function. The present application solves the problem of huge workload in the prior art through code conversion, and realizes automatic search and replacement of multiple languages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software application development, and in particular to a development method, system, and electronic device that automatically supports multiple languages ​​based on an interface. Background Art

[0002] In the field of software application development, multilingual user interface is a very common demand. Multilingual user interface refers to the user interaction interface (UI) of an application, which can automatically display the corresponding language text according to the user's language environment or user settings.

[0003] Multilingual user interface is a common category in software development. Generally speaking, by writing code, adding corresponding resource items to the resource library, generating resource IDs, and then using the resource IDs to write program code, the disadvantage of doing so is that it will cause a lot of extra workload.

[0004] Currently, no effective solution has been proposed for the problem of huge workload in related technologies. Summary of the invention

[0005] The embodiments of the present application provide a development method, system and electronic device that automatically supports multiple languages ​​based on an interface. Through code conversion, the problem of large workload in related technologies is at least solved, and the workflow of developing a multilingual application is simplified and automated, thereby reducing workload and greatly improving development efficiency.

[0006] In a first aspect, an embodiment of the present application provides a development method based on automatic interface support for multiple languages, comprising the following steps:

[0007] The Chinese character string acquisition step is to scan the directory where an interface file is located and acquire the Chinese character string of the corresponding interface;

[0008] The code conversion step determines whether the Chinese character string exists in a resource library. If so, the corresponding resource id is returned, and the code conversion is performed through the t function. If not, a new resource id is generated based on the Chinese character string and written into the resource library. According to an external resource library, the corresponding text item of the Chinese character string is added to the resource library, and the code conversion is performed through the t function.

[0009] In some embodiments, the t function includes a first parameter and a second parameter, the first parameter refers to the Chinese character string, the second parameter refers to the resource id, and the t function searches for the character string in the language corresponding to the resource id from the resource library and returns it.

[0010] In some embodiments, an exception judgment step is further included between the Chinese character string acquisition step and the code conversion step:

[0011] According to a preset code format, the Chinese character string that conforms to the code format is judged and automatically ignored.

[0012] In some embodiments, when the Chinese character string does not exist in the resource library during the code conversion step,

[0013] A csv file generation step is to search the external resource library, obtain the newly added resource items, and generate a csv file;

[0014] An automatic translation step, automatically translating the resource item through a translation interface, and writing the translation result back to the csv file;

[0015] The resource library update step is to manually review the translation results and then update the confirmed csv file to the resource library.

[0016] In some embodiments, in the process of generating the new resource id in the code conversion step, the new resource id is automatically generated according to the Chinese character string using a preset rule and updated to the resource library;

[0017] The preset rule includes interface file directory name+interface file name+Chinese pinyin first letter+serial number.

[0018] In some embodiments, the Chinese character string acquisition step includes:

[0019] The source code of the directory where the interface file is located is processed through a regular expression and an abstract syntax tree, and all the Chinese character strings are output.

[0020] In a second aspect, an embodiment of the present application provides a development system based on an interface that automatically supports multiple languages, and the development system based on an interface that automatically supports multiple languages ​​described in the first aspect is applied, including:

[0021] The Chinese character string acquisition module scans the directory where an interface file is located and obtains the Chinese character string of the corresponding interface;

[0022] The code conversion module determines whether the Chinese character string exists in a resource library. If so, the corresponding resource id is returned and the code conversion is performed through the t function. If not, a new resource id is generated based on the Chinese character string and written into the resource library. According to an external resource library, the corresponding text item of the Chinese character string is added to the resource library, and the code conversion is performed through the t function.

[0023] In some of the embodiments, an exception judgment module is further connected between the Chinese character string acquisition module and the code conversion module. The exception judgment module judges and automatically ignores the Chinese character string that conforms to the code form according to a preset code form.

[0024] In some embodiments, the code conversion module includes:

[0025] A csv file generating unit searches the external resource library, obtains the newly added resource items, and generates a csv file;

[0026] An automatic translation unit, which automatically translates the resource item through a translation interface and writes the translation result back to the csv file;

[0027] A resource library updating unit, after manually reviewing the translation results, updates the confirmed csv file to the resource library;

[0028] The resource id generating unit automatically generates the new resource id according to the Chinese character string using a preset rule and updates it to the resource library. The preset rule is interface file directory name + interface file name + Chinese pinyin first letter + serial number.

[0029] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the development method based on automatic interface support for multiple languages ​​as described in the first aspect above is implemented.

[0030] Compared with the related art, the development method, system and electronic device based on the automatic support of multiple languages ​​by the interface provided in the embodiment of the present application solve the problem of huge workload in the prior art through code conversion and realize automatic search and replacement of multiple languages.

[0031] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0033] Figure 1 is a flow chart of a development method based on automatic interface support for multiple languages ​​according to an embodiment of the present application;

[0034] Figure 2 is a flowchart of a code conversion step according to an embodiment of the present application;

[0035] Figure 3 is a flow chart of a development method based on automatic interface support for multiple languages ​​according to a preferred embodiment of the present application;

[0036] Figure 4 It is a structural block diagram of a development system based on automatic interface support for multiple languages ​​according to an embodiment of the present application;

[0037] Figure 5 Schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. Description of the drawings:

[0039] 1. Chinese character string acquisition module; 2. Code conversion module; 21. CSV file generation unit;

[0040] 22. Automatic translation unit; 23. Resource library update unit; 24. Resource ID generation unit;

[0041] 81. Processor; 82. Memory; 83. Communication interface;

[0042] 80. Bus. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0044] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as insufficient content disclosed in this application.

[0045] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0046] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantitative limitation, and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects before and after are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0047] The goal of the present invention is to minimize the workload of developing a multi-language interface, so that the workload of developing a multi-language interface is close to that of developing a single-language interface. For an application interface that has never been developed with multi-language considerations installed, it can be automatically converted or minimally modified to support multiple languages.

[0048] Based on the above purpose, this embodiment provides a development method based on automatic support for multiple languages ​​in an interface. Figure 1 is a flow chart of a development method based on automatic interface support for multiple languages ​​according to an embodiment of the present application, such as Figure 1 As shown, the process includes the following steps:

[0049] Chinese character string acquisition step S1, scanning a directory where an interface file is located to acquire a Chinese character string corresponding to the interface;

[0050] The code conversion step S2 determines whether the Chinese character string exists in a resource library. If so, the corresponding resource id is returned, and the code conversion is performed through the t function. If not, a new resource id is generated based on the Chinese character string and written into the resource library. The corresponding text item of the Chinese character string is added to the resource library according to an external resource library, and the code conversion is performed through the t function.

[0051] Through the above steps, the directory where the interface file is located is scanned instead of the entire project, and the Chinese string is converted into a t function, that is, code conversion. It automatically supports multiple languages ​​and can reduce the workload of multi-language development. It also supports old projects and is flexible, and can also realize conversion for existing single-language development applications.

[0052] Code conversion is to replace all Chinese strings with a t function. When there is a Chinese string in the code, it is detected that the string is used for display, so different text should be displayed in a multi-language environment. Then we use the t function to replace this string. This string is used as an input parameter of the t function. When it is a Chinese environment, the t function directly returns the input string. If it is an English environment, the t function searches for the string of the corresponding language in the language resource package and returns it. Of course, code conversion not only includes the application of the t function, but also includes the automatic addition, translation, and update of the language resource library.

[0053] It should be noted that although this method focuses on the development of web application interfaces, its principles can actually be applied to the interface development of any mainstream platform, and it also supports automatic multilingualization of other non-English language interfaces (English interface applications are not easy to distinguish between interface text and program codes).

[0054] In actual applications, the interface file can be a web application interface file. Web application interface files generally have inherent storage formats, such as aspx, jsp, react, jsx, uve template files, and small program wxml. The codes are also stored together in organization, so there is no need to scan the entire project. Scanning the directory where the interface files are located can narrow the processing scope and thus reduce the overall amount of calculation.

[0055] The above resource library may be stored in the form of files or databases, and has the following structure:

[0056] id en en jp Mould.esource_id project project ... abc Name name ... 123 age age ...

[0057] The id must be unique. The id is used in the code to represent a text item, and each subsequent column represents the text of the word in a certain language.

[0058] In the program code of the user interface, "resource id" is used instead of the corresponding text, for example:

[0059] In the Chinese interface program (pseudocode), "name" is displayed. The corresponding multi-language writing method is to display "abc". When the code is running, "abc" will be used to search the resource library for the text of the corresponding language and return it for display, thus achieving the effect of multi-language support.

[0060] In some embodiments, the t function includes a first parameter and a second parameter, the first parameter refers to a Chinese character string, and the second parameter refers to a resource id. The t function searches for a character string in a language corresponding to the resource id from the resource library and returns it.

[0061] In actual applications, the t function is used to return the text to be displayed. It receives two parameters. The first parameter refers to the Chinese string (or other non-English text that needs to be converted). The first parameter is required and indispensable. The second parameter refers to the resource id. The second parameter is optional. In the t function, when there is only the first parameter, the content of the first parameter is returned. When there is a second parameter, the text item of the corresponding language is searched from the resource library and returned.

[0062] The current display language environment can be obtained inside the t function. When the code separation is not complete and the t function cannot obtain the current language environment, a third parameter can be added as needed to indicate the current language.

[0063] You can also use the t function directly while writing code to automatically add the second parameter during the code scanning process.

[0064] In some embodiments, an exception judgment step is further included between the Chinese character string acquisition step and the code conversion step:

[0065] According to the pre-set code format, the Chinese character string is judged, and the Chinese character string that conforms to the code format is automatically ignored.

[0066] In actual applications, in some cases, the Chinese characters in the code are involved in the calculation or in other cases, the Chinese string should not be processed. Some rules can be agreed upon to make the scanner ignore these cases. For example, some form of comments can be added to the code:

[0067] / / skip_varsvar1var2

[0068] When the scanned Chinese character string belongs to variable var1 or var2, the Chinese character string is ignored.

[0069] Furthermore, text items that have been processed before (that have been replaced by the t function) will not be processed either.

[0070] Figure 2 is a flowchart of the code conversion steps according to an embodiment of the present application, such as Figure 2As shown, in some embodiments, when the Chinese character string does not exist in the resource library in the code conversion step S2, the following steps are included:

[0071] csv file generation step S21, searching the external resource library, obtaining the newly added resource items, and generating a csv file;

[0072] Automatic translation step S22, automatically translating the resource item through a translation interface, and writing the translation result back to the csv file;

[0073] In the resource library update step S23, the translation result is manually reviewed and the confirmed csv file is updated to the resource library.

[0074] In actual applications, the purpose of generating a csv file is to facilitate manual intervention and improve the accuracy of translation through inspection. The structure of the csv file includes: ID, zh, en, jp, ..., among which non-Chinese columns are blank, indicating that the corresponding translation item has not been found.

[0075] By setting the above steps, the method is flexible enough to provide support for additional situations and the possibility of manual intervention, thus avoiding the situation where conversion cannot be made due to insufficient content in the resource library. By adding manual intervention, the accuracy of conversion is improved.

[0076] In some of the embodiments, in the process of generating a new resource id in the code conversion step, a new resource id is automatically generated according to the Chinese character string using a preset rule and updated to the resource library;

[0077] The default rule is interface file directory name + interface file name + Chinese pinyin first letter + serial number.

[0078] In actual applications, all Chinese character strings found are compared with the existing resource library. If the Chinese character string is already in the resource library, the resource id is obtained, and the text item of the corresponding language is returned through the t function; if it is not in the resource library, it means that this Chinese character string is a new word, and a new resource id is generated to ensure the uniqueness of the resource id. It is automatically generated using the preset rules. The format of the rule setting is: interface file directory name, interface file name, Chinese pinyin first letter and serial number, and it is updated to the resource library China after generation.

[0079] In some embodiments, the Chinese character string acquisition step includes:

[0080] The source code of the directory where the interface file is located is processed through a regular expression and an abstract syntax tree, and all Chinese character strings are output.

[0081] Regular expression, also known as regular expression. (English: Regular Expression, often abbreviated as regex, regexp or RE in code), is a concept in computer science. Regular expressions are usually used to retrieve and replace text that conforms to a certain pattern (rule).

[0082] A regular expression is a logical formula for string operations. It uses some pre-defined specific characters and the combination of these specific characters to form a "regular string". This "regular string" is used to express a filtering logic for strings. A regular expression is a text pattern that describes one or more strings to match when searching for text.

[0083] Abstract Syntax Tree (AST), or Syntax Tree for short, is an abstract representation of the syntax structure of source code. It represents the syntax structure of a programming language in a tree-like form, and each node on the tree represents a structure in the source code. The reason why the syntax is "abstract" is that the syntax here does not represent every detail that appears in the real syntax. For example, nested parentheses are implied in the tree structure and are not presented in the form of nodes; and conditional jump statements such as if-condition-then can be represented using nodes with two branches.

[0084] Syntactic analysis (also called parsing) is a process of analyzing an input text consisting of a sequence of words (such as an English word sequence) according to a given formal grammar and determining its grammatical structure.

[0085] The embodiments of the present application are described and illustrated below through preferred embodiments.

[0086] Figure 3 It is a flowchart of a development method based on automatic interface support for multiple languages ​​according to a preferred embodiment of the present application.

[0087] S301, scan interface code file

[0088] Scan the directory where the interface files are located.

[0089] S302, find all Chinese character strings and remove exceptions

[0090] Use regular expressions and abstract syntax trees (AST) to process source code to find all Chinese strings.

[0091] Define some rules to let the scanner ignore Chinese strings that should not be processed, such as adding some form of comments in the code: / / skip_vars var1 var2

[0092] If the Chinese character string scanned belongs to variable var1 or var2, it will be ignored.

[0093] Text items that have been processed before (already replaced by the t function, described later) should not be processed either.

[0094] S303, matching resource library

[0095] Compare these Chinese strings to the existing resource library:

[0096] If it is already in the resource library, get the resource id:

[0097] If it is not in the resource library, generate a new resource ID, automatically generate it using the rule of file directory name + file name + Chinese pinyin first letter + serial number, and after generation, add and update it to the resource library.

[0098] S304, replace the text with t function

[0099] Still use regular expressions and abstract syntax trees to replace the Chinese string with a t function and return the corresponding text item. For example, if the text is "age", it is replaced with t("age", "resource id") and the text item corresponding to the resource id is returned.

[0100] The above steps can batch process many code files. After this step is executed, the web application interface is consistent with the unprocessed state, that is, there is no change in the foreign language environment. This is because the newly added multilingual resource library entries are not translated.

[0101] S305, Update resource library

[0102] When a Chinese character string is found not to exist in the resource library, this step is executed to add an entry which is only in Chinese form.

[0103] S3051, generate new resource csv

[0104] Search the external resource library, find the newly added resource items (without multi-language translation), and generate a csv file;

[0105] S3052, automatic translation

[0106] Call the translation engine through the translation interface, such as Baidu Translate, Bing Translate or other professional translation engines, to fill in the missing language items;

[0107] S3053, manual review

[0108] Manually review the csv file, check the translation results through manual intervention, and modify the translation results with problems;

[0109] S3054, Import resource library

[0110] Update the translated csv file into the resource library.

[0111] The main purpose of setting S3051-S3054 is to translate the untranslated entries in the resource library, by finding the untranslated entries -> exporting them into csv files -> automatically translating them using the translation interface, writing them back to the csv files -> manually reviewing the translation results -> importing them back to the resource library. After this process is executed, the web application interface will display the corresponding foreign language text in the foreign language environment.

[0112] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0113] The present embodiment also provides a development system based on automatic support for multiple languages ​​​​on the interface, which is used to implement the above-mentioned embodiments and preferred implementation modes, which have been described and will not be repeated. As used below, the terms "module", "unit", "subunit", etc. can implement a combination of software and / or hardware for a predetermined function. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0114] Figure 4 is a structural block diagram of a development system based on an interface that automatically supports multiple languages ​​according to an embodiment of the present application, such as Figure 4 As shown, the system includes:

[0115] The Chinese character string acquisition module 1 scans the directory where an interface file is located and obtains the Chinese character string of the corresponding interface;

[0116] Code conversion module 2 determines whether the Chinese character string exists in a resource library. If so, it returns the corresponding resource id and performs code conversion through the t function. If not, it generates a new resource id based on the Chinese character string and writes it into the resource library. It adds the corresponding text item of the Chinese character string to the resource library based on an external resource library, and performs code conversion through the t function.

[0117] In actual applications, the Chinese character string acquisition model processes the source code of the directory where the interface file is located through a regular expression and an abstract syntax tree, and outputs all Chinese character strings.

[0118] The above t function includes a first parameter and a second parameter. The first parameter refers to a Chinese character string, and the second parameter refers to a resource id. The t function searches for a character string in a language corresponding to the resource id from the resource library and returns it.

[0119] In some of the embodiments, an exception judgment module is further connected between the Chinese character string acquisition module and the code conversion module. The exception judgment module judges the Chinese character string according to a preset code form and automatically ignores the Chinese character string that conforms to the code form.

[0120] In some embodiments, the code conversion module 2 includes:

[0121] The csv file generating unit 21 searches the external resource library, obtains the newly added resource items, and generates a csv file;

[0122] An automatic translation unit 22 automatically translates the resource item through a translation interface and writes the translation result back to the csv file;

[0123] The resource library updating unit 23 manually reviews the translation results and updates the confirmed csv file to the resource library;

[0124] The resource ID generating unit 24 automatically generates a new resource ID according to the Chinese character string using a preset rule and updates it to the resource library. The preset rule is interface file directory name + interface file name + Chinese pinyin first letter + serial number.

[0125] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0126] In addition, combined Figure 1 The development method for automatically supporting multiple languages ​​based on the interface in the embodiment of the present application described can be implemented by an electronic device. Figure 5 Schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application.

[0127] The electronic device may include a processor 81 and a memory 82 storing computer program instructions.

[0128] Specifically, the processor 81 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0129] Among them, the memory 82 may include a large-capacity memory for data or instructions. By way of example and not limitation, the memory 82 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 82 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 82 may be inside or outside the data processing device. In a specific embodiment, the memory 82 is a non-volatile memory. In a specific embodiment, the memory 82 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (Programmable Read-Only Memory, PROM for short), an erasable PROM (Erasable ProgrammableRead-Only Memory, EPROM for short), an electrically erasable PROM (Electrically Erasable ProgrammableRead-Only Memory, EEPROM for short), an electrically alterable ROM (ElectricallyAlterable Read-OnlyMemory, EAROM for short) or a flash memory (FLASH) or a combination of two or more of these. Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM can be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.

[0130] The memory 82 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 81 .

[0131] The processor 81 reads and executes the computer program instructions stored in the memory 82 to implement any one of the development methods for automatically supporting multiple languages ​​based on the interface in the above embodiments.

[0132] In some of the embodiments, the electronic device may further include a communication interface 83 and a bus 80. Figure 5 As shown, the processor 81, the memory 82, and the communication interface 83 are connected via a bus 80 and communicate with each other.

[0133] The communication interface 83 is used to implement communication between the modules, devices, units and / or equipment in the embodiment of the present application. The communication port 83 can also implement data communication with other components such as: external devices, image / data acquisition equipment, databases, external storage, and image / data processing workstations.

[0134] The bus 80 includes hardware, software or both, and couples the components of the electronic device to each other. The bus 80 includes but is not limited to at least one of the following: a data bus, an address bus, a control bus, an expansion bus, and a local bus. By way of example and not limitation, bus 80 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, bus 80 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.

[0135] The electronic device can execute the development method based on automatic interface support for multiple languages ​​in the embodiment of the present application based on the acquired Chinese character string, thereby realizing the combination of Figure 1 Describes a development method based on an interface that automatically supports multiple languages.

[0136] In addition, in combination with the development method based on automatic interface support for multiple languages ​​in the above embodiments, the present application embodiment can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the development methods based on automatic interface support for multiple languages ​​in the above embodiments is implemented.

[0137] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0138] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A development method based on automatic interface support for multiple languages, It is characterized in that The following steps are involved: The Chinese character string acquisition step is to scan the directory where an interface file is located and acquire the Chinese character string of the corresponding interface; The code conversion step determines whether the Chinese character string exists in a resource library. If so, the corresponding resource ID is returned and the code conversion is performed through the t function. If it does not exist, a new resource id is generated based on the Chinese character string and written into the resource library, a corresponding text item of the Chinese character string is added to the resource library according to an external resource library, and code conversion is performed through the t function; When the Chinese character string does not exist in the resource library in the code conversion step, the following steps are included: a csv file generation step, searching the external resource library, obtaining the newly added resource item, and generating a csv file; an automatic translation step, automatically translating the resource item through a translation interface, and writing the translation result back to the csv file; a resource library update step, after manually reviewing the translation result, updating the confirmed csv file to the resource library; in the process of generating a new resource id in the code conversion step, automatically generating the new resource id according to the Chinese character string using a preset rule, and updating it to the resource library; the preset rule is interface file directory name + interface file name + Chinese pinyin first letter + serial number.

2. According to the development method of claim 1, It is characterized in that The t function includes a first parameter and a second parameter, wherein the first parameter refers to the Chinese character string, and the second parameter refers to the resource id. The t function searches for a character string in a language corresponding to the resource id from the resource library and returns the result.

3. The development method based on automatic interface support for multiple languages ​​according to claim 1, It is characterized in that An exception judgment step is also included between the Chinese character string acquisition step and the code conversion step: according to a preset code form, the Chinese character string that conforms to the code form is judged and automatically ignored.

4. The development method based on automatic interface support for multiple languages ​​according to claim 1, It is characterized in that The Chinese character string acquisition step includes: processing the source code of the directory where the interface file is located through a regular expression and an abstract syntax tree, and outputting all the Chinese character strings.

5. A development system based on automatic interface support for multiple languages, using the development method based on automatic interface support for multiple languages ​​as described in any one of claims 1 to 4 above, It is characterized in that include: The Chinese character string acquisition module scans the directory where an interface file is located and obtains the Chinese character string of the corresponding interface; The code conversion module determines whether the Chinese character string exists in a resource library. If so, it returns the corresponding resource ID and performs code conversion through the t function. If it does not exist, a new resource id is generated based on the Chinese character string and written into the resource library, a corresponding text item of the Chinese character string is added to the resource library according to an external resource library, and code conversion is performed through the t function; The code conversion module includes: a csv file generation unit, which searches the external resource library, obtains the newly added resource items, and generates a csv file; an automatic translation unit, which automatically translates the resource items through a translation interface and writes the translation results back to the csv file; a resource library update unit, which manually reviews the translation results and updates the confirmed csv file to the resource library; the code conversion module includes: a resource id generation unit, which automatically generates the new resource id according to the Chinese character string using a preset rule and updates it to the resource library, and the preset rule is interface file directory name + interface file name + Chinese pinyin first letter + serial number.

6. The development system based on the interface automatically supporting multiple languages ​​according to claim 5, It is characterized in that An exception judgment module is also connected between the Chinese character string acquisition module and the code conversion module. The exception judgment module judges and automatically ignores the Chinese character string that conforms to the code form according to a preset code form.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the development method based on automatic interface support for multiple languages ​​is implemented as described in any one of claims 1 to 4.