CN-116185535-B - Internationalization processing method, device, equipment and storage medium
Abstract
The disclosure provides an internationalization processing method, device, equipment and storage medium, relates to the technical field of computers, and particularly relates to an internationalization processing method and device. The method comprises the steps of obtaining a target configuration file, wherein the target configuration file comprises a target mapping relation between internationalization type attributes and translation fields, the internationalization type attributes comprise a plurality of attribute values, the translation fields comprise a plurality of translation values, the attribute values correspond to the translation values, prompt information is generated when it is determined that target attribute values corresponding to objects to be processed do not exist in the internationalization type attributes of the target mapping relation, the objects to be processed at least comprise relevant characters to be translated in a target application program, and the prompt information is used for prompting that the target translation values corresponding to the objects to be processed do not exist.
Inventors
- SUN HONGDA
- LI JIANXIN
- HUANG YANQING
Assignees
- 上海创米数联智能科技发展股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20221201
Claims (17)
- 1. An internationalization processing method comprising: The method comprises the steps of obtaining a target configuration file, wherein the target configuration file comprises a target mapping relation between internationalized class attributes and translation fields, the internationalized class attributes comprise a plurality of attribute values, the translation fields comprise a plurality of translation values, the target mapping relation comprises a first relation and a second relation, the first relation represents the mapping relation between the internationalized class attributes and the internationalized fields, the second relation represents the mapping relation between the internationalized fields and the translation fields, the internationalized fields comprise a plurality of field values, the attribute values correspond to the field values, and the field values correspond to the translation values; Generating prompt information under the condition that a target attribute value corresponding to an object to be processed does not exist in internationalized class attributes of the target mapping relation, wherein the object to be processed at least comprises related characters to be translated in a target application program; The determining, when the internationalized class attribute of the target mapping relationship does not have the target attribute value corresponding to the object to be processed, generates a prompt message, including: Generating prompt information under the condition that the target attribute value corresponding to the object to be processed does not exist in the first relation, wherein the prompt information is used for representing that the target translation value corresponding to the object to be processed does not exist in the second relation, or And generating prompt information under the condition that the target attribute value corresponding to the object to be processed exists in the first relation but the target field value corresponding to the target attribute value does not exist, wherein the prompt information is used for representing that the target translation value corresponding to the object to be processed does not exist in the second relation.
- 2. The method of claim 1, further comprising: determining that a target field value corresponding to a target attribute value exists in the first relation under the condition that the target attribute value corresponding to the object to be processed exists; And generating prompt information under the condition that the target field value is not existed in the second relation.
- 3. The method of claim 1, further comprising: determining that a target field value corresponding to a target attribute value exists in the first relation under the condition that the target attribute value corresponding to the object to be processed exists; and generating prompt information when the target field value exists in the second relation but the target translation value corresponding to the target field value does not exist.
- 4. A method according to any one of claims 1-3, further comprising: determining that a target field value corresponding to a target attribute value exists in the first relation under the condition that the target attribute value corresponding to the object to be processed exists; and determining that the target field value exists in the second relation and a target translation value corresponding to the target field value exists, so as to obtain the target translation value corresponding to the object to be processed.
- 5. The method of claim 4, further comprising: Acquiring a database file; the database file contains the second relationship; Processing a plurality of field values in internationalized fields of the database file to obtain a plurality of attribute values in the internationalized class attribute; And obtaining the first relation.
- 6. The method of claim 5, wherein the first relationship is stored in a file other than the database file.
- 7. The method of claim 5, further comprising: detecting the database file update; and updating the first relation under the condition that the updating of the database file is completed.
- 8. An internationalization processing device comprising: The system comprises an acquisition unit, a translation unit and a target configuration file, wherein the acquisition unit is used for acquiring the target configuration file, the target configuration file comprises a target mapping relation between internationalization type attributes and translation fields, the internationalization type attributes comprise a plurality of attribute values, and the translation fields comprise a plurality of translation values; The processing unit is used for determining that the target attribute value corresponding to the object to be processed does not exist in the internationalized class attribute of the target mapping relation, and generating prompt information, wherein the object to be processed at least comprises related characters to be translated in a target application program; The target mapping relation comprises a first relation and a second relation, wherein the first relation represents the mapping relation between an internationalization type attribute and an internationalization field, the second relation represents the mapping relation between the internationalization field and a translation field, the internationalization field comprises a plurality of field values, the attribute value corresponds to the field value, and the field value corresponds to the translation value; Wherein, the processing unit is specifically configured to: Generating prompt information under the condition that the target attribute value corresponding to the object to be processed does not exist in the first relation, wherein the prompt information is used for representing that the target translation value corresponding to the object to be processed does not exist in the second relation, or And generating prompt information under the condition that the target attribute value corresponding to the object to be processed exists in the first relation but the target field value corresponding to the target attribute value does not exist, wherein the prompt information is used for representing that the target translation value corresponding to the object to be processed does not exist in the second relation.
- 9. The apparatus of claim 8, wherein the processing unit is further configured to: determining that a target field value corresponding to a target attribute value exists in the first relation under the condition that the target attribute value corresponding to the object to be processed exists; and generating prompt information under the condition that the target field value does not exist in the second relation.
- 10. The apparatus of claim 8, wherein the processing unit is further configured to: determining that a target field value corresponding to a target attribute value exists in the first relation under the condition that the target attribute value corresponding to the object to be processed exists; and generating prompt information when the target field value exists in the second relation but the target translation value corresponding to the target field value does not exist.
- 11. The apparatus of any of claims 8-10, wherein the processing unit is further to: determining that a target field value corresponding to a target attribute value exists in the first relation under the condition that the target attribute value corresponding to the object to be processed exists; and determining that the target field value exists in the second relation and a target translation value corresponding to the target field value exists, so as to obtain the target translation value corresponding to the object to be processed.
- 12. The apparatus of claim 11, wherein, The acquisition unit is also used for acquiring a database file, wherein the database file contains the second relation; the processing unit is further configured to process a plurality of field values in an internationalized field of the database file to obtain a plurality of attribute values in the internationalized attribute, and obtain the first relationship.
- 13. The apparatus of claim 12, wherein the first relationship is stored in a file other than the database file.
- 14. The apparatus of claim 12, wherein the processing unit is further configured to: detecting the database file update; and updating the first relation under the condition that the updating of the database file is completed.
- 15. An electronic device, comprising: At least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
- 16. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-7.
- 17. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-7.
Description
Internationalization processing method, device, equipment and storage medium Technical Field The disclosure relates to the technical field of computers, and in particular relates to an internationalization processing method and device. Background Internationalization (Internationalization) is also called localization, when an Application program (App) is used, text contents to be internationally displayed are automatically selected according to the current language of a mobile phone of a user, for example, the user sets different mobile phone system languages, and the App is also respectively adapted to different languages, so that the user can use various functions provided by the App without language barriers. However, the translation error of the existing internationalization process cannot be perceived at the code layer, in other words, even if the internationalization process is wrong, the code can still be normally performed, so that the user experience is reduced. Disclosure of Invention The present disclosure provides an internationalization processing method, apparatus, device, and storage medium to solve or alleviate one or more technical problems in the prior art. In a first aspect, the present disclosure provides an internationalization processing method, comprising: the method comprises the steps of obtaining a target configuration file, wherein the target configuration file comprises a target mapping relation between internationalization type attributes and translation fields, the internationalization type attributes comprise a plurality of attribute values, the translation fields comprise a plurality of translation values, and the attribute values correspond to the translation values; And generating prompt information under the condition that a target attribute value corresponding to the object to be processed does not exist in the internationalized class attribute of the target mapping relation, wherein the object to be processed at least comprises related characters to be translated in a target application program, and the prompt information is used for prompting that the target translation value corresponding to the object to be processed does not exist. In a second aspect, the present disclosure provides an internationalization processing device comprising: the system comprises an acquisition unit, a translation unit and a target configuration file, wherein the acquisition unit is used for acquiring the target configuration file, the target configuration file comprises a target mapping relation between internationalization type attributes and translation fields, the internationalization type attributes comprise a plurality of attribute values, the translation fields comprise a plurality of translation values, and the attribute values correspond to the translation values; The processing unit is used for determining that the target attribute value corresponding to the object to be processed does not exist in the internationalized class attribute of the target mapping relation, and generating prompt information, wherein the object to be processed at least comprises related characters to be translated in a target application program, and the prompt information is used for prompting that the target translation value corresponding to the object to be processed does not exist. In a third aspect, an electronic device is provided, comprising: At least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of the embodiments of the present disclosure. In a fourth aspect, a non-transitory computer readable storage medium storing computer instructions is provided, wherein the computer instructions are for causing the computer to perform a method according to any of the embodiments of the present disclosure. In a fifth aspect, a computer program product is provided, comprising a computer program which, when executed by a processor, implements a method according to any of the embodiments of the present disclosure. In this way, the internationalization processing method provided by the scheme of the disclosure can effectively detect the problem of internationalization processing failure, and generate prompt information under the condition of detecting the failure, so that the problem that compiling is still normally performed under the condition of internationalization processing error is effectively solved, and a foundation is laid for effectively improving user experience. It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification. Drawings In the drawings, the same referenc