Plug-in information translation method and device, computer equipment and storage medium
By using multi-language libraries in the cloud platform to find and load target translation files, the problem of language incompatibility of third-party plug-ins integrated into the cloud platform is solved, multi-language adaptation of plug-ins is realized, and user experience and product ease of use are improved.
Patent Information
- Application Number
- CN202410831950.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-09-24
AI Technical Summary
Most of the third-party plug-ins integrated with the cloud platform only support the English version, causing users in different regions to be unable to accurately understand the plug-in functions due to language incompatibility, affecting the user experience.
When the language type supported by the cloud platform is the target language type, the matching target translation file is found through the multi-language library, the target plug-in is loaded and its properties are determined, and the target translation information is displayed based on the translation file to achieve multi-language adaptation of the plug-in. .
It reduces the difficulty for users to understand the functions of third-party plug-ins, reduces mental overhead, enhances the ease of use and user experience of the product, and ensures that plug-ins can clearly express functions in different language environments.
Smart Images

Figure CN118690760A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cloud platforms, and in particular to a method, device, computer equipment and storage medium for translating plug-in information. Background Art
[0002] With the continuous development of cloud platforms, a large number of open source third-party plug-ins will be integrated in the development process of cloud platforms. In order to lay a foundation for the promotion of cloud platform products at home and abroad, the third-party plug-ins integrated by the cloud platform need to support multi-language adaptation.
[0003] Currently, third-party plug-ins integrated into the cloud platform have not been adapted, and most third-party plug-ins only support English versions. Since English versions of third-party plug-ins are highly professional and contain uncommon words, and different users in different regions have different understandings of the literal meaning of the same function in English, it is more difficult for users to accurately understand the functions provided by third-party plug-ins, affecting the user experience. Summary of the invention
[0004] In view of this, the present invention provides a method, apparatus, computer device and storage medium for translating plug-in information to solve the problem that users cannot accurately understand the functions provided by third-party plug-ins due to language mismatch of the third-party plug-ins.
[0005] In a first aspect, the present invention provides a method for translating plug-in information, the method comprising: when the language type currently supported by the cloud platform is the target language type, searching a target translation file matching the target language type in a multi-language library, the target translation file comprising multiple plug-in modules corresponding to multiple plug-ins, each plug-in module comprising at least one plug-in attribute and translation information of the target language type of each plug-in attribute, the multi-language library comprising translation files of multiple language types; receiving a loading operation of a user on a page of the cloud platform; in response to the loading operation, loading a target plug-in, determining a target attribute of a target number corresponding to the target plug-in, the target plug-in being one of the multiple plug-ins; based on the target translation file, determining target translation information of the target attribute of the target number; and displaying the target translation information on the page of the cloud platform.
[0006] Based on the method provided in the first aspect above, when the language type currently supported by the cloud platform is the target language type, a target translation file matching the target language type can be searched in the multi-language library, and a loading operation of the user on the page of the cloud platform can be received; in response to the loading operation, a target plug-in is loaded, and the target attributes of the target quantity corresponding to the target plug-in are determined, and based on the target translation file, the target translation information of the target attributes of the target quantity is determined and displayed on the page of the cloud platform.
[0007] During the process of loading the target plug-in, the target attribute of the target quantity corresponding to the target plug-in can be determined, and the target translation file matches the language type currently supported by the cloud platform. The target translation file includes the target translation information of the target attribute of the target plug-in. Therefore, it can be determined that the translation information of the target plug-in information is consistent with the language type currently supported by the cloud platform. Thus, the cloud platform's target plug-in is adapted to multiple languages, ensuring that the cloud platform can clearly express the functions provided by the target plug-in in different language type environments using the professional terms of the current language type, thereby reducing the difficulty for users to accurately understand the functions provided by third-party plug-ins, reducing the user's mental overhead, enhancing the overall usability of the product, and improving the user experience.
[0008] In an optional embodiment, in response to a loading operation, a target plug-in is loaded, and a target attribute of a target quantity corresponding to the target plug-in is determined, including: in response to the loading operation, determining a target plug-in to be loaded; loading the target plug-in and obtaining a target plug-in object corresponding to the target plug-in; obtaining a target attribute of a target quantity that needs to be translated by the target plug-in from the target plug-in object, the target attribute being an attribute bound to a Document Object Model (DOM) tree of a target plug-in module corresponding to the target plug-in; wherein, loading the target plug-in and obtaining the loaded target plug-in object includes: loading the target plug-in through a loading function on a page of a cloud platform; after loading the target plug-in, traversing the DOM tree corresponding to the target plug-in module, and obtaining the target plug-in object through a callback function provided by the loading function; or, synchronously loading a page of a cloud platform and a target plug-in, the target plug-in is provided with a ref attribute, the cloud platform has a refs attribute, and the refs attribute is used to obtain the target plug-in object of the target plug-in holding the ref attribute.
[0009] Based on the above method, during the process of loading the target plug-in, the target plug-in object corresponding to the target plug-in can be obtained by loading the function or setting the ref attribute in the target plug-in, and then the target attribute of the target quantity that the target plug-in needs to translate can be determined, so as to facilitate the subsequent translation of the target attribute.
[0010] In an optional implementation, when the language type currently supported by the cloud platform is the target language type, searching for a target translation file that matches the target language type in the multi-language library includes: when the language type currently supported by the cloud platform is the target language type, loading a variable whose language type is the target language type from a link address of the multi-language library to obtain the target translation file.
[0011] Based on the above method, the target translation file corresponding to the language type currently supported by the cloud platform can be obtained from the multi-language library, so as to facilitate the subsequent determination of the translation text required by the target plug-in from the target translation file.
[0012] In an optional implementation, based on a target translation file, target translation information of a target number of target attributes is determined, including: obtaining a name of a target plug-in; according to the name of the target plug-in, determining from the target translation file a plug-in module that is consistent with the name of the target plug-in as a target plug-in module, the target plug-in module including at least one plug-in attribute and translation information of a target language type of at least one plug-in attribute; and filtering out target translation information of a target number of target attributes from the translation information of the target language type of at least one plug-in attribute.
[0013] Based on the above method, a target plug-in module having the same name as the target plug-in can be determined from the target translation file, and then target translation information of the target attribute of the target quantity of the target plug-in can be determined to translate the target plug-in.
[0014] In an optional implementation, the file format of multiple translation files in the multi-language library is JSON format; at least one plug-in attribute of each plug-in in each translation file, and translation information of multiple language types of each plug-in attribute are stored in an array.
[0015] Based on the above method, the multi-language library may include multiple translation files in JSON format, each translation file includes multiple arrays to store at least one plug-in attribute and multiple translation information corresponding to each plug-in attribute.
[0016] In an optional implementation, multiple language types required by the cloud platform are obtained; at least one plug-in attribute of each of the multiple plug-ins and translation information of multiple language types of each plug-in attribute are obtained; each plug-in module of each language type corresponding to each plug-in is generated based on at least one plug-in attribute of each plug-in and translation information of each language type of each plug-in attribute; a translation file of each language type is generated based on the multiple plug-in modules of each language type to obtain translation files of multiple language types; and a multi-language library is generated based on the translation files of the multiple language types.
[0017] Based on the above method, a multi-language library can be generated to provide translation files of multiple language types for the plug-in.
[0018] In an optional implementation, a global variable corresponding to a page of the cloud platform is accessed to obtain a language type currently supported by the cloud platform as the target language type.
[0019] Based on the above method, the language type currently supported by the cloud platform can be obtained, so as to determine the translation information that the target plug-in needs to be translated into consistent with the target language type.
[0020] In a second aspect, the present invention provides a translation device for plug-in information, a processing module, which is used to search for a target translation file matching the target language type in a multi-language library when the language type currently supported by the cloud platform is the target language type, the target translation file including multiple plug-in modules corresponding to multiple plug-ins, each plug-in module including at least one plug-in attribute and translation information of the target language type of each plug-in attribute, and the multi-language library including translation files of multiple language types; a transceiver module, which is used to receive a loading operation of a user on a page of the cloud platform; the processing module, which is also used to load a target plug-in in response to the loading operation, and determine a target attribute of a target number corresponding to the target plug-in, the target plug-in being one of the multiple plug-ins; the processing module, which is also used to determine the target translation information of the target attribute of the target number based on the target translation file; and the display module, which is also used to display the target translation information on the page of the cloud platform.
[0021] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for translating plug-in information of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0022] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the plug-in information translation method of the first aspect or any corresponding embodiment thereof.
[0023] In a fifth aspect, the present invention provides a computer program product, including computer instructions, which are used to enable a computer to execute the plug-in information translation method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 is a flowchart of a method for translating plug-in information according to an embodiment of the present invention;
[0026] Figure 2 is a schematic diagram of a multi-language library according to an embodiment of the present invention;
[0027] Figure 3 is a structural block diagram of a device for translating plug-in information according to an embodiment of the present invention;
[0028] Figure 4 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0030] As described in the background technology, a large number of open source third-party plug-ins are integrated during the development of the cloud platform to efficiently develop requirements and avoid reinventing the wheel. At the same time, in order to lay the foundation for the promotion of cloud platform products at home and abroad, the product has been adapted to support multiple languages. Existing third-party plug-ins only support English versions, which may cause users to be unable to accurately understand the functions provided by third-party plug-ins due to language incompatibility.
[0031] In order to solve the above technical problems, an embodiment of the present invention provides a method for translating plug-in information, which includes: when the language type currently supported by the cloud platform is the target language type, searching for a target translation file matching the target language type in a multi-language library, the target translation file includes multiple plug-in modules corresponding to multiple plug-ins, each plug-in module includes at least one plug-in attribute and translation information of the target language type of each plug-in attribute, and the multi-language library includes translation files of at least one language type; receiving a loading operation of a user on a page of the cloud platform; in response to the loading operation, loading a target plug-in, determining a target attribute of a target number corresponding to the target plug-in, the target plug-in being one of the multiple plug-ins; based on the target translation file, determining the target translation information of the target attribute of the target number; displaying the target translation information on the page of the cloud platform. This method can solve the problem that users cannot accurately understand the functions provided by third-party plug-ins due to the language incompatibility of the third-party plug-ins.
[0032] In an embodiment of the present application, the above method can be executed by a cloud platform (hereinafter also referred to as a translation device for plug-in information). The translation device for plug-in information can be any device with computing capabilities. It is understandable that the device also has a display page. Exemplarily, the translation device for plug-in information can be a front-end application implemented based on the vue framework, including but not limited to handheld devices (such as mobile phones or tablets, etc.), vehicle-mounted devices, wearable devices, virtual reality (VR) terminal devices, augmented reality (AR) terminal devices, etc. The translation device for plug-in information can also be called user equipment (UE), without limitation.
[0033] According to an embodiment of the present invention, an embodiment of a method for translating plug-in information is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0034] In this embodiment, a plug-in information translation method is provided, which can be used in the plug-in information translation device or cloud platform mentioned above. Figure 1 is a flow chart of a method for translating plug-in information according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0035] S101: When the language type currently supported by the cloud platform is the target language type, searching for a target translation file matching the target language type in the multi-language library.
[0036] The target translation file includes multiple plug-in modules corresponding to the multiple plug-ins, and each plug-in module includes at least one plug-in attribute and translation information of the target language type of each plug-in attribute.
[0037] In the embodiment of the present invention, the multi-language library includes translation files of multiple language types. The multiple language types can be determined according to the actual needs of the cloud platform without limitation. Figure 2 As shown, Figure 2 is a schematic diagram of a multi-language library according to an embodiment of the present invention. For example, the multiple language types may include Chinese, English, French, Arabic, etc. Among them, the file format of the multiple translation files in the multi-language library is JSON format. It can be understood that each translation file is a JS file.
[0038] In some optional implementations, when the language type currently supported by the cloud platform is the target language type, the cloud platform searches for a target translation file that matches the target language type in a multi-language library, including: when the language type currently supported by the cloud platform is the target language type, loading a variable whose language type is the target language type from a link address of the multi-language library to obtain the target translation file.
[0039] It is understandable that the language type of the target translation file is consistent with the language type currently supported by the cloud platform. For example, the language type currently supported by the cloud platform is Arabic, and the language type of the target translation file is also Arabic, that is, the translation information included in the target translation file is Arabic translation information.
[0040] In some optional implementations, the cloud platform accesses a global variable corresponding to a page of the cloud platform, and obtains a language type currently supported by the cloud platform as a target language type.
[0041] It is understandable that the target language type can be any language type. The language type displayed on the cloud platform page is the language type currently supported by the cloud platform.
[0042] S102: Receive a page loading operation from a user on the cloud platform.
[0043] The loading operation may be a click operation or a trigger operation of a user on a page of the cloud platform.
[0044] It is understandable that when a user needs to use a third-party plug-in or a target plug-in on the cloud platform, the user needs to click or trigger the loading of the third-party plug-in or the target plug-in on the page of the cloud platform.
[0045] S103: In response to the loading operation, a target plug-in is loaded, and a target attribute of a target quantity corresponding to the target plug-in is determined.
[0046] The target plug-in is one of the multiple plug-ins. The plug-ins in the embodiment of the present invention are all third-party plug-ins, for example, the third-party plug-in can be an editor plug-in, a browser plug-in, a social media plug-in, etc.
[0047] In some optional embodiments, the cloud platform loads the target plug-in in response to the loading operation, and determines the target attribute of the target quantity corresponding to the target plug-in, including: determining the target plug-in to be loaded in response to the loading operation; loading the target plug-in to obtain the target plug-in object corresponding to the target plug-in; and obtaining the target attribute of the target quantity that needs to be translated by the target plug-in from the target plug-in object.
[0048] Among them, the target attribute is the attribute bound to the file object model DOM tree of the target plug-in module corresponding to the target plug-in. It can be understood that the target attribute can be the control information on the page of the cloud platform corresponding to the target plug-in. For example, taking the target plug-in as an editor plug-in as an example, the target attribute can be the control information on the editor (for example, the control can be a delete, add, modify, etc. control).
[0049] In some optional implementations, the cloud platform loads the target plug-in to obtain the loaded target plug-in object, including: loading the target plug-in through a loading function on the cloud platform page; after loading the target plug-in, traversing the DOM tree corresponding to the target plug-in module, and obtaining the target plug-in object through a callback function provided by the loading function; or, synchronously loading the cloud platform page and the target plug-in, the target plug-in is set with a ref attribute, the cloud platform has a refs attribute, and the refs attribute is used to obtain the target plug-in object of the target plug-in holding the ref attribute.
[0050] Exemplarily, the cloud platform loads the target plug-in through a loading function (require function) at the location where the target plug-in needs to be loaded on the page of the cloud platform; after loading the target plug-in, traverse the DOM tree corresponding to the page that needs to be translated corresponding to the target plug-in module, and obtain the target plug-in object through a callback function (callback function) provided by the loading function; or, synchronously load the cloud platform page and the target plug-in, the target plug-in is set with a ref attribute, the cloud platform has a refs attribute, and the refs attribute is used to obtain the target plug-in object of the target plug-in holding the ref attribute.
[0051] The DOM tree includes multiple DOM elements, and each DOM element is a node in the target plug-in module file.
[0052] In the embodiment of the present invention, the ref attribute is used to register reference information for a DOM element or a child component (ie, a target plug-in). The reference information will be registered on the $refs object of the parent component (ie, the cloud platform).
[0053] S104: Determine target translation information of target attributes of a target quantity based on the target translation file.
[0054] In some optional embodiments, the cloud platform determines target translation information of a target number of target attributes based on a target translation file, including: obtaining the name of a target plug-in; according to the name of the target plug-in, determining from the target translation file a plug-in module that is consistent with the name of the target plug-in as a target plug-in module, the target plug-in module including at least one plug-in attribute and translation information of a target language type of at least one plug-in attribute; and filtering out target translation information of a target number of target attributes from the translation information of the target language type of at least one plug-in attribute.
[0055] The number of targets can be set according to the user's requirements for the target plug-in and is not limited. For example, the number of targets can be one or more.
[0056] Exemplarily, the cloud platform obtains the name of the target plug-in, and based on the name of the target plug-in, determines from the target translation file a plug-in module that is consistent with the name of the target plug-in as the target plug-in module; from the translation information of the target language type of at least one plug-in attribute, traverses at least one plug-in attribute to obtain target translation information of a target number of target attributes.
[0057] S105: Displaying the target translation information on the page of the cloud platform.
[0058] In some optional implementations, the cloud platform replaces the target attribute of the target quantity of the target plug-in with the target translation information, and displays the target translation information on a page of the cloud platform.
[0059] Based on the above S101-S105, when the language type currently supported by the cloud platform is the target language type, the cloud platform can search for a target translation file matching the target language type in the multi-language library, and receive a loading operation from the user on the page of the cloud platform; in response to the loading operation, load the target plug-in, determine the target attributes of the target quantity corresponding to the target plug-in, and based on the target translation file, determine the target translation information of the target attributes of the target quantity and display it on the page of the cloud platform.
[0060] During the process of loading the target plug-in, the target attribute of the target quantity corresponding to the target plug-in can be determined, and the target translation file matches the language type currently supported by the cloud platform. The target translation file includes the target translation information of the target attribute of the target plug-in. Therefore, it can be determined that the translation information of the target plug-in information is consistent with the language type currently supported by the cloud platform. Thus, the cloud platform's target plug-in is adapted to multiple languages, ensuring that the cloud platform can clearly express the functions provided by the target plug-in in different language type environments using the professional terms of the current language type, thereby reducing the difficulty for users to accurately understand the functions provided by third-party plug-ins, reducing the user's mental overhead, enhancing the overall usability of the product, and improving the user experience.
[0061] Optionally, the multi-language library can be a pre-generated language library. Figure 2 As shown, Figure 2 is a schematic diagram of a multi-language library according to an embodiment of the present invention.
[0062] exist Figure 2In the multi-language library shown, the multi-language library includes translation files corresponding to Chinese, translation files corresponding to English, and translation files of more language types. Among them, the translation files corresponding to Chinese include plug-in 1 module, plug-in 2 module, plug-in 3 module, and more plug-in modules of the Chinese language type; the plug-in 1 module of the Chinese language type includes attribute a, Chinese translation information of attribute a, attribute b, Chinese translation information of attribute a, and more attributes and Chinese translation information of attributes. The translation files corresponding to English include plug-in 1 module, plug-in 2 module, plug-in 3 module, and more plug-in modules of the English language type; the plug-in 1 module of the English language type includes attribute a, English translation information of attribute a, attribute b, English translation information of attribute a, and more attributes and English translation information of attributes.
[0063] In one example, a cloud platform obtains multiple language types required by the cloud platform; obtains at least one plug-in attribute of each plug-in among multiple plug-ins, and translation information of multiple language types of each plug-in attribute; generates each plug-in module of each language type corresponding to each plug-in based on at least one plug-in attribute of each plug-in and translation information of each language type of each plug-in attribute; generates a translation file of each language type based on the multiple plug-in modules of each language type, and obtains translation files of multiple language types; generates a multi-language library based on the translation files of multiple language types.
[0064] Among them, at least one plug-in attribute of each plug-in in each translation file in the multi-language library and translation information of multiple language types of each plug-in attribute are stored in an array.
[0065] It is understandable that the cloud platform can pre-generate a multi-language library including translation files of different language types, and provide translation files of multiple language types for multiple plug-ins.
[0066] In this embodiment, a device for translating plug-in information is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0067] This embodiment provides a plug-in information translation device, such as Figure 3 As shown, including:
[0068] The processing module 301 is used to search for a target translation file matching the target language type in the multi-language library when the language type currently supported by the cloud platform is the target language type. The target translation file includes multiple plug-in modules corresponding to multiple plug-ins, each plug-in module includes at least one plug-in attribute and translation information of the target language type of each plug-in attribute, and the multi-language library includes translation files of multiple language types.
[0069] The transceiver module 302 is used to receive a page loading operation from a user on the cloud platform.
[0070] The processing module 301 is further configured to load a target plug-in in response to a loading operation, and determine a target attribute of a target quantity corresponding to the target plug-in, where the target plug-in is one of the multiple plug-ins.
[0071] The processing module 301 is further configured to determine target translation information of target attributes of a target quantity based on the target translation file.
[0072] The display module 303 is also used to display the target translation information on the page of the cloud platform.
[0073] In some optional implementations, the processing module 301 is further specifically used to determine the target plug-in to be loaded in response to the loading operation; the processing module 301 is further specifically used to load the target plug-in and obtain the target plug-in object corresponding to the target plug-in; the processing module 301 is further specifically used to obtain the target attribute of the target quantity that needs to be translated by the target plug-in from the target plug-in object, and the target attribute is the attribute bound to the file object model DOM tree of the target plug-in module corresponding to the target plug-in.
[0074] The processing module 301 is also specifically used to load the target plug-in through the loading function on the page of the cloud platform; the processing module 301 is also specifically used to traverse the DOM tree corresponding to the target plug-in module after loading the target plug-in, and obtain the target plug-in object through the callback function provided by the loading function; or, the processing module 301 is also specifically used to synchronously load the page of the cloud platform and the target plug-in, the target plug-in is set with a ref attribute, the cloud platform has a refs attribute, and the refs attribute is used to obtain the target plug-in object of the target plug-in holding the ref attribute.
[0075] In some optional implementations, the processing module 301 is further specifically configured to load a variable of the target language type from a link address of the multi-language library to obtain a target translation file when the language type currently supported by the cloud platform is the target language type.
[0076] In some optional implementations, the processing module 301 is further specifically used to obtain the name of the target plug-in; the processing module 301 is further specifically used to determine, based on the name of the target plug-in, from the target translation file a plug-in module that is consistent with the name of the target plug-in as the target plug-in module, the target plug-in module including at least one plug-in attribute and translation information of the target language type of at least one plug-in attribute; the processing module 301 is further specifically used to filter out target translation information of a target number of target attributes from the translation information of the target language type of at least one plug-in attribute.
[0077] In some optional implementations, the file format of multiple translation files in the multi-language library is JSON format; at least one plug-in attribute of each plug-in in each translation file, and translation information of multiple language types of each plug-in attribute are stored in an array.
[0078] In some optional implementations, the transceiver module 302 is also used to obtain multiple language types required by the cloud platform; the transceiver module 302 is also used to obtain at least one plug-in attribute of each plug-in among multiple plug-ins, and translation information of multiple language types of each plug-in attribute; the processing module 301 is also used to generate each plug-in module of each language type corresponding to each plug-in based on at least one plug-in attribute of each plug-in and the translation information of each language type of each plug-in attribute; the processing module 301 is also used to generate a translation file of each language type based on multiple plug-in modules of each language type, and obtain translation files of multiple language types; the processing module 301 is also used to generate a multi-language library based on the translation files of multiple language types.
[0079] The further functional description of each of the above modules is the same as that of the above corresponding embodiments and will not be repeated here.
[0080] The plug-in information translation device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0081] The embodiment of the present invention also provides a computer device having the above Figure 3 The plugin information shown is the translation device.
[0082] See also Figure 4 , Figure 4 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 4As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 10 is taken as an example.
[0083] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0084] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0085] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0086] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0087] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.
[0088] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0089] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0090] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0091] Part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes but is not limited to source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0092] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for translating plug-in information, characterized in that: The method comprises: In the case where the language type currently supported by the cloud platform is the target language type, searching for a target translation file matching the target language type in a multi-language library, wherein the target translation file includes a plurality of plug-in modules corresponding to a plurality of plug-ins, each of the plug-in modules includes at least one plug-in attribute and translation information of the target language type of each of the plug-in attributes, and the multi-language library includes translation files of a plurality of language types; Receiving a loading operation of a page on the cloud platform from a user; In response to the loading operation, the target plug-in is loaded, and a target attribute of a target quantity corresponding to the target plug-in is determined, the target plug-in being one of the multiple plug-ins; Determining target translation information of the target attribute of the target quantity based on the target translation file; The target translation information is displayed on the page of the cloud platform.
2. The method according to claim 1, characterized in that In response to the loading operation, loading the target plug-in and determining the target attribute of the target quantity corresponding to the target plug-in include: In response to the loading operation, determining the target plug-in to be loaded; Load the target plug-in and obtain a target plug-in object corresponding to the target plug-in; Acquire the target attribute of the target quantity that the target plug-in needs to translate from the target plug-in object, where the target attribute is an attribute bound to the file object model DOM tree of the target plug-in module corresponding to the target plug-in; The step of loading the target plug-in to obtain the loaded target plug-in object includes: Loading the target plug-in through a loading function on the page of the cloud platform; After the target plug-in is loaded, the DOM tree corresponding to the target plug-in module is traversed, and the target plug-in object is obtained through the callback function provided by the loading function; or, The page of the cloud platform and the target plug-in are loaded synchronously, the target plug-in is provided with a ref attribute, the cloud platform has a refs attribute, and the refs attribute is used to obtain the target plug-in object of the target plug-in holding the ref attribute.
3. The method according to claim 1, characterized in that In the case where the language type currently supported by the cloud platform is the target language type, searching the multi-language library for a target translation file matching the target language type includes: In the case where the language type currently supported by the cloud platform is the target language type, a variable whose language type is the target language type is loaded from the link address of the multi-language library to obtain the target translation file.
4. The method according to claim 1, characterized in that The determining, based on the target translation file, target translation information of the target attribute of the target quantity includes: Get the name of the target plugin; According to the name of the target plug-in, determining from the target translation file a plug-in module that is consistent with the name of the target plug-in as the target plug-in module, the target plug-in module comprising at least one plug-in attribute and translation information of the target language type of the at least one plug-in attribute; The target translation information of the target attributes of the target quantity is filtered out from the translation information of the target language type of the at least one plug-in attribute.
5. The method according to claim 1, characterized in that The file format of the multiple translation files in the multi-language library is JSON format; at least one plug-in attribute of each plug-in in each translation file and the translation information of the multiple language types of each plug-in attribute are stored in an array.
6. The method according to claim 1, characterized in that The method further comprises: Acquire multiple language types required by the cloud platform; Acquire at least one plug-in property of each of the plurality of plug-ins, and translation information of the plurality of language types of each plug-in property; Generate each of the plug-in modules of each of the language types corresponding to each of the plug-ins according to the at least one plug-in attribute of each of the plug-ins and the translation information of each of the language types of each of the plug-in attributes; Generate a translation file for each of the language types according to the multiple plug-in modules for each of the language types, to obtain translation files for the multiple language types; The multi-language library is generated according to the translation files of the multiple language types.
7. The method according to claim 1, characterized in that The method further comprises: Access the global variable corresponding to the page of the cloud platform, and obtain the language type currently supported by the cloud platform as the target language type.
8. A plug-in information translation device, characterized in that: The device comprises: a processing module, configured to search a target translation file matching the target language type in a multi-language library when the language type currently supported by the cloud platform is the target language type, wherein the target translation file includes a plurality of plug-in modules corresponding to a plurality of plug-ins, each of the plug-in modules includes at least one plug-in attribute and translation information of the target language type of each plug-in attribute, and the multi-language library includes translation files of a plurality of language types; A transceiver module, used for receiving a user's loading operation on a page of the cloud platform; The processing module is further configured to load the target plug-in in response to the loading operation, and determine a target attribute of a target quantity corresponding to the target plug-in, wherein the target plug-in is one of the multiple plug-ins; The processing module is further used to determine the target translation information of the target attribute of the target quantity based on the target translation file; The display module is also used to display the target translation information on the page of the cloud platform.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the plug-in information translation method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the plug-in information translation method according to any one of claims 1 to 7.
