A method and device for realizing multilingual content
Through the multi-language resource management platform, the complexity problem of the client and server maintaining resource files separately under the microservice architecture is solved, efficient language support and resource management are achieved, and maintenance costs are reduced.
Patent Information
- Application Number
- CN202310377856.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-10
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2043-04-10
AI Technical Summary
In the microservice architecture, existing international multilingual technology requires clients and servers to maintain multilingual resource files separately, resulting in complex translation and maintenance of resource files and prone to errors and omissions, especially when product deployment is increased difficulty and cost of language support. Unacceptable.
The multilingual resource management platform realizes centralized and unified management of multilingual resources, uses the client caching mechanism to reduce the loading time of display content, and converts encoded strings into display content in different target languages by looking for resource files, so that maintenance operations Only the resource data in the multilingual resource management platform needs to be processed to avoid a lot of maintenance work on clients and servers.
It realizes centralized management of multilingual resources, reduces the maintenance workload of clients and servers, improves the flexibility and efficiency of language support, and reduces the loading time of resource files.
Smart Images

Figure CN116401358B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for implementing multilingual content. Background Art
[0002] The existing internationalized multilingual technology is based on resource file binding technology, which requires the client and server to maintain their own multilingual resource files. Under the microservice architecture, the services provided by the server can easily be dozens, hundreds, or even thousands, and the client is also divided into different projects according to the business modules corresponding to the microservices. Each server service and client project needs to maintain a multilingual resource file, so that each server service and client project can determine the display content in different languages according to the resource file. When a language needs to be added, the translation and maintenance of resource files will become extremely complex, difficult, and prone to errors. Especially when the product needs to be deployed on-site and a customer requires specific language support, the difficulty and cost of project customization implementation will become unacceptable. Summary of the invention
[0003] In view of this, the purpose of the present application is to provide a method and device for implementing multilingual content, so as to realize centralized and unified management of multilingual resources through a multilingual resource management platform; by publishing the resource files corresponding to the language used by the user to the client, the cache mechanism of the client can be fully utilized to reduce the loading time of the displayed content; by searching the resource files, the encoded character string can be converted into display content in different target languages, so that when the display content needs to be added, modified, deleted or other maintenance operations, it is only necessary to process the resource data in the multilingual resource management platform, and avoid a lot of maintenance work on the client and server.
[0004] The embodiment of the present application provides a method for implementing multilingual content, the method being applied to a multilingual resource management platform, the multilingual resource management platform being used to manage a multilingual resource library; the method comprising:
[0005] Determine the user's login status based on the user login information sent by the client;
[0006] Determine the target language used by the user using a judgment strategy corresponding to the login status;
[0007] Extracting resource data corresponding to the target language from the multilingual resource library; wherein the multilingual resource library pre-stores resource data corresponding to multiple languages; the resource data corresponding to each language includes display content corresponding to each resource identifier set by the multilingual resource library in the language; each resource identifier can be converted into display content in a different language based on the resource data to indicate language information;
[0008] The resource data corresponding to the target language is published to the client to obtain a target resource file, so that the client converts the encoded string into display content corresponding to the target language according to the target resource file and displays it; wherein the encoded string includes the resource identifier to be converted; the encoded string is determined by the server according to the request information sent by the client and returned to the client.
[0009] Further, the using a judgment strategy corresponding to the login status to determine the target language used by the user includes:
[0010] When the login status is that the user has logged in, determining whether the user has set the target language according to the user login information;
[0011] If the user has not set the target language, determining whether organizations at all levels associated with the user have set the target language;
[0012] If the organizations at all levels associated with the user have not set the target language, or when the login status is that the user is not logged in, determine the current language used by the client according to the user login information, and determine whether the multiple languages involved in the multilingual resource library include the current language used by the client;
[0013] If the current language used by the client is not included, determining whether the multilingual resource management platform has been set with a configuration language;
[0014] If the multilingual resource management platform does not have a configuration language set, determining the current language used by the operating system where the server is located, and determining whether the multiple languages involved in the multilingual resource library include the current language used by the operating system where the server is located;
[0015] If the current language used by the operating system where the server is located is not included, the default language is determined as the target language used by the user.
[0016] Furthermore, the multilingual resource management platform is used to manage the multilingual resource library, including:
[0017] In response to an export operation by a developer, exporting resource data corresponding to a language selected by the developer from the multilingual resource library;
[0018] In response to the developer's import operation, configuring the language corresponding to the resource data to be imported and importing the resource data to be imported into the multi-language resource library; or,
[0019] The original resource data of the corresponding language in the multilingual resource library is updated according to the imported resource data.
[0020] Furthermore, the multilingual resource management platform is used to manage the multilingual resource library, including:
[0021] Form a multi-level directory according to the microservice structure in the client and the server;
[0022] The resource data in the multi-language resource library is managed and organized in the form of the multi-level directory; wherein each resource data under the last level directory of the multi-level directory includes a resource identifier, a resource code and display content corresponding to each language.
[0023] The embodiment of the present application also provides a method for implementing multilingual content, the method being applied to a client, the client comprising a common component and a front-end service module corresponding to at least one microservice; the common component comprising a target resource file corresponding to a target language used by a user; the target resource file is determined by a multilingual resource management platform for managing a multilingual resource library and published to the common component; the method comprising:
[0024] In response to the user's triggering operation on the target microservice, the target front-end service module corresponding to the target microservice generates the user's request information and sends the request information to the server;
[0025] The target front-end service module receives the encoded string generated by the server processing the request information, and calls the common component;
[0026] The common component converts the encoded string into display content corresponding to the target language according to the target resource file;
[0027] The target front-end service module obtains and displays the display content corresponding to the target language.
[0028] Furthermore, the encoded string includes a resource identifier to be converted and business data; the resource identifier to be converted can be converted into display content in different languages to indicate language information generated by the server performing business processing according to the request information; the business data indicates numerical information generated by the server performing business processing according to the request information; the common component converts the encoded string into display content corresponding to the target language according to the target resource file, including:
[0029] Parsing the resource identifier and the business data to be converted from the encoded character string according to the identifier of the resource identifier;
[0030] Finding the display content corresponding to the resource identifier to be converted from the target resource file;
[0031] The display content corresponding to the resource identifier to be converted and the business data are combined to obtain the display content corresponding to the target language.
[0032] The embodiment of the present application also provides a method for implementing multilingual content, the method being applied to a server, the server including at least one backend business module corresponding to a microservice; the method comprising:
[0033] In response to the request information sent by the client, the target backend business module corresponding to the target microservice requested by the user generates a coded string by processing the request information;
[0034] The target backend business module sends the encoded string to the client, so that the client converts the encoded string into display content corresponding to the target language according to the target resource file and displays it; wherein the target language is the language used by the user; the target resource file is determined by a multilingual resource management platform for managing a multilingual resource library according to the target language and published to the client.
[0035] The embodiment of the present application also provides a method for implementing multilingual content, which is applied to a multilingual implementation system; the multilingual implementation system includes a multilingual resource management platform, a client, and a server; the multilingual resource management platform is used to manage a multilingual resource library; the implementation method includes:
[0036] The multilingual resource management platform determines the user's login status according to the user login information sent by the client;
[0037] The multilingual resource management platform determines the target language used by the user using a judgment strategy corresponding to the login status;
[0038] The multilingual resource management platform extracts resource data corresponding to the target language from the multilingual resource library; wherein the multilingual resource library pre-stores resource data corresponding to multiple languages; the resource data corresponding to each language includes display content corresponding to each resource identifier set by the multilingual resource library in the language; each resource identifier can be converted into display content in different languages based on the resource data to indicate language information;
[0039] The multilingual resource management platform publishes the resource data corresponding to the target language in the multilingual resource library to the public component of the client to obtain the target resource file;
[0040] In response to the user's triggering operation on the target microservice, the client generates request information of the user and sends the request information to the server;
[0041] The server processes the request information to generate a coded string, and sends the coded string to the client; wherein the coded string includes a resource identifier to be converted;
[0042] The client converts the encoded character string into display content corresponding to the target language according to the target resource file and displays the converted content.
[0043] The embodiment of the present application further provides a device for implementing multilingual content, the device being applied to a multilingual resource management platform, the multilingual resource management platform being used to manage a multilingual resource library; the device comprising:
[0044] A login determination module determines the user's login status based on the user login information sent by the client;
[0045] A language determination module, using a judgment strategy corresponding to the login status to determine the target language used by the user;
[0046] An extraction module extracts resource data corresponding to the target language from the multilingual resource library; wherein the multilingual resource library pre-stores resource data corresponding to multiple languages; the resource data corresponding to each language includes display content corresponding to each resource identifier set by the multilingual resource library in the language; each resource identifier can be converted into display content in a different language based on the resource data to indicate language information;
[0047] A publishing module publishes the resource data corresponding to the target language in the multilingual resource library to the client to obtain a target resource file, so that the client converts the encoded string into the display content corresponding to the target language according to the target resource file and displays it; wherein the encoded string includes the resource identifier to be converted; the encoded string is determined by the server according to the request information sent by the client and returned to the client.
[0048] The embodiment of the present application also provides a device for implementing multilingual content, the device being applied to a client, the client comprising a common component and a front-end service module corresponding to at least one microservice; the common component comprising a target resource file corresponding to a target language used by a user; the target resource file is determined by a multilingual resource management platform for managing a multilingual resource library and published to the common component; the device comprising:
[0049] A first sending module, in response to the user's triggering operation on the target microservice, a target front-end service module corresponding to the target microservice generates the user's request information and sends the request information to the server;
[0050] A calling module, wherein the target front-end service module receives the coded string generated by the server processing the request information and calls the common component;
[0051] A conversion module, the common component converts the encoded string into display content corresponding to the target language according to the target resource file;
[0052] The display module, the target front-end service module obtains and displays the display content corresponding to the target language.
[0053] The embodiment of the present application further provides a device for implementing multilingual content, the device being applied to a server, the server including at least one backend business module corresponding to a microservice; the device including:
[0054] A generation module, in response to the request information sent by the client, a target backend business module corresponding to the target microservice requested by the user generates a coded string by processing the request information;
[0055] The second sending module, the target back-end business module sends the encoded string to the client, so that the client converts the encoded string into display content corresponding to the target language according to the target resource file and displays it; wherein the target language is the language used by the user; the target resource file is determined by a multilingual resource management platform for managing a multilingual resource library according to the target language and published to the client.
[0056] The embodiments of the present application provide a method and device for implementing multilingual content, which realize centralized and unified management of multilingual resources through a multilingual resource management platform; by publishing resource data corresponding to the language used by the user to the client, the client's cache mechanism can be fully utilized to reduce the loading time of the displayed content; by searching the resource file, the encoded string can be converted into display content in different target languages, so that when the display content needs to be added, modified, deleted or other maintenance operations, only the resource data in the multilingual resource management platform needs to be processed, and a large amount of maintenance work on the client and the server can be avoided.
[0057] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0059] Figure 1 One of the flowcharts of a method for implementing multilingual content provided in an embodiment of the present application is shown;
[0060] Figure 2 A schematic diagram of a language resource management interface of a multilingual resource management platform provided in an embodiment of the present application is shown;
[0061] Figure 3 A second flowchart of a method for implementing multilingual content provided by an embodiment of the present application is shown;
[0062] Figure 4 A third flowchart of a method for implementing multilingual content provided in an embodiment of the present application is shown;
[0063] Figure 5 An architecture diagram of a multi-language implementation system provided by an embodiment of the present application is shown;
[0064] Figure 6 One of the structural schematic diagrams of a device for implementing multilingual content provided in an embodiment of the present application is shown;
[0065] Figure 7 A second structural diagram of a device for implementing multilingual content provided in an embodiment of the present application is shown;
[0066] Figure 8 A third structural diagram of a device for implementing multilingual content provided in an embodiment of the present application is shown;
[0067] Fig. 9 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0068] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.
[0069] After research, it was found that the existing internationalized multilingual technology is based on resource file binding technology, which requires the client and server to maintain their own multilingual resource files respectively. Under the microservice architecture, the services provided by the server are often dozens, hundreds, or even thousands, and the client is also divided into different projects according to the business modules corresponding to the microservices. Each server service and client project needs to maintain a multilingual resource file, so that each server service and client project can determine the display content in different languages according to the resource file. When a language needs to be added, the translation and maintenance of resource files will become extremely complex, difficult, and prone to errors. Especially when the product needs to be deployed on-site and a customer requires specific language support, the difficulty and cost of project customization implementation will become unacceptable.
[0070] Based on this, the embodiment of the present application provides a method and device for implementing multilingual content, which realizes centralized and unified management of multilingual resources through a multilingual resource management platform; the resource files corresponding to the language used by the user are published to the client, which can make full use of the client's cache mechanism and reduce the loading time of the displayed content; by searching the resource files, the encoded strings can be converted into display content in different target languages, so that when the display content needs to be added, modified, deleted or other maintenance operations, it is only necessary to process the resource data in the multilingual resource management platform, and avoid a lot of maintenance work on the client and server.
[0071] See also Figure 1 , Figure 1 The flowchart of a method for implementing multilingual content provided by an embodiment of the present application is applied to a multilingual resource management platform, and the multilingual resource management platform is used to manage a multilingual resource library. Figure 1 As shown in , the implementation method provided by the embodiment of the present application includes:
[0072] S101. Determine the user's login status according to the user login information sent by the client.
[0073] In this step, the user login information may include the user's account name and password, and the user's login status may include logged in and not logged in; the multilingual resource management platform may verify the user's account name and password, and if the verification passes, the login status is determined to be that the user is logged in; if the verification fails, the login status is determined to be that the user is not logged in.
[0074] S102: Determine the target language used by the user using a judgment strategy corresponding to the login status.
[0075] In this step, for users in different login states, the judgment strategy for determining the target language used is different; for example, for logged-in users, the user identity can be determined based on the user login information, and then the language setting saved by the user can be determined; for users who are not logged in, since the user identity cannot be determined, the target language can be determined based on the language setting of the client or server.
[0076] Here, a user language selection interface is developed in the multilingual resource management platform, which supports a rich selection logic of languages and can select a judgment strategy according to the user login status to determine the appropriate target language for display. In a possible implementation, step S102 may include:
[0077] S1021. When the login status is that the user has logged in, determine whether the user has set a target language according to the user login information.
[0078] In this step, if the user has logged in, the user identity can be determined based on the user login information, and then it is queried whether the user has pre-set the target language; if the user has set the target language, the language set by the user can be directly used as the target language used by the user.
[0079] S1022: If the user has not set a target language, determine whether organizations at all levels associated with the user have set a target language.
[0080] In this step, if the user has not set the target language, the user's organization and superior organization can be checked level by level, such as the user's department, business unit or branch, etc. If a certain level of organization has set the target language, the target language set by the organization at that level will be used as the target language used by the user.
[0081] S1023. If the organizations at all levels associated with the user have not set a target language, or when the login status is that the user is not logged in, determine the current language used by the client according to the login information, and determine whether the multiple languages involved in the multilingual resource library include the current language used by the client.
[0082] In this step, if the organizations at all levels associated with the user have not set the target language, the target language is determined according to the logic that the user is not logged in; specifically, the current language used by the client can be determined according to the user login information, for example, the user login information also includes the language information of the Accept-Language header in the request Header, and the current language of the browser can be determined based on this; then, check whether the multiple languages involved in the multilingual resource library include the current language used by the client, that is, check whether the multilingual resource library supports the current language of the browser; if supported, the current language of the browser is determined as the target language.
[0083] S1024: If the current language used by the client is not included, determine whether the multilingual resource management platform has set a configuration language.
[0084] In this step, if the current language used by the client is not included in the multiple languages of the multilingual resource file library, it is considered that the multilingual resource library does not support the current language of the browser, and it is determined whether the multilingual resource management platform has set the configuration language in the configuration center; if it has been set, the configuration language is determined as the target language.
[0085] S1025: If the multi-language resource management platform has not set a configuration language, determine the current language used by the operating system where the server is located, and determine whether the multi-language resource file involves the current language used by the operating system where the server is located.
[0086] S1026: If the current language used by the operating system of the server is not included, the default language is determined as the target language used by the user.
[0087] For steps S1025 and S1026, if the multilingual resource management platform has not set the configuration language, the current language used by the operating system where the server is located is determined, and it is judged whether the multiple languages involved in the multilingual resource library include the current language used by the operating system where the server is located; if included, the current language used by the operating system where the server is located is determined as the target language; if not included, the default language, such as Simplified Chinese, American English, etc., is determined as the target language used by the user.
[0088] S103: extract resource data corresponding to the target language from the multilingual resource library.
[0089] The multilingual resource library pre-stores resource data corresponding to multiple languages; therefore, after the target language is determined in S102, the resource data corresponding to the target language can be extracted from the multilingual resource library. Here, the resource data corresponding to each language includes the display content corresponding to each resource identifier set by the multilingual resource library in the language; each resource identifier can be converted into display content in different languages based on the resource data to indicate language information.
[0090] S104: Publishing resource data corresponding to the target language in the multilingual resource library to a common component of the client to obtain a target resource file, so that the client converts the coded string into display content corresponding to the target language according to the target resource file and displays the converted content.
[0091] Here, the multilingual resource management platform has a language resource publishing function, which can generate static resource files for the client to load and use. Specifically, when the multilingual resource management platform is published through the unified resource interface, the resource data corresponding to the target language is generated into the corresponding static resource file. Exemplarily, the resource files can be stored in the i18n (internationalization, internationalization, refers to the internationalization function of software development that supports multiple languages) directory of the public component static directory. When the resource data of the multilingual resource library is updated, the multilingual resource management platform will re-publish the resource files to the client. Among them, the default resource can be expressed as i18n.json, and resource files in different languages have language suffixes, such as American English: i18n_enUS.json, Hong Kong Traditional Chinese i18n_zh_HK.json, the file content is in JSON format, including the tree structure of resource directories and resources, and the data format example is as follows:
[0092]
[0093]
[0094] In specific implementation, in addition to publishing the resource data corresponding to the target language to the client to obtain the target resource file, the resource data corresponding to each language involved in the multilingual resource library can also be published to the client to form a corresponding resource file.
[0095] Afterwards, the client sends a request message to the server in response to the user's operation, and the server determines and returns the corresponding encoding string to the client in response to the request message; the encoding string includes the resource identifier to be converted, and the client can determine the target display content in the target language form from the target resource file according to the resource identifier to be converted and convert it for display. In this way, the public component that publishes the resource file to the client can make full use of the client's cache mechanism, reduce page loading time, and improve loading speed.
[0096] Furthermore, the multilingual resource management platform is used to manage a multilingual resource library in the following ways: Method 1: in response to an export operation by a developer, the resource data corresponding to the language selected by the developer is exported from the multilingual resource library; or, Method 2: in response to an import operation by a developer, the language corresponding to the resource data to be imported is configured and the resource data file to be imported is imported into the multilingual resource library; and the original resource data of the corresponding language in the multilingual resource library is updated according to the imported resource data.
[0097] Here, the multilingual resource management platform can centrally manage the multilingual resource library, making the resource data scalable, easy to maintain and easy to modify.
[0098] In a possible implementation, the multilingual resource management platform has a resource file export and import function. By providing a visual interactive interface to developers, developers can trigger resource import and resource export operations on the interactive interface; specifically, in response to the developer's export operation, the multilingual resource management platform can export the resource data corresponding to the language selected by the developer from the multilingual resource library to form a resource file, and provide the exported resource file to relevant personnel for translation, modification, adding new languages, etc. Afterwards, in response to the developer's import operation, the processed resource file can be imported into the multilingual resource management platform again, and the multilingual resource management platform can parse the resource data to be imported based on the re-imported resource file; according to the language corresponding to the resource data to be imported configured by the developer, the imported resource data is used to integrate and replace the original resource data of the corresponding language in the multilingual resource library, so as to update the original multilingual resource data. In this way, the resource file import and export function of the multilingual resource management platform can realize batch and convenient language translation, as well as centralized and unified language resource maintenance, which is convenient for updating and modifying resources and expanding multiple languages.
[0099] Furthermore, the multilingual resource management platform is used to manage a multilingual resource library, and also includes: forming a multi-level directory based on the microservice structure in the client and the server; managing and organizing the resource data in the multilingual resource library in the form of the multi-level directory; wherein each resource data of the multilingual resource file in the last level directory of the multi-level directory includes a resource identifier, a resource code, and display content corresponding to each language.
[0100] In a possible implementation, the multilingual resource management platform has a multilingual resource directory management function, which can uniformly manage and maintain language resources, and the language resource data can be cataloged and classified according to structures such as subsystems, modules, and functions. Optionally, under the microservice architecture, the client and the server are divided into multiple modules according to the microservice structure. At this time, a multi-level directory can be formed according to the microservice structure, and the multilingual resource files can be managed and organized in the form of a multi-level directory, so that the management of resource files is clearer and more efficient. The directory hierarchy can be set according to business needs. For example, a two-level directory can be formed according to the microservice structure, which is the microservice modules corresponding to the client and the server and the service functions provided by each microservice module; a three-level directory can also be formed, which is the subsystems included in the client and the server, the microservice modules included in each subsystem, and the service functions provided by each microservice module.
[0101] See below Figure 2 , Figure 2This is a schematic diagram of a language resource management interface of a multi-language resource management platform provided in an embodiment of the present application. Figure 2 As shown, in the "prompt" directory of the last level directory of the multi-level directory, taking simplified Chinese as an example, each resource data of the resource file includes a resource identifier, a resource code and display content in simplified Chinese, that is, a resource name.
[0102] The design of resource identifiers follows the following rules: a single resource identifier is enclosed in a specific identifier, such as ${}, to distinguish the resource identifier from other common information, such as business data; in this way, when the client displays multilingual content, the resource identifier in the encoded string can be identified, and the resource identifier is replaced with the display content corresponding to different languages by searching the target resource file for display, so that the resource identifier can indicate to the user the language information generated by the server to perform business processing according to the request information. The resource identifier can be composed of multiple levels of directory encoding plus resource encoding, separated by a dot in the middle; for example, the system management (sysManager) resource under the menu (menu) directory under the public (bdap) directory has a complete resource identifier of: $"{bdap.menu.sysManager}". Here, the directory encoding and resource encoding must strictly follow the Java variable naming specifications, that is, composed of uppercase and lowercase letters and numbers, with a camel case structure starting with a lowercase letter, and underscores are not allowed.
[0103] When a display information contains multiple resource identifiers, each resource data of the resource file also includes a group code and a group sequence number. Specifically, these multiple resource identifiers should be grouped into a group through group coding and set the group sequence number. For example, when the user's data import operation on the client encounters a data import exception, the client should display a prompt message to the user "A total of 10 items were imported, and 8 items failed", where 10 and 8 are business data, indicating the numerical information generated by the server according to the request information and the business logic to perform business processing. In an embodiment of the present application, the encoded string returned by the server to the client should be expressed as "${import.key1}10${import.key2}8${import.key3}". At this time, there should be three corresponding resource identifiers in the multilingual resource library - import.key1, import.key2 and import.key3, respectively indicating the language information generated by the server according to the request information to perform business processing, so as to form user-readable display content; here, the same group code needs to be set for the three resource identifiers and the group sequence number needs to be set in order from small to large. At the same time, when exporting resource files to developers for translation, they also need to be exported in the format of group code and group serial number, that is, the resource identifiers of the same group need to be exported as a readable string: "A total of {} items were imported, and {} items failed". Similarly, when translating, they also need to be translated in this format, such as translating into Traditional Chinese: "A total of {} items were imported, and {} items failed". When the translated resource files are re-imported into the multilingual resource management platform, the strings can be automatically identified and split, and the split results can be automatically imported into the corresponding resource items for update.
[0104] Further, through Figure 2 In the language resource management interface shown, developers can also view, modify, delete, and other operations on resource items of single resource data; they can modify the structure of multi-level directories; they can search for resource data in the multi-language resource library by searching conditions such as directory name and resource code; they can also add resources, select resource import, export resources, and publish resources.
[0105] In this way, the multilingual resource management platform can achieve centralized and unified management of multilingual resource data, provide users with simple and easy-to-use international resource management functions, and have international support capabilities that are scalable, easy to maintain, and easy to modify.
[0106] See also Figure 3 , Figure 3The second flowchart of a method for implementing multilingual content provided in an embodiment of the present application. The implementation method is applied to a client, such as a WEB page, PC client, mobile APP, WeChat applet, etc.; the client includes a public component and a front-end service module corresponding to at least one microservice; the public component includes a target resource file corresponding to the target language used by the user; the target resource file is determined by a multilingual resource management platform for managing a multilingual resource library and published to the public component, and the public component can be a vue-i18n module. Figure 3 As shown in , the implementation method provided by the embodiment of the present application includes:
[0107] S301. In response to the user's triggering operation on the target microservice, the target front-end service module corresponding to the target microservice generates the user's request information and sends the request information to the server.
[0108] In this step, the client can also provide a visual interactive interface to interact with the user, and the user triggers a request to a target microservice through the interactive interface. The target front-end service module corresponding to the target microservice responds to the user operation, generates request information and sends it to the back-end business module corresponding to the target microservice in the server.
[0109] S302: The target front-end service module receives the encoded character string generated by the server processing the request information, and calls the common component.
[0110] S303: The common component converts the encoded character string into display content corresponding to the target language according to the target resource file.
[0111] S304: The target front-end service module obtains and displays display content corresponding to the target language.
[0112] For steps S302 to S304, the server processes the request information according to the business logic to generate a coded string, and returns the coded string to the target front-end service module; the target front-end service module receives the coded string and calls the common component to convert the coded string into display content in the target language for display.
[0113] In a possible implementation, the encoded string includes a resource identifier to be converted and business data, and the resource identifier to be converted can be converted into display content in different languages to indicate language information generated by the server when performing business processing according to the request information; the business data indicates numerical information generated by the server when performing business processing according to the request information; then step S303 may include: parsing the resource identifier to be converted and the business data from the encoded string according to the identifier of the resource identifier; searching for the display content corresponding to the resource identifier to be converted from the target resource file; combining the display content corresponding to the resource identifier to be converted and the business data to obtain the display content corresponding to the target language.
[0114] Here, as mentioned above, a single information resource identifier is enclosed in a specific identifier, such as ${}, to distinguish between the resource identifier and the business data; therefore, the common component can parse the resource identifier and business data to be converted from the encoded string according to the identifier of the resource identifier, and then find the display content corresponding to each resource identifier to be converted in the target resource file, and combine the display content and business data corresponding to the resource identifier in the order of their relative positions in the encoded string to obtain the display content corresponding to the target language.
[0115] Because the server directly returns the encoded string corresponding to the content to be displayed, in order to obtain display content that the user can understand, the display method of the client page needs to be modified, including replacing the resource identifier returned by the server with the display content in the language used by the current user for display, and also including transforming the text, pictures and other information originally displayed on the page into corresponding resource identifiers and displaying them using the display content in the language used by the current user.
[0116] Specifically, the page of the front-end service module in the client needs to modify the display information, modify the original information displayed on the page in the prior art to the resource identifier, and then find the display content corresponding to the resource identifier through the internationalization module interface of the public component for conversion. As for the resource identifier in the encoded string returned by the server, it also needs to be converted into the display content of the language used by the current user for display. In addition, in the process of modifying the display method of the client page, it is necessary to record the resource directory, resource identifier and corresponding Chinese information so that this information can be entered into the multilingual resource management platform.
[0117] In this way, based on the resource identifiers exchanged between the client and the server, the display content in different target languages is obtained by searching the resource files for conversion. When the display content needs to be added, modified, deleted, or other maintenance operations, only the resource data of the corresponding language needs to be added, modified, deleted, or other corresponding operations need to be performed in the multilingual resource management platform, while the resource identifiers exchanged between the client and the server can remain unchanged, thereby avoiding a lot of maintenance work on the client program.
[0118] See also Figure 4 , Figure 4 The third flowchart of a method for implementing multilingual content provided in an embodiment of the present application. The implementation method is applied to a server, and the server includes at least one backend business module corresponding to a microservice. Figure 4 As shown in , the implementation method provided by the embodiment of the present application includes:
[0119] S401. In response to a request message sent by a client, a target backend business module corresponding to a target microservice requested by a user generates a coded string by processing the request message.
[0120] S402, the target backend business module sends the encoded string to the client, so that the client converts the encoded string into display content corresponding to the target language according to the target resource file and displays it; wherein the target language is the language used by the user; the target resource file is determined by a multilingual resource management platform for managing a multilingual resource library according to the target language and published to the client.
[0121] Similarly, for steps S401 and S402, unlike the prior art, the server in the embodiment of the present application returns not specific display information but a coded string, so it is necessary to modify the service function of the server so that the original location of the returned text information is changed to the returned resource identifier. Specifically, the text information such as the prompt returned by the server interface to the client is modified to return the resource identifier, and the coded string is obtained by combining it with the service data. During the modification process, it is also necessary to record the resource directory, resource identifier and the corresponding Chinese information so that this information can be entered into the multilingual resource management platform.
[0122] In this way, according to the resource identifiers to be converted that are exchanged between the client and the server, the display content in different target languages is obtained by searching the resource files for conversion, so that when the display content needs to be added, modified, deleted, or other maintenance operations, only the corresponding operations such as adding, modifying, and deleting the resource data of the corresponding language need to be performed in the multilingual resource management platform, while the resource identifiers exchanged between the client and the server can remain unchanged, thereby avoiding a lot of maintenance work on the server program. In addition, the server no longer needs to maintain resource files to determine the display content in different languages. It only needs to return the encoded string to the client, that is, hand over the interface presentation to the client for processing, and the server can focus more on business processing.
[0123] Furthermore, the embodiment of the present application also provides a method for implementing multilingual content, which is applied to a multilingual implementation system; the multilingual implementation system includes a multilingual resource management platform, a client and a server; the multilingual resource management platform is used to manage a multilingual resource library; the implementation method includes: the multilingual resource management platform determines the user's login status according to the user login information sent by the client; the multilingual resource management platform uses a judgment strategy corresponding to the login status to determine the target language used by the user; the multilingual resource management platform extracts resource data corresponding to the target language from the multilingual resource library; wherein the multilingual resource library pre-stores resource data corresponding to multiple languages; the resource data corresponding to each language includes the multilingual resource library. The display content corresponding to each resource identifier set by the source library in the language; each resource identifier can be converted into display content in different languages based on resource data to indicate language information; the multilingual resource management platform publishes the resource data corresponding to the target language in the multilingual resource library to the public component of the client to obtain the target resource file; in response to the user's triggering operation on the target microservice, the client generates the user's request information and sends the request information to the server; the server processes the request information to generate an encoded string and sends the encoded string to the client; wherein the encoded string includes the resource identifier to be converted; the client converts the encoded string into the display content corresponding to the target language according to the target resource file and displays it.
[0124] For further information, see Figure 5 , Figure 5 This is an architecture diagram of a multi-language implementation system provided in an embodiment of the present application. Figure 5 As shown, the multi-language implementation system includes a multi-language resource management platform, a client and a server; under the microservice architecture, the client includes public components and front-end service modules corresponding to the microservices, and the server includes back-end business modules corresponding to the microservices.
[0125] Among them, the multilingual resource management platform can provide unified international resource management functions and unified international resource interfaces, providing users with simple and easy-to-use international resource management functions. During operation, they can modify and add resource files at any time as needed, and provide international support for related functions (such as menu management, code management, etc.), and provide a unified resource interface for client public components to facilitate the front-end to obtain international resources. The multilingual resource management platform is bound to the multilingual resource data in the database through the resource binding pool.
[0126] The client common component provides unified resource data retrieval, internationalization analysis and other functions for the client's internationalized interface display, and provides an internationalized resource acquisition interface for the client's front-end service module page.
[0127] The backend program in the backend business module directly returns the encoded string in response to the request information sent by the frontend service module; after receiving the encoded string, the frontend service module converts the encoded string into the local language information used by the current user for display by calling the internationalization module of the public component, thereby enabling the entire data middle platform to have comprehensive, scalable, easy-to-maintain, and easy-to-modify internationalization support capabilities at the lowest cost.
[0128] See also Figure 6 , Figure 6 This is one of the structural diagrams of a multilingual content implementation device provided in an embodiment of the present application. The implementation device 600 is applied to a multilingual resource management platform, and the multilingual resource management platform is used to manage a multilingual resource library; Figure 6 As shown in , the implementation device 600 includes:
[0129] The login determination module 610 determines the user's login status according to the user login information sent by the client;
[0130] A language determination module 620, using a determination strategy corresponding to the login status to determine a target language used by the user;
[0131] Extraction module 630, extracting resource data corresponding to the target language from the multilingual resource library; wherein the multilingual resource library pre-stores resource data corresponding to multiple languages; the resource data corresponding to each language includes display content corresponding to each resource identifier set by the multilingual resource library in the language; each resource identifier can be converted into display content in a different language based on the resource data to indicate language information;
[0132] The publishing module 640 publishes the resource data corresponding to the target language in the multilingual resource library to the client to obtain a target resource file, so that the client converts the encoded string into the display content corresponding to the target language according to the target resource file and displays it; wherein the encoded string includes the resource identifier to be converted; the encoded string is determined by the server according to the request information sent by the client and returned to the client.
[0133] Furthermore, when the login determination module 610 uses the judgment strategy corresponding to the login status to determine the target language used by the user, the login determination module 610 is used to:
[0134] When the login status is that the user has logged in, determining whether the user has set the target language according to the user login information;
[0135] If the user has not set the target language, determining whether organizations at all levels associated with the user have set the target language;
[0136] If the organizations at all levels associated with the user have not set the target language, or when the login status is that the user is not logged in, determine the current language used by the client according to the user login information, and determine whether the multiple languages involved in the multilingual resource library include the current language used by the client;
[0137] If the current language used by the client is not included, determining whether the multilingual resource management platform has been set with a configuration language;
[0138] If the multilingual resource management platform does not have a configuration language set, determining the current language used by the operating system where the server is located, and determining whether the multiple languages involved in the multilingual resource library include the current language used by the operating system where the server is located;
[0139] If the current language used by the operating system where the server is located is not included, the default language is determined as the target language used by the user.
[0140] Furthermore, the implementation device 600 further includes an import and export module; the import and export module is used to:
[0141] In response to an export operation by a developer, the resource data corresponding to the language selected by the developer is exported from the multi-language resource library; or,
[0142] In response to the developer's import operation, configuring the language corresponding to the resource data to be imported and importing the resource data to be imported into the multi-language resource library;
[0143] The original resource data of the corresponding language in the multilingual resource library is updated according to the imported resource data.
[0144] Furthermore, the implementation device 600 further includes a management module; the management module is used to:
[0145] Form a multi-level directory according to the microservice structure in the client and the server;
[0146] The resource data in the multi-language resource library is managed and organized in the form of the multi-level directory; wherein each resource data under the last level directory of the multi-level directory includes a resource identifier, a resource code and display content corresponding to each language.
[0147] See also Figure 7 , Figure 7 The second structural diagram of a multilingual content implementation device provided in an embodiment of the present application. The implementation device 700 is applied to a client, and the client includes a common component and a front-end service module corresponding to at least one microservice; the common component includes a target resource file corresponding to the target language used by the user; the target resource file is determined by a multilingual resource management platform for managing a multilingual resource library and published to the common component; the implementation device 700 includes:
[0148] The first sending module 710, in response to the user's triggering operation on the target microservice, the target front-end service module corresponding to the target microservice generates the user's request information and sends the request information to the server;
[0149] Invoking module 720, the target front-end service module receives the encoded string generated by the server processing the request information, and calls the common component;
[0150] Conversion module 730, the common component converts the encoded string into display content corresponding to the target language according to the target resource file;
[0151] Display module 740, the target front-end service module obtains and displays the display content corresponding to the target language.
[0152] See also Figure 8 , Figure 8 The third structural diagram of a multilingual content implementation device provided in the embodiment of the present application. The implementation device 800 is applied to a server, and the server includes at least one backend business module corresponding to a microservice; Figure 8 As shown in , the implementation device 800 includes:
[0153] The generation module 810 generates a coded string by processing the request information sent by the client and the target backend business module corresponding to the target microservice requested by the user in response to the request information sent by the client;
[0154] The second sending module 820, the target back-end business module sends the encoded string to the client, so that the client converts the encoded string into display content corresponding to the target language according to the target resource file and displays it; wherein the target language is the language used by the user; the target resource file is determined by a multilingual resource management platform for managing a multilingual resource library according to the target language and published to the client.
[0155] See also Fig. 9 , Fig. 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig. 9 As shown in , the electronic device 900 includes a processor 910 , a memory 920 and a bus 930 .
[0156] The memory 920 stores machine-readable instructions executable by the processor 910. When the electronic device 900 is running, the processor 910 communicates with the memory 920 via the bus 930. When the machine-readable instructions are executed by the processor 910, the above-mentioned Figure 1 , Figure 3 and Figure 4 The steps of a method for implementing multilingual content in the method embodiment shown are described in detail in the method embodiment, and will not be described in detail here.
[0157] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 , Figure 3 and Figure 4 The steps of a method for implementing multilingual content in the method embodiment shown are described in detail in the method embodiment, and will not be described in detail here.
[0158] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0159] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0160] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0161] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0162] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0163] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for implementing multilingual content, characterized in that: The implementation method is applied to a multilingual resource management platform, which is used to manage a multilingual resource library; the implementation method includes: Determine the user's login status based on the user login information sent by the client; Determine the target language used by the user using a judgment strategy corresponding to the login status; Extracting resource data corresponding to the target language from the multilingual resource library; wherein the multilingual resource library pre-stores resource data corresponding to multiple languages; the resource data corresponding to each language includes display content corresponding to each resource identifier set by the multilingual resource library in the language; each resource identifier can be converted into display content in a different language based on the resource data to indicate language information; The resource data corresponding to the target language is published to the client to obtain a target resource file, so that the client converts the coded string into the display content corresponding to the target language according to the target resource file and displays it; wherein the coded string includes the resource identifier and business data to be converted; the coded string is determined by the server according to the request information sent by the client and returned to the client; The client converts the encoded string into display content corresponding to the target language according to the target resource file and displays it in the following manner: Parsing the resource identifier and the business data to be converted from the encoded character string according to the identifier of the resource identifier; Finding the display content corresponding to the resource identifier to be converted from the target resource file; Combining the display content corresponding to the resource identifier to be converted and the business data in order of relative positions in the encoded character string to obtain the display content corresponding to the target language; The multilingual resource management platform is used to manage the multilingual resource library in the following ways: A multi-level directory is formed according to the microservice structure in the client and the server; the levels of the directory include the subsystems included in the client and the server, the microservice modules included in each subsystem, and the service functions provided by each microservice module; The resource data in the multi-language resource library are managed and organized in the form of the multi-level directory; wherein each resource data under the last level directory of the multi-level directory includes a resource identifier, a resource code, and display content corresponding to each language; when a display information contains multiple resource identifiers, each resource data of the resource file also includes a group code and an intra-group serial number; multiple resource identifiers are grouped together through the group code and an intra-group serial number is set.
2. The implementation method according to claim 1, characterized in that: The using a judgment strategy corresponding to the login status to determine the target language used by the user includes: When the login status is that the user has logged in, determining whether the user has set the target language according to the user login information; If the user has not set the target language, determining whether organizations at all levels associated with the user have set the target language; If the organizations at all levels associated with the user have not set the target language, or when the login status is that the user is not logged in, determine the current language used by the client according to the user login information, and determine whether the multiple languages involved in the multilingual resource library include the current language used by the client; If the current language used by the client is not included, determining whether the multilingual resource management platform has been set with a configuration language; If the multilingual resource management platform does not have a configuration language set, determining the current language used by the operating system where the server is located, and determining whether the multiple languages involved in the multilingual resource library include the current language used by the operating system where the server is located; If the current language used by the operating system where the server is located is not included, the default language is determined as the target language used by the user.
3. The implementation method according to claim 1, characterized in that: The multilingual resource management platform is used to manage the multilingual resource library in the following ways: In response to an export operation by a developer, the resource data corresponding to the language selected by the developer is exported from the multi-language resource library; or, In response to the developer's import operation, configuring the language corresponding to the resource data to be imported and importing the resource data to be imported into the multi-language resource library; The original resource data of the corresponding language in the multilingual resource library is updated according to the imported resource data.
4. A method for implementing multilingual content, characterized in that: The implementation method is applied to a client, the client comprising a common component and a front-end service module corresponding to at least one microservice; the common component comprises a target resource file corresponding to the target language used by the user; The target resource file is determined by a multilingual resource management platform for managing a multilingual resource library and published to the public component; The implementation method includes: In response to the user's triggering operation on the target microservice, the target front-end service module corresponding to the target microservice generates the user's request information and sends the request information to the server; The target front-end service module receives the encoded string generated by the server processing the request information, and calls the common component; The common component converts the encoded string into display content corresponding to the target language according to the target resource file; The target front-end service module obtains and displays the display content corresponding to the target language; The encoded string includes a resource identifier and business data to be converted; the common component converts the encoded string into display content corresponding to the target language according to the target resource file, including: Parsing the resource identifier and the business data to be converted from the encoded character string according to the identifier of the resource identifier; Finding the display content corresponding to the resource identifier to be converted from the target resource file; Combining the display content corresponding to the resource identifier to be converted and the business data in order of relative positions in the encoded character string to obtain the display content corresponding to the target language; The multilingual resource management platform is used to manage the multilingual resource library in the following ways: A multi-level directory is formed according to the microservice structure in the client and the server; the levels of the directory include the subsystems included in the client and the server, the microservice modules included in each subsystem, and the service functions provided by each microservice module; The resource data in the multi-language resource library are managed and organized in the form of the multi-level directory; wherein each resource data under the last level directory of the multi-level directory includes a resource identifier, a resource code, and display content corresponding to each language; when a display information contains multiple resource identifiers, each resource data of the resource file also includes a group code and an intra-group serial number; multiple resource identifiers are grouped together through the group code and an intra-group serial number is set.
5. The implementation method according to claim 4, characterized in that: The resource identifier to be converted can be converted into display content in different languages to indicate language information generated by the server when performing business processing according to the request information; the business data indicates numerical information generated by the server when performing business processing according to the request information.
6. A method for implementing multilingual content, characterized in that: The implementation method is applied to a server, and the server includes at least one backend business module corresponding to a microservice; the implementation method includes: In response to the request information sent by the client, the target backend business module corresponding to the target microservice requested by the user generates a coded string by processing the request information; The target backend business module sends the encoded string to the client, so that the client converts the encoded string into display content corresponding to the target language according to the target resource file and displays it; wherein the target language is the language used by the user; the target resource file is determined by a multilingual resource management platform for managing a multilingual resource library according to the target language and published to the client; The encoded string includes the resource identifier and business data to be converted; the client converts the encoded string into display content corresponding to the target language according to the target resource file and displays it in the following manner: Parsing the resource identifier and the business data to be converted from the encoded character string according to the identifier of the resource identifier; Finding the display content corresponding to the resource identifier to be converted from the target resource file; Combining the display content corresponding to the resource identifier to be converted and the business data in order of relative positions in the encoded character string to obtain the display content corresponding to the target language; The multilingual resource management platform is used to manage the multilingual resource library in the following ways: A multi-level directory is formed according to the microservice structure in the client and the server; the levels of the directory include the subsystems included in the client and the server, the microservice modules included in each subsystem, and the service functions provided by each microservice module; The resource data in the multi-language resource library are managed and organized in the form of the multi-level directory; wherein each resource data under the last level directory of the multi-level directory includes a resource identifier, a resource code, and display content corresponding to each language; when a display information contains multiple resource identifiers, each resource data of the resource file also includes a group code and an intra-group serial number; multiple resource identifiers are grouped together through the group code and an intra-group serial number is set.
7. A method for implementing multilingual content, characterized in that: The implementation method is applied to a multi-language implementation system; the multi-language implementation system includes a multi-language resource management platform, a client and a server; the multi-language resource management platform is used to manage a multi-language resource library; the implementation method includes: The multilingual resource management platform determines the user's login status according to the user login information sent by the client; The multilingual resource management platform determines the target language used by the user using a judgment strategy corresponding to the login status; The multilingual resource management platform extracts resource data corresponding to the target language from the multilingual resource library; wherein the multilingual resource library pre-stores resource data corresponding to multiple languages; the resource data corresponding to each language includes display content corresponding to each resource identifier set by the multilingual resource library in the language; each resource identifier can be converted into display content in different languages based on the resource data to indicate language information; The multilingual resource management platform publishes the resource data corresponding to the target language in the multilingual resource library to the public component of the client to obtain the target resource file; In response to the user's triggering operation on the target microservice, the client generates request information of the user and sends the request information to the server; The server processes the request information to generate a coded string, and sends the coded string to the client; wherein the coded string includes a resource identifier and business data to be converted; The client converts the encoded string into display content corresponding to the target language according to the target resource file and displays the content, specifically: Parsing the resource identifier and the business data to be converted from the encoded character string according to the identifier of the resource identifier; Finding the display content corresponding to the resource identifier to be converted from the target resource file; Combining the display content corresponding to the resource identifier to be converted and the business data in order of relative positions in the encoded character string to obtain the display content corresponding to the target language; The multilingual resource management platform is used to manage the multilingual resource library in the following ways: A multi-level directory is formed according to the microservice structure in the client and the server; the levels of the directory include the subsystems included in the client and the server, the microservice modules included in each subsystem, and the service functions provided by each microservice module; The resource data in the multi-language resource library are managed and organized in the form of the multi-level directory; wherein each resource data under the last level directory of the multi-level directory includes a resource identifier, a resource code, and display content corresponding to each language; when a display information contains multiple resource identifiers, each resource data of the resource file also includes a group code and an intra-group serial number; multiple resource identifiers are grouped together through the group code and an intra-group serial number is set.
8. A device for implementing multilingual content, characterized in that: The implementation device is applied to a multilingual resource management platform, and the multilingual resource management platform is used to manage a multilingual resource library; the implementation device includes: A login determination module determines the user's login status based on the user login information sent by the client; A language determination module, using a judgment strategy corresponding to the login status to determine the target language used by the user; An extraction module extracts resource data and business data corresponding to the target language from the multilingual resource library; wherein the multilingual resource library pre-stores resource data corresponding to multiple languages; the resource data corresponding to each language includes display content corresponding to each resource identifier set by the multilingual resource library in the language; each resource identifier can be converted into display content in different languages based on the resource data to indicate language information; A publishing module publishes the resource data corresponding to the target language in the multilingual resource library to the client to obtain a target resource file, so that the client converts the coded string into the display content corresponding to the target language according to the target resource file and displays it; wherein the coded string includes the resource identifier to be converted; the coded string is determined by the server according to the request information sent by the client and returned to the client; The client converts the encoded string into display content corresponding to the target language according to the target resource file and displays it in the following manner: Parsing the resource identifier and the business data to be converted from the encoded character string according to the identifier of the resource identifier; Finding the display content corresponding to the resource identifier to be converted from the target resource file; Combining the display content corresponding to the resource identifier to be converted and the business data in order of relative positions in the encoded character string to obtain the display content corresponding to the target language; The multilingual resource management platform is used to manage the multilingual resource library in the following ways: A multi-level directory is formed according to the microservice structure in the client and the server; the levels of the directory include the subsystems included in the client and the server, the microservice modules included in each subsystem, and the service functions provided by each microservice module; The resource data in the multi-language resource library are managed and organized in the form of the multi-level directory; wherein each resource data under the last level directory of the multi-level directory includes a resource identifier, a resource code, and display content corresponding to each language; when a display information contains multiple resource identifiers, each resource data of the resource file also includes a group code and an intra-group serial number; multiple resource identifiers are grouped together through the group code and an intra-group serial number is set.
9. A device for implementing multilingual content, characterized in that: The implementation device is applied to a client, and the client includes a common component and a front-end service module corresponding to at least one microservice; the common component includes a target resource file corresponding to the target language used by the user; The target resource file is determined by a multilingual resource management platform for managing a multilingual resource library and published to the public component; The implementation device comprises: A first sending module, in response to the user's triggering operation on the target microservice, a target front-end service module corresponding to the target microservice generates the user's request information and sends the request information to the server; A calling module, wherein the target front-end service module receives the encoded string generated by the server processing the request information and calls the common component; A conversion module, the common component converts the encoded string into display content corresponding to the target language according to the target resource file; Display module, the target front-end service module obtains and displays the display content corresponding to the target language; The encoded string includes the resource identifier and business data to be converted; the common component converts the encoded string into display content corresponding to the target language according to the target resource file in the following manner: Parsing the resource identifier and the business data to be converted from the encoded character string according to the identifier of the resource identifier; Finding the display content corresponding to the resource identifier to be converted from the target resource file; Combining the display content corresponding to the resource identifier to be converted and the business data in order of relative positions in the encoded character string to obtain the display content corresponding to the target language; The multilingual resource management platform is used to manage the multilingual resource library in the following ways: A multi-level directory is formed according to the microservice structure in the client and the server; the levels of the directory include the subsystems included in the client and the server, the microservice modules included in each subsystem, and the service functions provided by each microservice module; The resource data in the multi-language resource library are managed and organized in the form of the multi-level directory; wherein each resource data under the last level directory of the multi-level directory includes a resource identifier, a resource code, and display content corresponding to each language; when a display information contains multiple resource identifiers, each resource data of the resource file also includes a group code and an intra-group serial number; multiple resource identifiers are grouped together through the group code and an intra-group serial number is set.
10. A device for implementing multilingual content, characterized in that: The implementation device is applied to a server, and the server includes at least one backend business module corresponding to a microservice; the implementation device includes: A generation module, in response to the request information sent by the client, a target backend business module corresponding to the target microservice requested by the user generates a coded string by processing the request information; The second sending module, the target backend business module sends the encoded string to the client, so that the client converts the encoded string into display content corresponding to the target language according to the target resource file and displays it; wherein the target language is the language used by the user; the target resource file is determined by the multilingual resource management platform for managing the multilingual resource library according to the target language and published to the client; The encoded string includes the resource identifier and business data to be converted; the client converts the encoded string into display content corresponding to the target language according to the target resource file and displays it in the following manner: Parsing the resource identifier and the business data to be converted from the encoded character string according to the identifier of the resource identifier; Finding the display content corresponding to the resource identifier to be converted from the target resource file; Combining the display content corresponding to the resource identifier to be converted and the business data in order of relative positions in the encoded character string to obtain the display content corresponding to the target language; The multilingual resource management platform is used to manage the multilingual resource library in the following ways: A multi-level directory is formed according to the microservice structure in the client and the server; the levels of the directory include the subsystems included in the client and the server, the microservice modules included in each subsystem, and the service functions provided by each microservice module; The resource data in the multi-language resource library are managed and organized in the form of the multi-level directory; wherein each resource data under the last level directory of the multi-level directory includes a resource identifier, a resource code, and display content corresponding to each language; when a display information contains multiple resource identifiers, each resource data of the resource file also includes a group code and an intra-group serial number; multiple resource identifiers are grouped together through the group code and an intra-group serial number is set.
