CN111652003B - Language translation processing method, device, electronic equipment and medium - Google Patents

Language translation processing method, device, electronic equipment and medium Download PDF

Info

Publication number
CN111652003B
CN111652003B CN202010517699.4A CN202010517699A CN111652003B CN 111652003 B CN111652003 B CN 111652003B CN 202010517699 A CN202010517699 A CN 202010517699A CN 111652003 B CN111652003 B CN 111652003B
Authority
CN
China
Prior art keywords
translation
file
language
character string
processed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010517699.4A
Other languages
Chinese (zh)
Other versions
CN111652003A (en
Inventor
欧阳鹏
陈仁杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Genius Technology Co Ltd
Original Assignee
Guangdong Genius Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Genius Technology Co Ltd filed Critical Guangdong Genius Technology Co Ltd
Priority to CN202010517699.4A priority Critical patent/CN111652003B/en
Publication of CN111652003A publication Critical patent/CN111652003A/en
Application granted granted Critical
Publication of CN111652003B publication Critical patent/CN111652003B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/55Rule-based translation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/58Use of machine translation, e.g. for multi-lingual retrieval, for server-side translation for client devices or for real-time translation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Machine Translation (AREA)

Abstract

The application discloses a language translation processing method, a device, electronic equipment and a medium. The language translation processing method in the application comprises the following steps: reading a configuration file, wherein the configuration file comprises language set configuration information to be processed; acquiring corresponding translation data according to the configuration file; acquiring a resource file according to the language set configuration information to be processed, and determining a character string to be processed in the resource file; and acquiring the translation corresponding to the character string to be processed from the translation data, generating a translation file, storing the translation file in a resource file storage directory of a corresponding language, leading in translation entries to engineering more quickly and accurately in a scene of multi-language development, simplifying the step of adding the translation entries in a translation platform, and reducing manual operation.

Description

Language translation processing method, device, electronic equipment and medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a language translation processing method, apparatus, electronic device, and medium.
Background
In face of the internationalization requirement of applications, the applications need to support documents displaying different national languages.
On a translation platform for supporting translation functions in software development, each term has multiple language translations, and each term may be used by multiple applications or modules. Generally, when the android platform develops multi-language application software, each time a translation language is newly added, vocabulary entries need to be searched in the translation platform, and the searched translation results are copied and pasted into a configuration file, so that the workload is huge and complex and the error is very easy; when the translation vocabulary entry is newly added in the translation platform, the vocabulary entry originally used by each application has the corresponding accurate translation vocabulary entry on the translation platform, but the workload of combing translation and importing translation into the translation platform is large, business personnel are often reluctant to import translation, but copy and use the vocabulary entry with the same application, and the accuracy is not high.
Disclosure of Invention
The application provides a language translation processing method, a device, electronic equipment and a medium.
In a first aspect, a language translation processing method is provided, including:
reading a configuration file, wherein the configuration file comprises language set configuration information to be processed;
acquiring corresponding translation data according to the configuration file;
acquiring a resource file according to the language set configuration information to be processed, and determining a character string to be processed in the resource file;
and acquiring the translation corresponding to the character string to be processed from the translation data, generating a translation file, and storing the translation file in a resource file storage directory of a corresponding language.
In an alternative embodiment, the language set configuration information to be processed includes language set information to be translated and/or language set information to be optionally translated;
the step of obtaining the resource file according to the language set configuration information to be processed comprises the following steps:
acquiring a resource file storage directory, and searching and acquiring a corresponding resource file under the resource file storage directory according to the language set information to be translated and/or the language set information to be translated in a non-mandatory way;
the determining the character string to be processed in the resource file comprises the following steps:
and determining the character strings of the preset types in the resource file as the character strings to be processed.
In an optional implementation manner, the obtaining, from the translation data, a translation corresponding to the character string to be processed, and generating a translation file includes:
searching each character string to be processed in the translation data;
if the translation data are found to have the translation corresponding to the character string, generating a translation file corresponding to the character string.
In an alternative embodiment, the method further comprises:
if the translation data does not contain the translation corresponding to the character string and the character string belongs to the language set to be translated, generating a new template file, wherein the new template file comprises the character string in which the translation is not found and a corresponding translation language identifier;
uploading the newly added template file to a translation platform for processing so as to newly add translation data corresponding to the character strings in batches;
if the translation data does not contain the translation corresponding to the character string and the character string belongs to the language set information of the non-mandatory translation, generating translation prompt information comprising the character string.
In an optional implementation manner, after the processing of the newly added template file by the translation platform, the method further includes:
acquiring new translation data generated by a translation platform according to the new template file;
generating a new translation file according to the new translation data, and storing the new translation file in a resource file storage directory of a corresponding language.
In an alternative embodiment, the method further comprises:
and acquiring the translation file and the translation file to be tested, comparing the translation file with the translation file to be tested, and generating a check file, wherein the check file comprises translation content differences of the same character strings in the translation file and the translation file to be tested.
In an alternative embodiment, the configuration file further includes an application name and/or a module name, and a language mapping relation; the obtaining the corresponding translation data according to the configuration file includes:
and acquiring translation data belonging to the language mapping relation corresponding to the application name and/or the module name to be stored or cached locally through a translation platform interface.
In a second aspect, there is provided a language translation processing device including:
the reading module is used for reading a configuration file, wherein the configuration file comprises language set configuration information to be processed;
the acquisition module is used for acquiring corresponding translation data according to the configuration file;
the processing module is used for acquiring a resource file according to the language set configuration information to be processed and determining a character string to be processed in the resource file;
and the generation module is used for acquiring the translation corresponding to the character string to be processed from the translation data, generating a translation file and storing the translation file into a resource file storage directory of a corresponding language.
In a third aspect, there is provided an electronic device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps as in the first aspect and any one of its possible implementations.
In a fourth aspect, there is provided a computer storage medium storing one or more instructions adapted to be loaded by a processor and to perform the steps of the first aspect and any one of its possible implementations described above.
According to the application, through reading the configuration file, the configuration file comprises language set configuration information to be processed, corresponding translation data is obtained according to the configuration file, the resource file is obtained according to the language set configuration information to be processed, the character string to be processed in the resource file is determined, then the translation corresponding to the character string to be processed is obtained from the translation data, the translation file is generated and stored in the resource file storage directory of the corresponding language, the translation vocabulary entry can be more quickly and accurately imported into the project in the scene of multi-language development, the step of manually searching or copying and comparing the translation vocabulary entry in the translation platform is simplified, the translation vocabulary entry can be more quickly and accurately imported into the project in the scene of multi-language development, the step of manually operating is reduced, and compared with the translation vocabulary entry directly imported into other applications, the translation accuracy is improved.
Drawings
In order to more clearly describe the embodiments of the present application or the technical solutions in the background art, the following description will describe the drawings that are required to be used in the embodiments of the present application or the background art.
FIG. 1 is a schematic flow chart of a language translation processing method according to an embodiment of the present application;
FIG. 2 is a flowchart of another language translation processing method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a translation platform system interface according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a language translation processing device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the present application better understood by those skilled in the art, the following description will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms first, second and the like in the description and in the claims and in the above-described figures are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
Embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
Referring to fig. 1, fig. 1 is a flow chart of a language translation processing method according to an embodiment of the application. The method may include:
101. and reading a configuration file, wherein the configuration file comprises language set configuration information to be processed.
The execution body of the embodiment of the present application may be a language translation processing apparatus, may be an electronic device, and in a specific implementation, the electronic device is a terminal, which may also be referred to as a terminal device, including but not limited to other portable devices such as a mobile phone with a touch sensitive surface (e.g., a touch screen display and/or a touch pad), a laptop computer, or a tablet computer, and may also be a wearable device such as a smart watch. It should also be appreciated that in some embodiments, the above-described devices are not portable communication devices, but rather desktop computers having touch-sensitive surfaces (e.g., touch screen displays and/or touch pads). In an alternative embodiment, the language translation processing method may be executed by a corresponding software program.
The configuration file is related information or data which is pre-configured and used for translation processing, specifically, may include translation plug-in information, application name and/or module name, language set configuration information to be processed, and the like, and is not limited herein.
The translation plug-in information described above is used to determine the translation plug-in or translation tool (translation platform) that was invoked. The language set configuration information to be processed is used for determining which language data to process, wherein the language set configuration information can comprise language set information which is required to be translated and/or language set information which is not required to be translated, and optionally, the language set configuration information can also comprise language set information which is not translated, namely, the language set which is not translated is not processed in the subsequent processing process.
Each term in the translation platform may have multiple Application programs (apps), and software modules, and each term has multiple language translations, which also facilitates querying and retrieval. Therefore, the application name and/or the module name corresponding to the data for executing the translation process need to be configured in advance, and then the related data is stored corresponding to the set application name and/or module name. The setting of the configuration file can be found in detail in the description of the related examples that follow.
102. And acquiring corresponding translation data according to the configuration file.
Each configuration information including the language set configuration information is set in the configuration file, and the language translation processing device can acquire corresponding translation data from the translation platform according to the configuration information in the configuration file to provide preliminary data support of translation processing.
In one embodiment, the configuration file includes an application name and/or a module name, and a language mapping relation; the step 102 specifically includes:
and acquiring translation data which corresponds to the application name and/or the module name and belongs to the language mapping relation to local storage or cache through a translation platform interface.
The application programming interface (Application Programming Interface, API) is a predefined function or convention that refers to the engagement of various components of a software system to provide a set of routines that an application and developer can access based on certain software or hardware without having to access the native code or understand the details of the internal operating mechanism. Specifically, the API of the translation platform may be requested to obtain the translation data corresponding to the application name and/or the module name and conforming to the language mapping relationship, and store the translation data in a local or cache.
The above-mentioned language mapping relation refers to the corresponding relation between the character string language to be translated and the target language to be translated, and the language mapping relation may include mapping relation of more than two languages, such as chinese-japanese, chinese-english-italian, etc., optionally, the above-mentioned language mapping relation may further include a multiplexing language mapping relation, for example, may include: en (english) corresponds to en-US (english-america), zh-HK (chinese-hong kong), etc., and is only shown here as an illustration. If the translation is needed to be en, the platform only has en-US translation, the en can multiplex the en-US translation through the mapping, and multiple groups of default mapping relations can be preset, namely the language of query translation is preset according to the requirement, so that the translation flexibility is improved.
103. And acquiring a resource file according to the language set configuration information to be processed, and determining a character string to be processed in the resource file.
A typical Android (Android) building system uses Gradle to build applications. Gradle is a build tool that uses a Groovy-based domain-specific language to declare project settings. The software development process involves not only writing code, but also management of projects such as: a series of operations such as project or module dependence, packaging, signature, release and the like can be added, the project can be set in Gradle by writing a script file named build. And the system needs to be enabled to support the operation of Gradle by installing the corresponding plug-in (Gradle plug in).
According to the embodiment of the application, the resource file storage directory can be obtained from the Android Gradle plug-in, the resource files to be scanned are determined, the resource files are obtained, and the character strings in the resource files are scanned to determine the character strings to be processed.
Specifically, the character strings of the preset type in the resource file may be determined to be character strings to be processed, for example, the preset character types are string, string-array, plurals, and may be set according to needs.
104. And acquiring the translation corresponding to the character string to be processed from the translation data, generating a translation file, and storing the translation file in a resource file storage directory of a corresponding language.
Specifically, the translation data pulled from the translation platform and each character string may be compared to determine whether the translation data includes a translation corresponding to the character string, if so, the translation may be obtained, and finally a translation file including the translation content of the character string may be generated, where a corresponding language mapping relationship, an application name, and/or a module name may be further marked. And outputting the translation corresponding to the character string to the resource file, namely storing the translation to a resource file storage directory of the corresponding language.
In the development process of android application, the steps from the translation platform to the project are complicated. And each time of new translation language is added, a lot of new translations are needed, corresponding translation entries are searched for on a translation platform, copied and pasted into a configuration file, and the workload is high and the errors are easy to occur. Compared with a manual or graphical interface importing translation mode, the language translation processing in the embodiment of the application can process an importing process into a more automatic process, and automatically acquire resource files of translation generated translation entries during translation change.
The automatic import scheme is realized by using the Gradle plug-in, so that the information related to compiling is favorable for obtaining, for example, different projects can be configured with different compiling variants or source code storage paths.
According to the method, the configuration file is read, the configuration file comprises language set configuration information to be processed, corresponding translation data is obtained according to the configuration file, a resource file is obtained according to the language set configuration information to be processed, character strings to be processed in the resource file are determined, translations corresponding to the character strings to be processed are obtained from the translation data, the translation file is generated and stored in a resource file storage directory of the corresponding language, translation terms can be more quickly and accurately imported into projects under the condition that the multi-language development is carried out, the step of adding the translation terms in the translation platform is simplified, the translation terms can be more quickly and accurately imported into the projects under the condition that the multi-language development is carried out, manual operation is reduced, and compared with the condition that the translation terms of other applications are directly imported, the translation accuracy is improved.
Referring to fig. 2, fig. 2 is a flow chart of another language translation processing method according to an embodiment of the application. As shown in fig. 2, the method may specifically include:
201. and reading a configuration file, wherein the configuration file comprises language set configuration information to be processed.
202. And acquiring corresponding translation data according to the configuration file.
203. And acquiring a resource file according to the language set configuration information to be processed, and determining a character string to be processed in the resource file.
The steps 201 to 203 may refer to the specific steps of steps 101 to 103 in the embodiment shown in fig. 1, and are not described herein.
204. And searching each character string to be processed in the translation data.
Specifically, each of the character strings and the translation data pulled from the translation platform may be compared to determine whether the translation data includes a corresponding translation, so as to perform step 206 or step 207.
205. If the translation data is found to have the translation corresponding to the character string, generating a translation file corresponding to the character string.
If the translation data includes translations corresponding to the character strings, that is, the translation platform has translation entries of the character strings, the translation entries may be obtained, and a translation file including the translation entries of the character strings may be generated, where a corresponding language mapping relationship, an application name, a module name, and/or the like may be marked. And can output the translation corresponding to the character string to the resource file, namely, the resource file storage directory stored in the corresponding language.
206. If the translation data does not contain the translation corresponding to the character string and the character string belongs to the language set which is needed to be translated, generating a new template file, wherein the new template file comprises the character string which is not found to be translated and the corresponding translation language identifier.
The language set configuration information to be processed mentioned above may include language set information to be translated and/or language set information to be optionally translated, and may also include language set information not to be translated. For language sets which need to be translated, if the language sets lack of translation, the language sets are exported to the newly added template file, the newly added template file can be in an Excel table form, and the recorded character strings which do not find translation can be uploaded to a translation platform in batches through the newly added template file for translation, so that new translation entries are added.
207. And uploading the newly added template file to a translation platform for processing so as to newly add translation data corresponding to the character strings in batches.
For a translation platform, reference may be made to a translation platform system interface schematic as shown in FIG. 3.
Each term may have multiple App, module uses, as shown in fig. 3, where the translation list content of the a area may include multiple search boxes for searching the term by various means or tags, such as options including original text, translation language, status, application name, module name, creator, number, date of modification, etc. Each term in the translation platform can have a plurality of language translations, so that query and acquisition are facilitated, as shown in fig. 3, taking the original text "monday" as an example, terms of application names of a 'table end-desktop', b 'mobile phone App' and c 'table end-dial mall' can be queried, and only part of term contents of a 'table end-desktop', which are selected term sets, are shown in fig. 3. Wherein the original text corresponds to information such as different translation languages, states, creators and the like. The generated newly-added template file accords with the format of newly-added translation entries of the translation platform, and can be directly uploaded to the translation platform to newly-added translation entries in batches.
In an alternative embodiment, after step 208, the method further includes:
acquiring new translation data generated by a translation platform according to the new template file;
generating a new translation file according to the new translation data, and storing the new translation file in a resource file storage directory of a corresponding language.
Specifically, for the newly added entry of the translation platform, the state identifier is "to be translated". The translation platform may preset a third-party translation plug-in or tool, integrate the entries in the newly-added translation data and transmit the integrated entries to the preset third-party translation plug-in or tool for translation, obtain a translation result, update the newly-added entries, which have corresponding translations, and execute the manner as in step 102 again, so as to generate the newly-added translation file from the newly-added translated data, store the newly-added translation file in a resource file storage directory of a corresponding language, and update the translation file. The character strings without translation can be summarized for batch translation and then regenerated into translation files, and manual reconfiguration and execution are not needed.
208. If the translation data does not include the translation corresponding to the character string and the character string belongs to the language set information of the non-mandatory translation, generating translation prompt information including the character string.
Specifically, for a language set of non-mandatory translation, namely, selectable translation content, if the language set is checked to lack translation, the language set is not exported to the newly added template file, translation prompt information including the character strings can be generated and used as a mark to prompt that the character strings have no corresponding translation in a translation platform. And corresponding translation files can be generated.
The processing configuration of the different language sets in the embodiment of the application can be realized through the configuration files, the configuration is not needed to be carried out again when the language translation processing method in the embodiment of the application is executed each time, the processing can be carried out according to the default configuration files, and the configuration can be modified and then the needed automatic translation processing flow can be carried out. For a clearer description of the correspondence of data processing flows and configuration files, reference can be made to the following examples of configuration files, in which an explanation of the corresponding steps has been made before the main processing statement:
apply plugin:‘com.xtc translator’
translator{
application name must be filled in
application 'Mobile Phone app'
The name of the module is defaulted to null
Module 'micro chat'
/*
* Language set to be translated is exported to a batch of newly added Excel templates when translation is absent
* Format: lan_id lan_count, for example: en will translate to output to the values-en folder and zh-HK will translate to output to the values-zh-rHK folder;
*/
require ‘en’,‘zh-HK’
/*
* Language set of optional translation, which is not exported to batch newly-added Excel template when translation is absent
* The format is the same as that of a request;
*/
option‘in-ID’,‘th-TH’
input source is/translated, default ' zh-CN ', namely resource files under the default scanning value s-zh-rCN folder, and if files under the default scanning value s folder are required, filling in '.
source‘zh-CN’
/*
* Setting language mapping relation
* For example, in require an en translation is required, but only an en-US translation in the platform, the en can be made to multiplex by mapping;
*/
map(‘en’‘en-US’)
/*
* Excluding documents that do not require translation
* For some trans-table=true but entries which do not need to be translated in translation, the entries can be independently placed in a resource file and are uniformly excluded
*/
Exclude‘string-untranslatable.xml’
}
In an alternative embodiment, the method further comprises:
and obtaining the translation file and the translation file to be tested, comparing the translation file with the translation file to be tested, and generating a check file, wherein the check file comprises translation content differences of the same character strings in the translation file and the translation file to be tested.
With the above configuration, the task of the gradle can be executed to perform the translation processing work. Specifically, the translation check replacement of all modules may be performed by:
gradlew checkTranstalor
while performing translation verification replacement of a given module, the following may be used:
translation of # import app
gradlew :app:checkTranstalor
After the task is successfully executed, if the translation platform has translations, corresponding translation files can be directly generated under the corresponding language catalogues, and if the translation platform has translations missing, a batch of newly added Excel templates are exported under $ { path to module }/build/transducer catalogues and can be in xlsx format. If the traversed vocabulary entry to be translated exists on the translation platform, a corresponding translation file is automatically generated under the corresponding language directory, and the specific form of the translation file can be a character string resource file.
For example, the content of the generated newly added Excel document can be shown in the following table:
TABLE 1
The above table 1 illustrates only a part of contents, and files of different numbers, contents and formats can be generated according to different configurations, and the method can be applied to the processing of the translation platform, and is not limited herein.
The test work of general translation vocabulary entry, the test personnel need to compare the text of translation platform piece by piece, and the more language is supported, the more work load is. The method can obtain the translation file, and compare and check the translation file with the translation file to be tested, so that the check file can also be obtained, wherein the check file comprises translation content differences between the same character string in the translation file and the translation file to be tested, and the test result can be obtained rapidly and accurately.
The method can also be applied to compiled verification. When compiling the proposed version, after the foregoing steps 201-205 are performed, a verification document may be generated, and the verification result is displayed. The Android compiling flow is also realized based on the Gradle plug-in, and the automatic import scheme is realized by using the Gradle plug-in, so that compiling related information can be acquired, for example, different projects can be configured with different compiling variants or source code storage paths, and the automatic import plug-in can be compatible with any Android project configuration. Under the condition of ensuring the stability of the plug-in, the workload of test translation is greatly reduced.
According to the embodiment of the application, the configuration file is read, the configuration file comprises language set configuration information to be processed, corresponding translation data is obtained according to the configuration file, a resource file is obtained according to the language set configuration information to be processed, character strings to be processed in the resource file are determined, each character string to be processed is searched in the translation data, and if translation corresponding to the character string exists in the translation data, a translation file corresponding to the character string is generated; if the translation data does not contain the translation corresponding to the character string and the character string belongs to the language set to be translated, generating a new template file, wherein the new template file comprises the character string with no translation found and the corresponding translation language identifier, and uploading the new template file to a translation platform for processing so as to newly add the translation data corresponding to the character string in batches; and generating translation prompt information including the character string if the translation corresponding to the character string does not exist in the translation data and the character string belongs to language set information of the non-mandatory translation. The method has the advantages that the translation vocabulary entry can be more quickly and accurately imported into the engineering in the multi-language development scene, the step of newly adding the translation vocabulary entry into the translation platform is simplified, the translation vocabulary entry can be more quickly and accurately imported into the engineering in the multi-language development scene without manual searching or copying or comparing the translation vocabulary entry, the step of newly adding the translation vocabulary entry into the translation platform is simplified, different translation processing methods can be flexibly executed for different language sets according to the setting, manual operation is reduced, and compared with the translation vocabulary entry directly imported into other applications, the translation accuracy is improved.
Based on the description of the language translation processing method embodiment, the embodiment of the application also discloses a language translation processing device. Referring to fig. 4, the language translation processing device 400 includes:
a reading module 410, configured to read a configuration file, where the configuration file includes language set configuration information to be processed;
the obtaining module 420 is configured to obtain corresponding translation data according to the configuration file;
the processing module 430 is configured to obtain a resource file according to the language set configuration information to be processed, and determine a character string to be processed in the resource file;
the generating module 440 is configured to obtain a translation corresponding to the character string to be processed from the translation data, generate a translation file, and store the translation file in a resource file storage directory of a corresponding language.
Optionally, the language set configuration information to be processed includes language set information to be translated and/or language set information to be translated optionally;
the processing module 430 is specifically configured to obtain a resource file storage directory, and search and obtain a corresponding resource file under the resource file storage directory according to the language set information to be translated and/or the language set information to be translated;
and determining the character strings of the preset types in the resource file as the character strings to be processed.
Optionally, the generating module 440 is configured to:
searching each character string to be processed in the translation data;
if the translation data is found to have the translation corresponding to the character string, generating a translation file corresponding to the character string.
Optionally, a transmission module 450 is also included; the generating module 440 is further configured to generate a new template file if the translation corresponding to the character string does not exist in the translation data and the character string belongs to the language set that has to be translated, where the new template file includes the character string for which no translation is found and a corresponding translation language identifier;
the transmission module 450 is configured to upload the newly added template file to a translation platform for processing, so as to newly add translation data corresponding to the character strings in batch;
the generating module 440 is further configured to generate translation prompt information including the character string if the translation corresponding to the character string does not exist in the translation data and the character string belongs to language set information of the non-mandatory translation.
Optionally, the transmission module 450 is further configured to obtain the new translation data generated by the translation platform according to the new template file after the uploading of the new template file to the translation platform is performed;
the generating module 440 is further configured to generate a new translation file according to the new translation data, and store the new translation file in a resource file storage directory of the corresponding language.
Optionally, the generating module 440 is further configured to:
and obtaining the translation file and the translation file to be tested, comparing the translation file with the translation file to be tested, and generating a check file, wherein the check file comprises translation content differences of the same character strings in the translation file and the translation file to be tested.
Optionally, the configuration file further includes an application name and/or a module name, and a language mapping relation; the acquisition module 420 is specifically configured to:
and acquiring translation data which corresponds to the application name and/or the module name and belongs to the language mapping relation to local storage or cache through a translation platform interface.
According to an embodiment of the present application, each step involved in the methods shown in fig. 1 and fig. 2 may be performed by each module in the language translation processing apparatus 400 shown in fig. 4, which is not described herein.
According to the language translation processing device 400 in the embodiment of the application, through reading the configuration file, the configuration file comprises language set configuration information to be processed, corresponding translation data is obtained according to the configuration file, the resource file is obtained according to the language set configuration information to be processed, the character string to be processed in the resource file is determined, then the translation corresponding to the character string to be processed is obtained from the translation data, the translation file is generated and stored in the resource file storage directory of the corresponding language, the translation vocabulary entry can be more quickly and accurately imported into the project in the scene of multi-language development, the step of manually searching or copying and comparing the translation vocabulary entry in the translation platform is simplified, the translation vocabulary entry can be more quickly and accurately imported into the project in the scene of multi-language development, the step of manually importing the translation vocabulary entry in the translation platform is simplified, and compared with the translation vocabulary entry of other applications, the translation accuracy is improved.
Based on the description of the method embodiment and the device embodiment, the embodiment of the application also provides electronic equipment. Referring to fig. 5, the electronic device 500 includes at least a processor 501, an input device 502, an output device 503, and a computer storage medium 504. Wherein the processor 501, input device 502, output device 503, and computer storage medium 504 in the terminal may be connected by a bus or other means.
The computer storage medium 504 may be stored in a memory of the terminal, the computer storage medium 504 is used for storing a computer program, the computer program includes program instructions, and the processor 501 is used for executing the program instructions stored in the computer storage medium 504. The processor 501 (or CPU (Central Processing Unit, central processing unit)) is a computing core and a control core of the terminal, which are adapted to implement one or more instructions, in particular to load and execute one or more instructions to implement a corresponding method flow or a corresponding function; in one embodiment, the processor 501 described above in the embodiments of the present application may be used to perform a series of processes, including the method of the embodiments shown in fig. 1 and 2, and so on.
The embodiment of the application also provides a computer storage medium (Memory), which is a Memory device in the terminal and is used for storing programs and data. It will be appreciated that the computer storage medium herein may include both a built-in storage medium in the terminal and an extended storage medium supported by the terminal. The computer storage medium provides a storage space that stores an operating system of the terminal. Also stored in this memory space are one or more instructions, which may be one or more computer programs (including program code), adapted to be loaded and executed by the processor 501. The computer storage medium herein may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory; optionally, at least one computer storage medium remote from the processor may be present.
In one embodiment, one or more instructions stored in a computer storage medium may be loaded and executed by processor 501 to implement the corresponding steps in the above embodiments; in particular, one or more instructions in the computer storage medium may be loaded by the processor 501 and perform any steps of the methods of fig. 1 and/or fig. 2, which are not described herein.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus and modules described above may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the division of the module is merely a logical function division, and there may be another division manner when actually implemented, for example, a plurality of modules or components may be combined or may be integrated into another system, or some features may be omitted or not performed. The coupling or direct coupling or communication connection shown or discussed with each other may be through some interface, device or module indirect coupling or communication connection, which may be in electrical, mechanical, or other form.
The modules illustrated as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, i.e., may be located in one place, or may be distributed over a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted across a computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a read-only memory (ROM), or a random-access memory (random access memory, RAM), or a magnetic medium, such as a floppy disk, a hard disk, a magnetic tape, a magnetic disk, or an optical medium, such as a digital versatile disk (digital versatile disc, DVD), or a semiconductor medium, such as a Solid State Disk (SSD), or the like.

Claims (6)

1. A language translation processing method, comprising:
reading a configuration file, wherein the configuration file comprises language set configuration information to be processed, and the language set configuration information to be processed comprises language set information to be translated and/or language set information to be translated optionally;
acquiring corresponding translation data according to the configuration file;
acquiring a resource file storage directory, and searching and acquiring a corresponding resource file under the resource file storage directory according to the language set information to be translated and/or the language set information to be translated in a non-mandatory way;
determining that the character strings of the preset type in the resource file are character strings to be processed;
acquiring the translation corresponding to the character string to be processed from the translation data, generating a translation file, and storing the translation file under a resource file storage directory of a corresponding language;
the step of obtaining the translation corresponding to the character string to be processed from the translation data, and the step of generating a translation file includes:
searching each character string to be processed in the translation data;
if the translation data are found to have translations corresponding to the character strings, generating translation files corresponding to the character strings;
if the translation data does not contain the translation corresponding to the character string and the character string belongs to the language set to be translated, generating a new template file, wherein the new template file comprises the character string in which the translation is not found and a corresponding translation language identifier;
uploading the newly added template file to a translation platform for processing so as to newly add translation data corresponding to the character strings in batches;
if the translation data does not contain the translation corresponding to the character string and the character string belongs to the language set information of the non-mandatory translation, generating translation prompt information comprising the character string;
after the newly added template file is uploaded to the translation platform for processing, the method further comprises the following steps:
acquiring new translation data generated by a translation platform according to the new template file;
generating a new translation file according to the new translation data, and storing the new translation file in a resource file storage directory of a corresponding language.
2. The language translation processing method according to claim 1, characterized in that the method further comprises:
and acquiring the translation file and the translation file to be tested, comparing the translation file with the translation file to be tested, and generating a check file, wherein the check file comprises translation content differences of the same character strings in the translation file and the translation file to be tested.
3. A language translation processing method according to claim 1, wherein the configuration file further comprises an application name and/or a module name, and a language mapping relation; the obtaining the corresponding translation data according to the configuration file includes:
and acquiring translation data belonging to the language mapping relation corresponding to the application name and/or the module name to be stored or cached locally through a translation platform interface.
4. A language translation processing device, comprising:
the reading module is used for reading a configuration file, wherein the configuration file comprises language set configuration information to be processed, and the language set configuration information to be processed comprises language set information to be translated and/or language set information to be translated optionally;
the acquisition module is used for acquiring corresponding translation data according to the configuration file;
the processing module is used for acquiring a resource file storage directory, and searching and acquiring a corresponding resource file under the resource file storage directory according to the language set information to be translated and/or the language set information to be translated in a non-mandatory manner;
determining that the character strings of the preset type in the resource file are character strings to be processed;
the generation module is used for acquiring the translation corresponding to the character string to be processed from the translation data, generating a translation file and storing the translation file into a resource file storage directory of a corresponding language;
the generating module is specifically configured to:
searching each character string to be processed in the translation data;
if the translation data are found to have translations corresponding to the character strings, generating translation files corresponding to the character strings;
if the translation data does not contain the translation corresponding to the character string and the character string belongs to the language set to be translated, generating a new template file, wherein the new template file comprises the character string in which the translation is not found and a corresponding translation language identifier;
the transmission module is used for uploading the newly added template file to a translation platform for processing so as to newly add translation data corresponding to the character strings in batches;
the generation module is further configured to generate translation prompt information including the character string if no translation corresponding to the character string exists in the translation data and the character string belongs to language set information of the non-mandatory translation;
the transmission module is further used for acquiring new translation data generated by the translation platform according to the new template file after the new template file is uploaded to the translation platform for processing;
the generating module is further configured to: generating a new translation file according to the new translation data, and storing the new translation file in a resource file storage directory of a corresponding language.
5. An electronic device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the language translation processing method of any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that a computer program is stored, which, when being executed by a processor, causes the processor to execute the steps of the language translation processing method according to any one of claims 1 to 3.
CN202010517699.4A 2020-06-09 2020-06-09 Language translation processing method, device, electronic equipment and medium Active CN111652003B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010517699.4A CN111652003B (en) 2020-06-09 2020-06-09 Language translation processing method, device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010517699.4A CN111652003B (en) 2020-06-09 2020-06-09 Language translation processing method, device, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN111652003A CN111652003A (en) 2020-09-11
CN111652003B true CN111652003B (en) 2023-08-15

Family

ID=72347460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010517699.4A Active CN111652003B (en) 2020-06-09 2020-06-09 Language translation processing method, device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN111652003B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112685117A (en) * 2020-12-29 2021-04-20 平安普惠企业管理有限公司 System language internationalization maintenance method, device and computer readable storage medium
CN114330248B (en) * 2022-02-22 2022-05-17 深圳市微克科技有限公司 Method for automatically switching multinational languages of intelligent wearable system
CN115618887B (en) * 2022-10-17 2023-07-25 北京志凌海纳科技有限公司 Dynamic long text internationalization method, device, equipment and storage medium

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102364437A (en) * 2011-09-22 2012-02-29 厦门游家网络有限公司 Multi-language site development system and implementation method thereof
CN104317788A (en) * 2014-11-03 2015-01-28 上海鼎讯电子有限公司 Android multi-language translation method and device
CN105138350A (en) * 2015-07-29 2015-12-09 北京四方继保自动化股份有限公司 International multi-language implement method of configuration software
CN107451128A (en) * 2017-08-04 2017-12-08 深圳Tcl新技术有限公司 Multilingual code adaptation method, equipment and storage medium
CN107741858A (en) * 2017-11-28 2018-02-27 深圳市鼎晟开元科技有限公司 The application program update method, apparatus and system of multilingual version
CN107748746A (en) * 2017-11-06 2018-03-02 四川长虹电器股份有限公司 A kind of method of automatic management entry
CN108399064A (en) * 2017-02-07 2018-08-14 南京南瑞继保电气有限公司 Multilingual entry generation method based on Qt exploitations
CN108776639A (en) * 2018-04-26 2018-11-09 福建天泉教育科技有限公司 Language check test method and computer readable storage medium
CN109284145A (en) * 2018-08-28 2019-01-29 北京城市网邻信息技术有限公司 The generation of multilingual configuration file and methods of exhibiting and device, equipment and medium
CN110414010A (en) * 2018-04-27 2019-11-05 福建天晴数码有限公司 The processing method of internationalized resources file translation text, readable storage medium storing program for executing
CN110554893A (en) * 2018-05-31 2019-12-10 马上消费金融股份有限公司 Multi-language adaptation method, device and equipment for software system and readable storage medium
CN110673920A (en) * 2019-09-29 2020-01-10 深圳前海环融联易信息科技服务有限公司 Internationalization processing method and device, computer equipment and storage medium
CN110852038A (en) * 2019-11-11 2020-02-28 腾讯科技(深圳)有限公司 Text display method and related equipment
CN111160045A (en) * 2019-12-27 2020-05-15 苏州亿歌网络科技有限公司 Game resource file translation method, device and equipment
CN111159036A (en) * 2019-12-28 2020-05-15 苏州浪潮智能科技有限公司 Method, system, terminal and storage medium for testing accuracy of product translation function

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7440888B2 (en) * 2004-09-02 2008-10-21 International Business Machines Corporation Methods, systems and computer program products for national language support using a multi-language property file
US7987087B2 (en) * 2005-06-15 2011-07-26 Xerox Corporation Method and system for improved software localization

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102364437A (en) * 2011-09-22 2012-02-29 厦门游家网络有限公司 Multi-language site development system and implementation method thereof
CN104317788A (en) * 2014-11-03 2015-01-28 上海鼎讯电子有限公司 Android multi-language translation method and device
CN105138350A (en) * 2015-07-29 2015-12-09 北京四方继保自动化股份有限公司 International multi-language implement method of configuration software
CN108399064A (en) * 2017-02-07 2018-08-14 南京南瑞继保电气有限公司 Multilingual entry generation method based on Qt exploitations
CN107451128A (en) * 2017-08-04 2017-12-08 深圳Tcl新技术有限公司 Multilingual code adaptation method, equipment and storage medium
CN107748746A (en) * 2017-11-06 2018-03-02 四川长虹电器股份有限公司 A kind of method of automatic management entry
CN107741858A (en) * 2017-11-28 2018-02-27 深圳市鼎晟开元科技有限公司 The application program update method, apparatus and system of multilingual version
CN108776639A (en) * 2018-04-26 2018-11-09 福建天泉教育科技有限公司 Language check test method and computer readable storage medium
CN110414010A (en) * 2018-04-27 2019-11-05 福建天晴数码有限公司 The processing method of internationalized resources file translation text, readable storage medium storing program for executing
CN110554893A (en) * 2018-05-31 2019-12-10 马上消费金融股份有限公司 Multi-language adaptation method, device and equipment for software system and readable storage medium
CN109284145A (en) * 2018-08-28 2019-01-29 北京城市网邻信息技术有限公司 The generation of multilingual configuration file and methods of exhibiting and device, equipment and medium
CN110673920A (en) * 2019-09-29 2020-01-10 深圳前海环融联易信息科技服务有限公司 Internationalization processing method and device, computer equipment and storage medium
CN110852038A (en) * 2019-11-11 2020-02-28 腾讯科技(深圳)有限公司 Text display method and related equipment
CN111160045A (en) * 2019-12-27 2020-05-15 苏州亿歌网络科技有限公司 Game resource file translation method, device and equipment
CN111159036A (en) * 2019-12-28 2020-05-15 苏州浪潮智能科技有限公司 Method, system, terminal and storage medium for testing accuracy of product translation function

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
赵玉 等.基于资源文件的一种多语言界面解决方案.信息技术.2009,(第05期),第48-50页. *

Also Published As

Publication number Publication date
CN111652003A (en) 2020-09-11

Similar Documents

Publication Publication Date Title
CN111652003B (en) Language translation processing method, device, electronic equipment and medium
WO2018095306A1 (en) Method and device for processing application program page, and storage medium
WO2021184725A1 (en) User interface test method and apparatus, storage medium, and computer device
WO2018077085A1 (en) Application processing method, device and storage medium
US8464242B2 (en) Virtualization of configuration settings
WO2019136800A1 (en) Service processing method, apparatus and device, and computer-readable storage medium
US20160072927A1 (en) Odata enabled mobile software applications
WO2021217846A1 (en) Interface data processing method and apparatus, and computer device and storage medium
US11741002B2 (en) Test automation systems and methods using logical identifiers
CN106648569B (en) Target serialization realization method and device
CN111506300A (en) Applet generation method, device, equipment and storage medium
CN110688145B (en) Android MVP code automatic generation method and device, medium and electronic equipment
CN113626223A (en) Interface calling method and device
CN112087370A (en) Method, system, electronic device and computer-readable storage medium for issuing GitHub Issues
WO2022068556A1 (en) Code translation method and apparatus, and device
CN111399786B (en) Method and device for generating print file, terminal equipment and storage medium
CN110888794A (en) Interface test method and device
CN112181408A (en) Method and device for displaying view list on front page of application program
CN111596997B (en) UI information request method, device, terminal and storage medium
CN111881220A (en) Data operation method and device under list storage, electronic equipment and storage medium
US20150277723A1 (en) Exporting a component of a currently displayed user interface to a development system
CN110209391B (en) Plug-in package generation method and device, electronic equipment and readable storage medium
CN114282550B (en) Method, device and related components for realizing QT multi-language translation system
US11526336B2 (en) Community-oriented, cloud-based digital annealing platform
CN111279350B (en) System and method for providing globalization features in service management application interfaces

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant