Multi-language service method and device, electronic equipment and readable storage medium
By managing the correspondence between text tags and multilingual text, and generating multilingual relationship tables and toolkits, the management and maintenance problems of software products in multilingual services are solved, and efficient multilingual support and flexibility are achieved.
Patent Information
- Application Number
- CN202411981332.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-29
AI Technical Summary
Building software products that support multilingual services face challenges, including managing multiple language environments, characteristics of different languages, development methods of application and web services, and updating and maintaining multilingual services.
By managing the correspondence between text tags and multilingual text, a multilingual relationship table and multilingual toolkit are generated, and multilingual configuration and text acquisition are supported for applications and web servers.
It realizes efficient management of multilingual text, supports expansion and access, facilitates maintenance and updates, meets the multilingual needs of applications and web services, and improves the flexibility and applicability of software products.
Smart Images

Figure CN119902795A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer software technology, and in particular to a multi-language service method, device, electronic device and readable storage medium. Background Art
[0002] With the continuous growth of the global economy, the software industry is still in a rapid development stage. Software systems and various software applications emerge in an endless stream, constantly driving the industry forward. In the software development industry, no matter what system or application, with the development of business, the growth of users, and the enhancement of industry vitality, it is worth considering to carry out international exploration.
[0003] At present, the multilingual service capability of software has become one of the key factors to enhance the competitiveness of software products. Multilingual service means that the software can support and adapt to multiple language environments to meet the needs of users in different countries and regions. Therefore, the necessity of multilingual service is becoming increasingly prominent and has become an important aspect of the international development of the software industry.
[0004] However, building a professional software product that supports multilingual services requires developers to face many challenges and fully consider the characteristics of each language, which makes development and management difficult. At the same time, multilingual services for applications and web services usually require different development methods and provide different user interfaces. In addition, how to update and maintain multilingual services is also a technical difficulty. Summary of the invention
[0005] In view of this, one or more embodiments of the present disclosure provide a multilingual service method, device, electronic device and readable storage medium, which can efficiently manage multilingual texts and facilitate expansion and access.
[0006] In a first aspect, the present disclosure provides a multilingual service method, the method comprising: managing the correspondence between text tags and multilingual texts, and distinguishing the multilingual texts corresponding to the same text tag according to at least one text attribute of language, region, and status; generating a multilingual relationship table according to the correspondence between the text tags and the multilingual texts, so that a target application reads the multilingual relationship table and determines multilingual configuration information; generating a multilingual toolkit according to the correspondence between the text tags and the multilingual texts, so that a target service references the multilingual toolkit and obtains the target language text.
[0007] Text tags can be used to mark multilingual texts that have the same semantic information in series, making them easier to access. The multilingual relationship table of the form file type allows applications to efficiently identify multilingual information and form their own multilingual configuration. The multilingual toolkit facilitates the convenient use of web servers and allows them to quickly find the required language texts. On the one hand, the introduction of text tags is beneficial to the maintenance and management of multilingual services, as well as the updating and tracing of multilingual services. On the other hand, a multilingual relationship table is generated to meet the use requirements of the application, and a multilingual toolkit is also generated to meet the use requirements of the web service, ensuring the flexibility and applicability of multilingual services.
[0008] Optionally, the management of the correspondence between text labels and multilingual texts includes: managing the correspondence between the text labels and the multilingual texts through a label management application; if the text labels are changed, updating the main version number of the label management application; if the multilingual texts are changed, updating the sub-version number of the label management application.
[0009] Through the tag management application, the correspondence between text tags and multilingual texts is managed, which improves management efficiency and supports batch management. Whenever a text tag or multilingual text changes, the version number is updated, and multiple versions of tag management applications can be formed for easy maintenance and traceability. The setting of the main version number and sub-version number makes it easy to determine the differences and connections between different tag management applications.
[0010] Optionally, generating a multilingual toolkit according to the correspondence between the text tags and the multilingual texts includes: generating a candidate configuration file according to the correspondence between the text tags and the multilingual texts, the candidate configuration file adopting a data storage structure of key-value pairs; encapsulating the candidate configuration file according to internationalization configuration items to generate the multilingual toolkit; wherein the internationalization configuration item includes at least one sub-configuration item of language, currency, region, time zone, and telephone country code.
[0011] The candidate configuration file uses a key-value data storage structure, which simply and intuitively reflects the correspondence between text tags and multilingual texts. The candidate configuration file is not only easy to create, but also does not require complex parsers and can be applied to different software environments. The internationalization requirements of software not only involve text translation work, but also usually need to consider business differences caused by different time formats, currency exchange rates, and laws and policies of different countries. Therefore, creating a multilingual toolkit according to international configuration items ensures that multilingual services can adapt to international language versions.
[0012] Optionally, the multilingual toolkit adopts the Spring framework to store the correspondence between the text tag and the multilingual text in the form of a configuration file set; the target service references the multilingual toolkit to obtain the target language text, including: the target service references the multilingual toolkit and sends the target tag to the multilingual toolkit; according to the priority of the Spring framework, the multilingual toolkit accesses the configuration file sets in sequence, and detects whether the target tag exists in the current configuration set; if the target tag is detected, the multilingual toolkit determines the target language text that matches the target tag in the current configuration set, and sends the target language text to the target service; if the target tag is not detected, the multilingual toolkit accesses the next configuration file set of the current configuration set until all the configuration file sets of the multilingual toolkit are accessed.
[0013] The Spring framework simplifies the backend database interaction process after the multi-language toolkit is called. Spring's dependency injection function reduces the coupling between configuration file sets and improves the maintainability of the multi-language toolkit. According to the priority of the Spring framework, the configuration file sets can be detected in order to find the target language text that best matches the target tag, avoiding conflicts caused by the same tags in different configuration file sets.
[0014] In a second aspect, the present disclosure provides a multilingual service device, which includes: a management unit for managing the correspondence between text labels and multilingual texts, and the multilingual texts corresponding to the same text label are distinguished according to at least one text attribute of language, region, and status; a first generation unit for generating a multilingual relationship table according to the correspondence between the text labels and the multilingual texts, so that a target application reads the multilingual relationship table and determines multilingual configuration information; a second generation unit for generating a multilingual toolkit according to the correspondence between the text labels and the multilingual texts, so that the target service references the multilingual toolkit to obtain the target language text.
[0015] Optionally, the management unit is specifically used to: manage the correspondence between the text label and the multilingual text through a label management application; if the text label is changed, update the main version number of the label management application; if the multilingual text is changed, update the sub-version number of the label management application.
[0016] Optionally, the second generating unit is specifically used to: generate a candidate configuration file according to the correspondence between the text tag and the multilingual text, the candidate configuration file adopting a key-value pair data storage structure; encapsulate the candidate configuration file according to the internationalization configuration item to generate the multilingual toolkit; wherein the internationalization configuration item includes at least one sub-configuration item of language, currency, region, time zone, and telephone country code.
[0017] Optionally, the multilingual toolkit adopts the Spring framework to store the correspondence between the text tag and the multilingual text in the form of a configuration file set; the target service references the multilingual toolkit to obtain the target language text, including: the target service references the multilingual toolkit and sends the target tag to the multilingual toolkit; according to the priority of the Spring framework, the multilingual toolkit accesses the configuration file sets in sequence, and detects whether the target tag exists in the current configuration set; if the target tag is detected, the multilingual toolkit determines the target language text that matches the target tag in the current configuration set, and sends the target language text to the target service; if the target tag is not detected, the multilingual toolkit accesses the next configuration file set of the current configuration set until all the configuration file sets of the multilingual toolkit are accessed.
[0018] In a third aspect, the present disclosure provides an electronic device, comprising a memory and a processor, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the multilingual service method described above is implemented.
[0019] In a fourth aspect, the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the multi-language service method described above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The features and advantages of the embodiments of the present disclosure may be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present disclosure in any way. In the accompanying drawings:
[0021] Figure 1 A schematic diagram showing the steps of a multi-language service method in one embodiment of the present disclosure is shown;
[0022] Figure 2 A schematic diagram of a version management method for a tag management application in one embodiment of the present disclosure is shown;
[0023] Figure 3 A schematic diagram showing the use of a multi-language relationship table in one embodiment of the present disclosure is shown;
[0024] Figure 4 Shows a schematic diagram of the use of a multilingual toolkit in an embodiment of the present disclosure;
[0025] Figure 5 Shows a schematic diagram of the logical processing of a multilingual service method in an embodiment of the present disclosure;
[0026] Figure 6 Shows a schematic diagram of the functional modules of a multilingual service device in an embodiment of the present disclosure;
[0027] Figure 7 Shows a schematic diagram of the structure of an electronic device in an embodiment of the present disclosure. Detailed implementation manners
[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are some but not all of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.
[0029] Please refer to Figure 1 , a multilingual service method provided by an embodiment of the present disclosure may include the following multiple steps.
[0030] S1: Manage the correspondence between text tags and multilingual texts. The multilingual texts corresponding to the same text tag are distinguished according to at least one text attribute among language, region, and status.
[0031] In this embodiment, the text contents with the same semantics in the multilingual texts can be concatenated through a text tag. For example, the text tag can be "iiyhg". The Chinese text that can be concatenated with this text tag is "成功", the English text that can be concatenated is "success", and the Japanese text that can be concatenated is "せいこう". The language text attribute can represent different language species, such as Chinese, English, French, German, Spanish, etc. The region text attribute represents the language characteristics of each region. For example, there may be grammar differences or dialect characteristics in different regions of the same country. The status text attribute can represent the display forms of the same words and sentences, such as traditional and simplified Chinese, and uppercase and lowercase English.
[0032] In this embodiment, through text tags, multilingual texts with the same semantic information can be marked and concatenated, which is convenient for reference. Introducing text tags is beneficial to both the maintenance and management of multilingual services and the update and traceability of multilingual services.
[0033] In some embodiments, the management of the correspondence between text labels and multilingual texts includes: managing the correspondence between the text labels and the multilingual texts through a label management application; if the text labels are changed, updating the main version number of the label management application; if the multilingual texts are changed, updating the sub-version number of the label management application.
[0034] Specifically, the label management application manages the correspondence between text labels and multilingual texts, which improves management efficiency and supports batch management. Whenever a text label or multilingual text changes, the version number is updated, and multiple versions of the label management application can be formed, which is convenient for maintenance and traceability. The setting of the main version number and the sub-version number makes it easy to determine the differences and connections between different label management applications.
[0035] For a practical example, see Figure 2 A tag management application can manage a group of text tags and the multi-language texts corresponding to the group of text tags. The version number can be used to determine the current version of the tag management application. Each time a text tag is added or deleted, the main version number of the tag management application is incremented. Each time a multi-language text corresponding to a text tag is added or deleted, the sub-version number of the tag management application is incremented. It should be noted that the version number increment is executed after the batch change of text tags or multi-language texts is completed.
[0036] Optionally, configuration files (eg, properties files) may be generated in batches based on tag management applications.
[0037] Optionally, the number of text tags in each tag management application can be limited to prevent a single tag management application from being overly bloated. If the number of text tags is too large, multiple tag management applications can be used to classify and manage a certain number of text tags respectively.
[0038] S2: Generate a multi-language relationship table according to the correspondence between the text label and the multi-language text, so that the target application reads the multi-language relationship table to determine the multi-language configuration information.
[0039] In this embodiment, the multi-language relation table of form file types (such as excel, json, xml) enables the application (Application, APP) to efficiently identify multi-language information and form its own multi-language configuration to meet the usage requirements of the application.
[0040] For a practical example, see Figure 3The multi-language service method on the APP side is used as follows: the APP reads the Excel file generated by the multi-language service through the front-end script, generates its multi-language configuration file (such as a properties file), and then switches the language according to its configuration file.
[0041] It should be noted that, based on the same multi-language relationship table, that is, the Excel file, different APPs can generate configuration files suitable for different operating systems according to their actual needs. For example, the first system can be an IOS system, and the second system can be an Android system.
[0042] S3: Generate a multilingual toolkit according to the correspondence between the text label and the multilingual text, so that the target service references the multilingual toolkit to obtain the target language text.
[0043] In this embodiment, the multi-language toolkit is convenient for the target service (such as a web server) to use and quickly find the required language text. The multi-language toolkit can be a software development kit (SDK) that can quickly respond to the reference request of the target service and directly provide the target language text.
[0044] In some embodiments, generating a multilingual toolkit according to the correspondence between the text tags and the multilingual texts includes: generating a candidate configuration file according to the correspondence between the text tags and the multilingual texts, the candidate configuration file adopting a key-value pair data storage structure; encapsulating the candidate configuration file according to internationalization configuration items to generate the multilingual toolkit; wherein the internationalization configuration item includes at least one sub-configuration item of language, currency, region, time zone, and telephone country code.
[0045] Specifically, the candidate configuration file can be a properties file, one of the main advantages of which is that it is easy to read, maintain, and modify. The candidate configuration file uses a key-value data storage structure, which can simply and intuitively reflect the correspondence between text tags and multilingual texts. Compared with files in XML or JSON format, the candidate configuration file of the properties type is not only easy to create, but also does not require a complex parser. The candidate configuration file of the properties type can be applied to different software environments, can use UTF-8 encoding, and has international scenarios that utilize multilingual services.
[0046] The "key" information of the candidate configuration file can be a text label, and the "value" information of the candidate configuration file can be a language text. For example, the "key" and "value" of one candidate configuration file can be "iiyhg" and "success" respectively, and the "key" and "value" of another candidate configuration file can be "iiyhg" and "success" respectively. It can be seen that different configuration files pointing to the same semantics retain the corresponding relationship through text labels, which can meet the user's language switching needs on the web server.
[0047] Generally speaking, the internationalization requirements of software not only involve text translation, but also need to consider the business differences caused by different time formats, currency exchange rates, and laws and policies of different countries. Therefore, creating a multilingual toolkit according to international configuration items ensures that multilingual services can adapt to international language versions.
[0048] When encapsulating candidate configuration files according to internationalization configuration items, different candidate configuration files can be marked with internationalization identifiers. An internationalization identifier can consist of one or more internationalization sub-identifiers connected by a hyphen ("-", [Unicode] U+002D).
[0049] In a practical application example, the regional international sub-identifier can be encoded by two uppercase letters, such as Hong Kong, China HK and Taiwan, China TW.
[0050] In some embodiments, the multilingual toolkit adopts the Spring framework to store the correspondence between the text tag and the multilingual text in the form of a configuration file set; the target service references the multilingual toolkit to obtain the target language text, including: the target service references the multilingual toolkit and sends the target tag to the multilingual toolkit; according to the priority of the Spring framework, the multilingual toolkit accesses the configuration file sets in sequence, and detects whether the target tag exists in the current configuration set; if the target tag is detected, the multilingual toolkit determines the target language text matching the target tag in the current configuration set, and sends the target language text to the target service; if the target tag is not detected, the multilingual toolkit accesses the next configuration file set of the current configuration set until all the configuration file sets of the multilingual toolkit are accessed.
[0051] Specifically, the Spring framework can simplify the backend database interaction process after the multi-language toolkit is called. Based on Spring annotations, a large amount of code and workload can be reduced, greatly improving the operating efficiency of the multi-language toolkit. Spring's dependency injection function reduces the coupling between configuration file sets and improves the maintainability of the multi-language toolkit. According to the priority of the Spring framework, the configuration file sets can be detected in order to find the target language text that best matches the target tag, avoiding conflicts caused by the same tags in different configuration file sets.
[0052] In an actual application example, the configuration file set corresponding to the system default configuration maintained by the multi-language toolkit may be messages.properties. The configuration file set corresponding to the target language configuration maintained by the multi-language toolkit may be messages_zh_HK.properties. The configuration file set may be further divided into different configuration file subsets and saved in different file paths. In the Spring framework, the priority of the configuration file set may be defined. For example, the priority of messages_zh_HK.properties may be defined to be higher than that of messages.properties. In the Spring framework, the priority of different configuration file subsets belonging to the same configuration file set may also be defined. For example, the priority of the messages subset in messages_zh_HK.properties may be defined to be higher than that of the error subset.
[0053] If the target service references the multi-language toolkit, you can query the corresponding target language text by specifying the specified key of the target language. The specific working process of the multi-language toolkit can be as follows:
[0054] 1) According to the specified key of the specified target language, search for the key in the target language configuration. If the key exists in the target language configuration and the search value (value) corresponding to the key is not empty, then return the search value as the target language text. For example, according to the specified key in the specified language zh-Hant-HK, if key=value exists in messages_zh_HK.properties and value is not empty, then return value.
[0055] 2) According to the specified key of the specified target language, search for the key in the target language configuration. If the key does not exist in the target language configuration or the search value corresponding to the key is empty, search for the key in the system default configuration. If the key exists in the system default configuration and the search value corresponding to the key is not empty, return the search value as the target language text. For example, according to the specified key in the specified language zh-Hant-HK, if the key does not exist in messages_zh_HK.properties or the value corresponding to the key is empty, and key=value exists in messages.properties, return value.
[0056] 3) According to the specified key of the specified target language, if the key is not found in the target language configuration and the system default configuration, or the corresponding search value of the key is empty, then the null value information is returned to the target service. For example, according to the specified key in the specified language zh-Hant-HK, if the key does not exist in messages_zh_HK.properties and messages.properties or the corresponding value of the key is empty, then null is returned.
[0057] 4) According to the specified key of the specified target language, search in the target language configuration and the system default configuration. If conflicting keys are found in different paths of the same language configuration, the loading priority of the value corresponding to the key depends on the Spring configuration. For example, according to the specified key in the specified language zh-Hant-HK, the search value corresponding to the specified key is retrieved in the two file paths classpath:i18n / messages and classpath:i18n / error of messages_zh_HK.properties. At this time, due to the priority of the Spring framework, the priority of the messages subset is set higher than the error subset, then the search value retrieved through the file path classpath:i18n / messages will be output as the target language text, and will not be overwritten by the search value retrieved from the file path classpath:i18n / error.
[0058] For a practical example, see Figure 4 , the web server can directly use the multi-language toolkit to obtain the required target language text. The multi-language toolkit can manage dependencies based on Maven, simplifying the implementation process of multi-language support.
[0059] Specifically, through the automatic assembly principle of Spring Boot, the multi-language toolkit GlobalI18nTextConvertService can be instantiated to generate the utility class GlobalI18nTextUtil.
[0060] The web server can add the annotation @GlobalI18nText to the Http interface that requires internationalization and use the utility class GlobalI18nTextUtil. The utility class GlobalI18nTextUtil can provide all the functions of the multi-language toolkit GlobalI18nTextConvertService. It can take the @GlobalI18nText annotation as the entry point and implement the return of the target language text for the web server through aspect-oriented programming.
[0061] For example, the input parameter of the web server can be "===i18N:1:1:yueyue-test:4:N81i===", and the return value received by the web server can be "===約約測試文案-中国香港4===".
[0062] Please refer to Figure 5 , the multi-language service method provided by an embodiment of the present disclosure may include the following processing procedures.
[0063] Through the ideas of tagging and multi-versions, create and update the tag management application. The tag management application can manage the correspondence between text tags and multi-language texts. According to these correspondences, the tag management application can generate Excel files to meet the access requirements of the APP side. According to these correspondences, the tag management application can generate Properties files and package these Properties files into the SDK to meet the access requirements of the server side. At the same time, the Properties files in the SDK can support dynamic expansion to enhance the scalability of the SDK. The tag management application can support batch operations to improve management efficiency. The tag management application can include a multi-language approval function to ensure the accuracy and security of text tags and multi-language texts.
[0064] The technical solution provided by one or more embodiments of the present disclosure can mark multilingual texts that connect the same semantic information through text tags for easy reference. The multilingual relationship table of the form file type enables the application to efficiently identify multilingual information and form its own multilingual configuration. The multilingual toolkit is convenient for the web server to use and quickly find the required language text. On the one hand, the introduction of text tags is beneficial to the maintenance and management of multilingual services, as well as the updating and tracing of multilingual services. On the other hand, a multilingual relationship table is generated to meet the use requirements of the application, and a multilingual toolkit is also generated to meet the use requirements of the web service, ensuring the flexibility and applicability of the multilingual service.
[0065] The technical solution provided by one or more embodiments of the present disclosure uses a customized text tag to manage the multilingual text to be replaced. Even if the same multilingual text is used in different functions, as long as the defined text tags are different, the corresponding multilingual meanings are also different. By managing text tags through a tag management application, the multilingual service system is extremely flexible.
[0066] See also Figure 6 The present disclosure also provides a multi-language service device, the device comprising:
[0067] The management unit 100 is used to manage the correspondence between the text label and the multi-language text, and the multi-language text corresponding to the same text label is distinguished according to at least one text attribute of language, region, and status;
[0068] A first generating unit 200 is used to generate a multi-language relationship table according to the correspondence between the text label and the multi-language text, so that the target application reads the multi-language relationship table to determine the multi-language configuration information;
[0069] The second generating unit 300 is used to generate a multilingual toolkit according to the correspondence between the text label and the multilingual text, so that the target service references the multilingual toolkit to obtain the target language text.
[0070] In one embodiment, the management unit 100 is specifically used to: manage the correspondence between the text label and the multilingual text through a label management application; if the text label is changed, update the main version number of the label management application; if the multilingual text is changed, update the sub-version number of the label management application.
[0071] In one embodiment, the second generation unit 300 is specifically used to: generate a candidate configuration file based on the correspondence between the text tag and the multilingual text, wherein the candidate configuration file adopts a key-value pair data storage structure; encapsulate the candidate configuration file according to the internationalization configuration item to generate the multilingual toolkit; wherein the internationalization configuration item includes at least one sub-configuration item of language, currency, region, time zone, and telephone country code.
[0072] In one embodiment, the multilingual toolkit uses a Spring framework to store the correspondence between the text label and the multilingual text in the form of a configuration file set; the target service references the multilingual toolkit to obtain the target language text, including:
[0073] The target service references the multi-language toolkit and sends a target tag to the multi-language toolkit; according to the priority of the Spring framework, the multi-language toolkit accesses the configuration file sets in sequence and detects whether the target tag exists in the current configuration set; if the target tag is detected, the multi-language toolkit determines the target language text that matches the target tag in the current configuration set and sends the target language text to the target service; if the target tag is not detected, the multi-language toolkit accesses the next configuration file set of the current configuration set until all the configuration file sets of the multi-language toolkit are accessed.
[0074] Each unit described in the above embodiments may be implemented by a computer chip or a product having a certain function. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0075] For the convenience of description, the above devices are described in terms of functions and are described separately in various units. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0076] See also Figure 7 The present disclosure also provides an electronic device, which includes a memory and a processor, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the multi-language service method is implemented.
[0077] The present disclosure also provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the multi-language service method described above is implemented.
[0078] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0079] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory, that is, implementing the method in the above method embodiment.
[0080] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0081] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0082] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the device, equipment, and storage medium, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0083] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
[0084] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A multilingual service method, characterized in that: The method comprises: Managing the correspondence between text labels and multilingual texts, and distinguishing the multilingual texts corresponding to the same text label according to at least one text attribute of language, region, and status; Generate a multi-language relationship table according to the correspondence between the text label and the multi-language text, so that the target application reads the multi-language relationship table to determine the multi-language configuration information; A multilingual toolkit is generated according to the correspondence between the text label and the multilingual text, so that a target service references the multilingual toolkit to obtain the target language text.
2. The method according to claim 1, characterized in that The management of the correspondence between the text label and the multilingual text includes: Managing the correspondence between the text labels and the multilingual texts through a label management application; If the text label is changed, the major version number of the label management application is updated; If the multi-language text is changed, the sub-version number of the tag management application is updated.
3. The method according to claim 1, characterized in that The generating a multilingual toolkit according to the correspondence between the text label and the multilingual text includes: Generate a candidate configuration file according to the correspondence between the text label and the multilingual text, wherein the candidate configuration file adopts a data storage structure of key-value pairs; According to the internationalization configuration items, the candidate configuration files are packaged to generate the multi-language toolkit; The internationalization configuration item includes at least one sub-configuration item of language, currency, region, time zone, and telephone country code.
4. The method according to claim 1 or 3, characterized in that: The multilingual toolkit adopts the Spring framework to store the correspondence between the text label and the multilingual text in the form of a configuration file set; The target service references the multilingual toolkit to obtain the target language text, including: The target service references the multi-language toolkit and sends a target tag to the multi-language toolkit; According to the priority of the Spring framework, the multi-language toolkit sequentially accesses the configuration file sets and detects whether the target tag exists in the current configuration set; If the target tag is detected, the multilingual toolkit determines the target language text that matches the target tag in the current configuration set, and sends the target language text to the target service; If the target tag is not detected, the multi-language toolkit accesses the next configuration file set of the current configuration set until all the configuration file sets of the multi-language toolkit are accessed.
5. A multi-language service device, characterized in that: The device comprises: A management unit, used for managing the correspondence between text labels and multilingual texts, wherein the multilingual texts corresponding to the same text label are distinguished according to at least one text attribute of language, region, and status; A first generating unit, configured to generate a multi-language relationship table according to the correspondence between the text label and the multi-language text, so that a target application reads the multi-language relationship table to determine multi-language configuration information; The second generating unit is used to generate a multilingual toolkit according to the correspondence between the text label and the multilingual text, so that the target service references the multilingual toolkit to obtain the target language text.
6. The device according to claim 5, characterized in that The management unit is specifically used for: Managing the correspondence between the text labels and the multilingual texts through a label management application; If the text label is changed, the major version number of the label management application is updated; If the multi-language text is changed, the sub-version number of the tag management application is updated.
7. The device according to claim 5, characterized in that The second generating unit is specifically used for: Generate a candidate configuration file according to the correspondence between the text label and the multilingual text, wherein the candidate configuration file adopts a data storage structure of key-value pairs; According to the internationalization configuration items, the candidate configuration files are packaged to generate the multi-language toolkit; The internationalization configuration item includes at least one sub-configuration item of language, currency, region, time zone, and telephone country code.
8. The device according to claim 5 or 7, characterized in that The multilingual toolkit adopts the Spring framework to store the correspondence between the text label and the multilingual text in the form of a configuration file set; The target service references the multilingual toolkit to obtain the target language text, including: The target service references the multi-language toolkit and sends a target tag to the multi-language toolkit; According to the priority of the Spring framework, the multi-language toolkit sequentially accesses the configuration file sets and detects whether the target tag exists in the current configuration set; If the target tag is detected, the multilingual toolkit determines the target language text that matches the target tag in the current configuration set, and sends the target language text to the target service; If the target tag is not detected, the multi-language toolkit accesses the next configuration file set of the current configuration set until all the configuration file sets of the multi-language toolkit are accessed.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 4 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.