WO2019041889A1 - Wording modifying method and device - Google Patents
Wording modifying method and device Download PDFInfo
- Publication number
- WO2019041889A1 WO2019041889A1 PCT/CN2018/087092 CN2018087092W WO2019041889A1 WO 2019041889 A1 WO2019041889 A1 WO 2019041889A1 CN 2018087092 W CN2018087092 W CN 2018087092W WO 2019041889 A1 WO2019041889 A1 WO 2019041889A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- term
- language
- source code
- corrected
- code file
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
- G06F9/454—Multi-language systems; Localisation; Internationalisation
Definitions
- the present disclosure relates to, but is not limited to, the field of network data processing technology, and in particular to a term modification method and a term modification device.
- Terminal internationalization needs to translate the words on the user interface (User Interface, UI) of each country to meet user needs. Because the terms on the UI have professional and local habits, they are not accurately described by professional translators. Therefore, customers or front-time testers often ask the current terms to be inaccurate and need to be re-translated and provide specific translation results. The developer then modifies the source code based on these translations, compiles and verifies it, and finally provides the correct version to the front tester.
- UI User Interface
- the present disclosure provides a term modification method and a term modification device, which can improve the work efficiency of term fault modification.
- An embodiment of the present disclosure provides a method for modifying a term, including:
- the synchronization application submitted to the central database is approved, and when the approval is passed, the corrected entries in the local database are synchronized to the central database;
- the attributes of the term include a term primary key and a term value.
- the attribute of the term further includes an entry number for indicating the number of terms of the two-dimensional node.
- the obtaining the attributes of the term to be corrected further includes:
- the first term data and the second term data are combined into a total term data including a term primary key, a first language term value, and a second language term value, and the total term data is stored in a local database.
- the storing the total term data into a local database includes:
- the path of the source code file of the first language or the path of the source code file of the second language is stored in the local database, and the first term data and the second term data belonging to the same original source code file are stored to the local database. In the same data table.
- the method before the obtaining the attribute of the term to be corrected, the method further includes:
- the source code file is modified according to the corrected terms in the central database, including:
- the source code file is modified according to the corrected entry in the intermediate file.
- the embodiment of the present disclosure further provides an entry modification device, including a correction unit, an approval unit, and a join unit, wherein:
- the correction unit is configured to: obtain an attribute of the item to be corrected, correct the item to be corrected in the local database according to the acquired attribute of the item to be corrected, submit a synchronization application to the central database, and notify the approval unit;
- the approval unit is set to: receive the notification of the correction unit, approve the synchronization application submitted to the central database, and when the approval is passed, synchronize the corrected entries in the local database to the central database, and notify the joining unit;
- the merge unit is set to: receive the notification of the approval unit, obtain the source code file of one or more branches, modify the source code file according to the corrected entry in the central database, and compile and verify and merge into the code server.
- the attributes of the term include a term primary key and a term value.
- the method further includes extracting a merging unit, the extracting merging unit is configured to: acquire a source code file of the first language, and extract the first vocabulary data including the vocabulary primary key and the first language vocabulary value Obtaining a source code file of the second language, extracting second term data including a term primary key and a second language term value; combining the first term data and the second term data into a terminating primary key, first The total term data of the language term value and the second language term value, and the total term data is stored in the local database.
- the extracting merging unit is configured to: acquire a source code file of the first language, and extract the first vocabulary data including the vocabulary primary key and the first language vocabulary value Obtaining a source code file of the second language, extracting second term data including a term primary key and a second language term value; combining the first term data and the second term data into a terminating primary key, first The total term data of the language term value and the second language term value, and the total term data is stored in the local database.
- the extracting and merging unit is set to:
- the path of the source code file of the first language or the path of the source code file of the second language is stored in the local database, and the first term data and the second term data belonging to the same original source code file are stored to the local database. In the same data table.
- Embodiments of the present disclosure also provide a computer readable storage medium storing computer executable instructions that, when executed, implement the above-described term modification method.
- modification method and the term modification device provided by the present disclosure reduce the intermediate communication link by correcting the term to be corrected in the local database, synchronizing to the central database, and then combining the source code files of one or more branches. , greatly reducing labor costs, improving the efficiency of the modification of the terminology, and accumulating a constantly enriched central database.
- FIG. 1 is a schematic flowchart diagram of a method for modifying a term according to an embodiment of the present disclosure
- FIG. 2 is a schematic structural diagram of a term modification device according to a first embodiment of the present disclosure
- FIG. 3 is a schematic structural diagram of an apparatus for modifying a term according to a second embodiment of the present disclosure
- FIG. 4 is a schematic structural diagram of a term modification system according to an alternative embodiment of the present disclosure.
- FIG. 5 is a schematic diagram of a format of a table field defined by a term modification system according to an alternative embodiment of the present disclosure
- FIG. 6 is a schematic flowchart of a method for modifying a term of a term modification system according to an alternative embodiment of the present disclosure
- FIG. 7 is a schematic diagram of a new entry learning translation process of the term modification system according to an alternative embodiment of the present disclosure.
- a method for modifying a term according to the present disclosure includes the following steps:
- Step 101 Acquire an attribute of the item to be corrected, correct the item to be corrected in a local database according to the acquired attribute of the item to be corrected, and submit a synchronization application to the central database;
- the attributes of the term include a term key id and a term value.
- the method further includes:
- the first term data and the second term data are combined into a total term data including a term primary key, a first language term value, and a second language term value, and the total term data is stored in a local database.
- the storing the total term data into a local database including:
- the path of the source code file of the first language or the path of the source code file of the second language is stored in the local database, and the first term data and the second term data belonging to the same original source code file are stored to the local database. In the same data table.
- the sources of the two first languages or the second languages can be determined by determining whether the similarity between the paths of the source code files of the two first languages or the second languages is greater than a preset similarity threshold. Whether the code file belongs to the same original source code file.
- the path of the source code file of a first language or a second language is A ⁇ B ⁇ C ⁇ D
- the path of the source code file of another first language or the second language is B ⁇ C ⁇ D
- the similarity between the paths defining the source code files of the two first languages or the second languages is the ratio of the same number of folders to the maximum number of folders, and the same folder is B, C, D, so The similarity is 3/4
- the preset similarity threshold is 70%, the source code files of the two first languages or the second languages are considered to belong to the same original source code file.
- the method further includes:
- the attribute of the term further includes an item id for indicating a number of terms of the value of the two-dimensional node.
- item number is used to describe the attributes of the child nodes within the two-dimensional node.
- the following two-dimensional data contains three item attributes, which are described by item0, item1, and item2, respectively:
- string array name "preferred network mode selection_world mode (preferred_network_mode_choices_world_mode)">
- the method further includes:
- first term data including a term primary key, an item number, and a first language term value
- the method further includes:
- Step 102 Approve the synchronization application submitted to the central database, and when the approval is passed, synchronize the corrected entries in the local database to the central database;
- the approval can be manual approval or automated approval.
- the semantics, grammar and sentence structure of the entry can be checked by the relevant translation software; if it is manually approved, it can be passed. More professional and more localized manual inspections are approved.
- Step 103 Acquire one or more branch source code files, modify the source code file according to the corrected terms in the central database, and compile and verify and merge into the code server.
- the modifying the source code file according to the corrected term in the central database comprises:
- the source code file is modified according to the corrected entry in the intermediate file.
- the intermediate file is an Excel format file.
- a term modification device includes a correction unit 201, an approval unit 202, and a join unit 203, wherein:
- the correcting unit 201 is configured to: obtain an attribute of the item to be corrected, correct the item to be corrected in a local database according to the acquired attribute of the item to be corrected, and submit a synchronization application to the central database, and notify Approval unit 202;
- the approval unit 202 is configured to: receive the notification of the correction unit 201, and approve the synchronization application submitted to the central database, and when the approval is passed, synchronize the corrected entries in the local database to the central database, and notify the integration.
- the merging unit 203 is configured to: receive the notification of the approval unit 202, acquire the source code file of one or more branches, modify the source code file according to the corrected entry in the central database, and compile and verify the code into the code. server.
- the attributes of the entry include a term primary key id and a term value.
- the attribute of the correction unit 201 according to the acquired term to be corrected may be according to the term primary key.
- the term modification device further includes an extract and merge unit 204, configured to: obtain a source code file of the first language, and extract a first value including a term primary key and a first language term value.
- Term data acquiring a source code file of the second language, extracting second term data including a term primary key and a second language term value; and combining the first term data and the second term data into a terminating primary key
- the total term data of the first language term value and the second language term value, and the total term data is stored in the local database.
- the extraction and merge unit 204 is configured to:
- the path of the source code file of the first language or the path of the source code file of the second language is stored in the local database, and the first term data and the second term data belonging to the same original source code file are stored to the local database. In the same data table.
- the extract and merge unit 204 is further configured to:
- the attribute of the term further includes an item number item id for indicating the number of terms of the two-dimensional node.
- the extract and merge unit 204 is further configured to:
- Obtaining a source code file of the first language extracting first term data including a term primary key, an entry number, and a first language term value; acquiring a source code file of the second language, extracting the entry primary key, the entry number, and the The second term data of the second language term value; combining the first term data and the second term data into a total word including the term primary key, the item number, the first language term value, and the second language term value Strip data and store the total term data in a local database.
- the extract and merge unit 204 is further configured to:
- the joining unit 203 is configured to:
- the source code file is modified according to the corrected entry in the intermediate file.
- the intermediate file is an Excel format file.
- the entry modification system of the optional embodiment includes a Git script, a terminology tool, a central database of terms, and an online modification of the terminology software of the mobile phone, wherein:
- the Git script is set to: obtain an eXtensible Markup Language (xml) file of a different Git repository, and encapsulate the entry tool command, update the entry to be entered into the xml file, and then pass the Git script. Uploaded to the Git repository;
- xml eXtensible Markup Language
- the term tool is set to: provide conversion of xml file and Excel file, and also provide xml file into Structured Query Language (SQL) database (Data Base, DB) file to modify the entry software of mobile phone online Use, and synchronize the functions to be entered into the entry from the central database of the entry;
- SQL Structured Query Language
- DB Data Base
- the central database of the entry is set to: a database for storing various language terms, and also provides a network interface for the term reference function and various modified terms;
- the mobile phone online modification term software is a client software.
- the online error editing term is used to obtain the attribute of the error entry, and then the local SQL DB library of the mobile phone filters out whether the attribute is present.
- the entry when there is a term for the attribute, obtains a data item with the attribute entry, and then corrects the data item with the correct data, and finally uploads it to the central database of the entry.
- Git is an open source version control software developed to help manage Linux kernel development. It can efficiently and quickly handle project version management from very small to very large.
- the entry is stored in the form of a node in xml format.
- a node has multiple attributes and a value of a term, where the primary key id (indicated by attribute 1 in Figure 5) and the node word.
- the bar values form a dictionary pair, so that the dictionary pairs of the two languages (the English term is the reference language) are merged, and the two languages constituting a key id form a comparison item, considering that there are some small node lists in some nodes.
- Two-dimensional nodes (regardless of three-dimensional nodes), so on the basis of the previous, add an attribute item id (indicated by attribute 2 in Figure 5) to describe the attributes of the child nodes. Since the nodes of the second dimension have some attributes, some do not.
- the attribute has only the value (term), so the item id only records the sequence number of the child node.
- phoneAppLabel is the key id
- Cellular Data is the English value (values);
- Another example is the following two-dimensional data:
- the above two-dimensional data has three item attributes, which are described by 0, 1, and 2, respectively.
- each table data will have four attributes: key id, item id, English term value and other language term values, but the data belongs to the xml information in a certain directory, that is, there is another directory. The information is not described.
- the module is used to describe this temporarily, indicating that the data belongs to a module.
- the actual meaning of the module is assigned by the relative path of the xml file, which is the relative path between the path of the entry tool and the xml file.
- the format is module _key id, the fourth row of the first row specifies the specific other language names.
- Xml2excel conversion First extract the data of the three attributes of key id, item id and English term value from the English xml file, and then select an xml file of another language to extract the key id, item id and other language terms.
- the attribute data, then the three attribute data lists of two different languages are merged into one four attribute data list, and the merge principle is as follows:
- the key id of the English language is used. If the key id is also available in other languages, the entries in other languages are filled in the English-based data list as the fourth attribute. If not, you don't have to fill it out. After this, it can be determined whether the key id has been translated by whether the fourth attribute is empty. Finally, the information is saved into different Excel files as required and provided for use by others.
- Xml2sql conversion similar to the xml2excel conversion instruction (represented by instruction 1) function, but the data extracted from the xml file is stored in the DB file that can be used by SQL for the mobile phone to modify the entry software query.
- Sync2excel conversion download the required entry from the central database of the entry, the generated Excel file is the same as the Excel file format generated by the xml2excel function.
- All2excel conversion xml2excel conversion instructions generate Excel tables in two languages, and all2excel is a large table that combines all defined language column attributes.
- Git repository For the commercially available mobile phone terminal, there is only one Git repository set to store the mobile phone source code version at the beginning, which has a relatively stable resource xml file and directory structure. But with platform upgrades, custom developments, and Git repositories pulled out by various stable projects, some directory results are the same, but the directory names have changed; even more so, the directory structure has changed. The consequence of this is that the relative path is too many as the module name (key id), but the xml file inside is similar. As a result, the central database of entries will be very large as the number of modules increases, and in fact many of the entries are duplicated.
- the optional operation is to map multiple similar directories into one directory. Although there is a many-to-one mapping relationship, there is only one such correspondence in each Git repository, so there is actually a one-to-one relationship for a specific Git repository operation, which means that it cannot be imported due to ambiguity. .
- Module mapping is used as a configuration item for the terminology tool, for a simple example:
- Basemodule packages ⁇ zte ⁇ VideoPlayer ⁇ res,packages ⁇ VideoPlayer ⁇ res
- the original module is uniformly assigned to the basemodule configuration item, and then a mapped configuration item is assigned to each original module;
- Xml2excel command first traverse the current folder, get all the original module list, and then compare with the basemodule module one by one to confirm whether to do mapping, when the comparison confirms to do the mapping, there can be a mapping relationship behind From which the mapped module is obtained.
- the entry modification method of this alternative embodiment may include the following steps:
- the mobile phone entry acquisition software matches a data item from the local database file through the main attribute of the entry, and then submits the application to the central database of the entry;
- the central database approval of the entry (either through manual approval or through automated approval), after adding a new unincorporated data flag, and then notifying the automatic update system;
- the automatic update system After receiving the notification of the unincorporated data, the automatic update system calls the Sync2excel command (indicated by the instruction 2) to synchronize the unincorporated data in the central database to the local Excel file;
- the Git script traverses the xml file of one or more branches according to the existing repository definition, and then calls the excel2xml command to merge the modified entry into the xml file, and then automatically compiles the entire code. When there is no error, it indicates that excel2xml is merged. Correct, and finally can be integrated into the Git repository, thus enabling online modification of the terms.
- modification method and the term modification device provided by the present disclosure reduce the intermediate communication link by correcting and synchronizing to the central database in the local database, and then combining the source code files of one or more branches, thereby greatly reducing the manpower
- the cost has improved the efficiency of the change of the terminology and accumulated a constantly enriched central database.
- Embodiments of the present disclosure also provide a computer readable storage medium storing computer executable instructions that, when executed, implement the above-described term modification method.
- the term computer storage medium includes volatile and nonvolatile, implemented in any method or technology for storing information, such as computer readable instructions, data structures, program modules or other data. Sex, removable and non-removable media.
- the computer storage medium includes, but is not limited to, Random Access Memory (RAM), Read-Only Memory (ROM), and Electrically Erasable Programmable Read-only Memory (EEPROM). Flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or Any other medium used to store the desired information and that can be accessed by the computer.
- communication media typically includes computer readable instructions, data structures, program modules or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and can include any information delivery media. .
- modification method and the term modification device provided by the present disclosure reduce the intermediate communication link by correcting the term to be corrected in the local database, synchronizing to the central database, and then combining the source code files of one or more branches. , greatly reducing labor costs, improving the efficiency of the modification of the terminology, and accumulating a constantly enriched central database.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
本公开涉及但不限于网络数据处理技术领域,尤其是一种词条修改方法和词条修改装置。The present disclosure relates to, but is not limited to, the field of network data processing technology, and in particular to a term modification method and a term modification device.
终端国际化需要为每个国家的手机用户界面(User Interface,UI)上词条(Wording)进行翻译,以达到用户需求。由于UI上的词条具有专业性和地方习性,不是专业翻译就一定能准确描述的,因此经常有客户或前方测试人员提出当前词条不准确而需要重新翻译,并提供特定的翻译结果。然后,开发人员根据这些翻译结果修改源码,再进行编译、验证,最后提供正确版本给前方测试人员。Terminal internationalization needs to translate the words on the user interface (User Interface, UI) of each country to meet user needs. Because the terms on the UI have professional and local habits, they are not accurately described by professional translators. Therefore, customers or front-time testers often ask the current terms to be inaccurate and need to be re-translated and provide specific translation results. The developer then modifies the source code based on these translations, compiles and verifies it, and finally provides the correct version to the front tester.
发明内容Summary of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
实现上述前方词条故障修改有太多的人为介入,往往需要几天的时间,工作效率低下,并且任何一个词条的不合适,都需要开发人员在源码中修改、编译和验证,对人力也是极大的浪费。There are too many human interventions to implement the above-mentioned front-entry fault modification, which often takes several days, work inefficiency, and the suitability of any one of the terms requires developers to modify, compile, and verify in the source code. Great waste.
本公开提供了一种词条修改方法和词条修改装置,能够提高词条故障修改的工作效率。The present disclosure provides a term modification method and a term modification device, which can improve the work efficiency of term fault modification.
本公开实施例提供了一种词条修改方法,包括:An embodiment of the present disclosure provides a method for modifying a term, including:
获取待更正的词条的属性,根据所获取的待更正的词条的属性在本地数据库中对所述待更正的词条进行更正,向中央数据库提交同步申请;Obtaining an attribute of the item to be corrected, correcting the item to be corrected in a local database according to the obtained attribute of the item to be corrected, and submitting a synchronization application to the central database;
对提交至中央数据库的同步申请进行审批,当审批通过时,将本地数据库中更正后的词条同步至中央数据库中;The synchronization application submitted to the central database is approved, and when the approval is passed, the corrected entries in the local database are synchronized to the central database;
获取一个或多个分支的源代码文件,根据中央数据库中更正后的词条修 改源代码文件,并进行编译验证后合入到代码服务器。Obtain source code files for one or more branches, modify the source code files according to the corrected entries in the central database, and compile and verify them to join the code server.
在一种示例性实施方式中,所述词条的属性包括词条主键和词条值。In an exemplary embodiment, the attributes of the term include a term primary key and a term value.
在一种示例性实施方式中,所述词条的属性还包括用于表示二维节点的词条值项数的条目编号。In an exemplary embodiment, the attribute of the term further includes an entry number for indicating the number of terms of the two-dimensional node.
在一种示例性实施方式中,所述获取待更正的词条的属性之前还包括:In an exemplary embodiment, the obtaining the attributes of the term to be corrected further includes:
获取第一语种的源代码文件,提取包括词条主键和第一语种词条值的第一词条数据;Obtaining a source code file of the first language, and extracting the first term data including the term primary key and the first language term value;
获取第二语种的源代码文件,提取包括词条主键和第二语种词条值的第二词条数据;Obtaining a source code file of the second language, and extracting second term data including a term primary key and a second language term value;
将第一词条数据和第二词条数据合并成包含词条主键、第一语种词条值和第二语种词条值的总词条数据,并将总词条数据存储至本地数据库中。The first term data and the second term data are combined into a total term data including a term primary key, a first language term value, and a second language term value, and the total term data is stored in a local database.
在一种示例性实施方式中,所述将总词条数据存储至本地数据库中,包括:In an exemplary embodiment, the storing the total term data into a local database includes:
将第一语种的源代码文件的路径或第二语种的源代码文件的路径存入本地数据库中,并将属于相同原始源代码文件的第一词条数据和第二词条数据存储至本地数据库中的同一数据表中。The path of the source code file of the first language or the path of the source code file of the second language is stored in the local database, and the first term data and the second term data belonging to the same original source code file are stored to the local database. In the same data table.
在一种示例性实施方式中,所述获取待更正的词条的属性之前,还包括:In an exemplary embodiment, before the obtaining the attribute of the term to be corrected, the method further includes:
获取所有语种的源代码文件,提取包括词条主键和各种语种词条值的词条数据,并将所提取的词条数据存入中央数据库中。Obtain source code files of all languages, extract term data including entry primary key and various language term values, and store the extracted term data in a central database.
在一种示例性实施方式中,根据中央数据库中更正后的词条修改源代码文件,包括:In an exemplary embodiment, the source code file is modified according to the corrected terms in the central database, including:
将所述中央数据库中更正后的词条同步至中间文件;Synchronizing the corrected terms in the central database to an intermediate file;
根据中间文件中更正后的词条修改所述源代码文件。The source code file is modified according to the corrected entry in the intermediate file.
本公开实施例还提供了一种词条修改装置,包括更正单元、审批单元和合入单元,其中:The embodiment of the present disclosure further provides an entry modification device, including a correction unit, an approval unit, and a join unit, wherein:
更正单元,设置为:获取待更正的词条的属性,根据所获取的待更正的词条的属性在本地数据库中对所述待更正的词条进行更正,向中央数据库提交同步申请,通知审批单元;The correction unit is configured to: obtain an attribute of the item to be corrected, correct the item to be corrected in the local database according to the acquired attribute of the item to be corrected, submit a synchronization application to the central database, and notify the approval unit;
审批单元,设置为:接收到更正单元的通知,对提交至中央数据库的同 步申请进行审批,当审批通过时,将本地数据库中更正后的词条同步至中央数据库中,并通知合入单元;The approval unit is set to: receive the notification of the correction unit, approve the synchronization application submitted to the central database, and when the approval is passed, synchronize the corrected entries in the local database to the central database, and notify the joining unit;
合入单元,设置为:接收到审批单元的通知,获取一个或多个分支的源代码文件,根据中央数据库中更正后的词条修改源代码文件,并进行编译验证后合入到代码服务器。The merge unit is set to: receive the notification of the approval unit, obtain the source code file of one or more branches, modify the source code file according to the corrected entry in the central database, and compile and verify and merge into the code server.
在一种示例性实施方式中,所述词条的属性包括词条主键和词条值。In an exemplary embodiment, the attributes of the term include a term primary key and a term value.
在一种示例性实施方式中,还包括提取合并单元,所述提取合并单元设置为:获取第一语种的源代码文件,提取包括词条主键和第一语种词条值的第一词条数据;获取第二语种的源代码文件,提取包括词条主键和第二语种词条值的第二词条数据;将第一词条数据和第二词条数据合并成包含词条主键、第一语种词条值和第二语种词条值的总词条数据,并将总词条数据存储至本地数据库中。In an exemplary embodiment, the method further includes extracting a merging unit, the extracting merging unit is configured to: acquire a source code file of the first language, and extract the first vocabulary data including the vocabulary primary key and the first language vocabulary value Obtaining a source code file of the second language, extracting second term data including a term primary key and a second language term value; combining the first term data and the second term data into a terminating primary key, first The total term data of the language term value and the second language term value, and the total term data is stored in the local database.
在一种示例性实施方式中,所述提取合并单元是设置为:In an exemplary embodiment, the extracting and merging unit is set to:
将第一语种的源代码文件的路径或第二语种的源代码文件的路径存入本地数据库中,并将属于相同原始源代码文件的第一词条数据和第二词条数据存储至本地数据库中的同一数据表中。The path of the source code file of the first language or the path of the source code file of the second language is stored in the local database, and the first term data and the second term data belonging to the same original source code file are stored to the local database. In the same data table.
本公开实施例还提供了一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被执行时实现上述词条修改方法。Embodiments of the present disclosure also provide a computer readable storage medium storing computer executable instructions that, when executed, implement the above-described term modification method.
本公开的技术方案,具有如下有益效果:The technical solution of the present disclosure has the following beneficial effects:
本公开提供的词条修改方法和词条修改装置,通过在本地数据库中更正待更正的词条、同步至中央数据库,再合入一个或多个分支的源代码文件,减少了中间沟通的环节,大幅减少了人力成本,提高了词条故障修改的工作效率,并且积累了不断丰富的中央数据库。The term modification method and the term modification device provided by the present disclosure reduce the intermediate communication link by correcting the term to be corrected in the local database, synchronizing to the central database, and then combining the source code files of one or more branches. , greatly reducing labor costs, improving the efficiency of the modification of the terminology, and accumulating a constantly enriched central database.
在阅读并理解了附图和详细描述后,可以明白其他方面。Other aspects will be apparent upon reading and understanding the drawings and detailed description.
附图概述BRIEF abstract
图1为本公开实施例的一种词条修改方法的流程示意图;FIG. 1 is a schematic flowchart diagram of a method for modifying a term according to an embodiment of the present disclosure;
图2为本公开第一实施例的一种词条修改装置的结构示意图;2 is a schematic structural diagram of a term modification device according to a first embodiment of the present disclosure;
图3为本公开第二实施例的一种词条修改装置的结构示意图;3 is a schematic structural diagram of an apparatus for modifying a term according to a second embodiment of the present disclosure;
图4为本公开可选实施例的词条修改系统的结构示意图;4 is a schematic structural diagram of a term modification system according to an alternative embodiment of the present disclosure;
图5为本公开可选实施例的词条修改系统定义的表字段格式示意图;5 is a schematic diagram of a format of a table field defined by a term modification system according to an alternative embodiment of the present disclosure;
图6为本公开可选实施例的词条修改系统的词条修改方法的流程示意图;6 is a schematic flowchart of a method for modifying a term of a term modification system according to an alternative embodiment of the present disclosure;
图7为本公开可选实施例的词条修改系统的新词条借鉴翻译流程示意图。FIG. 7 is a schematic diagram of a new entry learning translation process of the term modification system according to an alternative embodiment of the present disclosure.
本公开的较佳实施方式Preferred embodiment of the present disclosure
下面结合附图对本公开的实施方式进行描述。Embodiments of the present disclosure will be described below with reference to the accompanying drawings.
如图1所示,根据本公开的一种词条修改方法,包括如下步骤:As shown in FIG. 1, a method for modifying a term according to the present disclosure includes the following steps:
步骤101:获取待更正的词条的属性,根据所获取的待更正的词条的属性在本地数据库中对所述待更正的词条进行更正,向中央数据库提交同步申请;Step 101: Acquire an attribute of the item to be corrected, correct the item to be corrected in a local database according to the acquired attribute of the item to be corrected, and submit a synchronization application to the central database;
可选地,所述词条的属性包括词条主键(key id)和词条值。Optionally, the attributes of the term include a term key id and a term value.
可选地,所述步骤101之前,还包括:Optionally, before the
获取第一语种的源代码文件,提取包括词条主键和第一语种词条值的第一词条数据;Obtaining a source code file of the first language, and extracting the first term data including the term primary key and the first language term value;
获取第二语种的源代码文件,提取包括词条主键和第二语种词条值的第二词条数据;Obtaining a source code file of the second language, and extracting second term data including a term primary key and a second language term value;
将第一词条数据和第二词条数据合并成包含词条主键、第一语种词条值和第二语种词条值的总词条数据,并将总词条数据存储至本地数据库中。The first term data and the second term data are combined into a total term data including a term primary key, a first language term value, and a second language term value, and the total term data is stored in a local database.
可选地,所述将总词条数据存储至本地数据库中,包括:Optionally, the storing the total term data into a local database, including:
将第一语种的源代码文件的路径或第二语种的源代码文件的路径存入本地数据库中,并将属于相同原始源代码文件的第一词条数据和第二词条数据存储至本地数据库中的同一数据表中。The path of the source code file of the first language or the path of the source code file of the second language is stored in the local database, and the first term data and the second term data belonging to the same original source code file are stored to the local database. In the same data table.
值得说明的是,可以通过判断两个第一语种或第二语种的源代码文件的路径之间的相似度是否大于预先设置的相似度阈值来判断这两个第一语种或 第二语种的源代码文件是否属于相同原始源代码文件。例如,如果某一第一语种或第二语种的源代码文件的路径为A\B\C\D,另一第一语种或第二语种的源代码文件的路径为B\C\D,如果定义两个第一语种或第二语种的源代码文件的路径之间的相似度为相同的文件夹数与最长文件夹数的比值,此时相同的文件夹为B、C、D,因此相似度为3/4,如果预先设置的相似度阈值为70%,则认为这两个第一语种或第二语种的源代码文件属于相同的原始源代码文件。It is worth noting that the sources of the two first languages or the second languages can be determined by determining whether the similarity between the paths of the source code files of the two first languages or the second languages is greater than a preset similarity threshold. Whether the code file belongs to the same original source code file. For example, if the path of the source code file of a first language or a second language is A\B\C\D, the path of the source code file of another first language or the second language is B\C\D, if The similarity between the paths defining the source code files of the two first languages or the second languages is the ratio of the same number of folders to the maximum number of folders, and the same folder is B, C, D, so The similarity is 3/4, and if the preset similarity threshold is 70%, the source code files of the two first languages or the second languages are considered to belong to the same original source code file.
可选地,所述步骤101之前,还包括:Optionally, before the
获取所有语种的源代码文件,提取包括词条主键和各种语种词条值的词条数据,并将所提取的词条数据存入中央数据库中。Obtain source code files of all languages, extract term data including entry primary key and various language term values, and store the extracted term data in a central database.
值得说明的是,手机终端的定制版本越多,词条的翻译工作也越大。对于同一语系的不同国家的UI词条,没有必要全部重新翻译,也可借鉴同一语系其他国家的翻译,这样可以大幅减少翻译成本。通过在中央数据库中保存各种语种的词条值,当需要对一个新定制的终端的词条翻译成另一个小语种时,先查找数据库中是否包含待翻译的词条以及相应的小语种值,当包含待翻译的词条以及相应的小语种值时,可直接借鉴已有的翻译。It is worth noting that the more customized versions of mobile terminals, the greater the translation of the entries. For UI entries in different countries of the same language family, it is not necessary to re-translate all of them, and you can also borrow translations from other countries in the same language system, which can greatly reduce translation costs. By storing the entry values of various languages in the central database, when it is necessary to translate the entry of a newly customized terminal into another small language, first find out whether the database contains the term to be translated and the corresponding small language value. When the words to be translated and the corresponding small language values are included, the existing translations can be directly used.
可选地,所述词条的属性还包括用于表示二维节点的词条值项数的条目编号(item id)。Optionally, the attribute of the term further includes an item id for indicating a number of terms of the value of the two-dimensional node.
值得说明的是,所述条目编号用于描述二维节点内的子节点的属性。例如,如下的二维数据包含三个条目(item)属性,分别用item0、item1和item2描述:It is worth noting that the item number is used to describe the attributes of the child nodes within the two-dimensional node. For example, the following two-dimensional data contains three item attributes, which are described by item0, item1, and item2, respectively:
<字符串阵列名称(string-array name)="优选的网络模式选择_世界模式(preferred_network_mode_choices_world_mode)"><string array name (string-array name)="preferred network mode selection_world mode (preferred_network_mode_choices_world_mode)">
<item>全局的(Global)</item><item>global (Global)</item>
<item>长期演进(Long Term Evolution,LTE)/码分多址(Code Division Multiple Access,CDMA)</item><item>Long Term Evolution (LTE)/Code Division Multiple Access (CDMA)</item>
<item>LTE/全球移动通信系统(Global System for Mobile Communication,GSM)/通用移动通信系统(Universal Mobile Telecommunications System,UMTS)</item><item>LTE/Global System for Mobile Communication (GSM)/Universal Mobile Telecommunications System (UMTS)</item>
</string-array>。</string-array>.
可选地,所述步骤101之前,还包括:Optionally, before the
获取第一语种的源代码文件,提取包括词条主键、条目编号和第一语种词条值的第一词条数据;Obtaining a source code file of the first language, and extracting first term data including a term primary key, an item number, and a first language term value;
获取第二语种的源代码文件,提取包括词条主键、条目编号和第二语种词条值的第二词条数据;Obtaining a source code file of the second language, and extracting second item data including a term primary key, an item number, and a second language term value;
将第一词条数据和第二词条数据合并成包含词条主键、条目编号、第一语种词条值和第二语种词条值的总词条数据,并将总词条数据存储至本地数据库中。Combining the first term data and the second term data into a total term data including a term primary key, an entry number, a first language term value, and a second language term value, and storing the total term data to the local In the database.
可选地,所述步骤101之前,还包括:Optionally, before the
获取所有语种的源代码文件,提取包括词条主键、条目编号和各种语种词条值的词条数据,并将所提取的词条数据存入中央数据库中。Obtain source code files of all languages, extract term data including entry primary key, entry number and various language term values, and store the extracted term data in a central database.
步骤102:对提交至中央数据库的同步申请进行审批,当审批通过时,将本地数据库中更正后的词条同步至中央数据库中;Step 102: Approve the synchronization application submitted to the central database, and when the approval is passed, synchronize the corrected entries in the local database to the central database;
值得说明的是,此处的审批可以为人工审批或者自动化审批,例如,如果为自动化审批,可以通过相关的翻译软件对词条的语义、语法和句子结构进行检查;如果为人工审批,可以通过更专业更本土化的人工检查进行审批。It is worth noting that the approval here can be manual approval or automated approval. For example, if it is an automated approval, the semantics, grammar and sentence structure of the entry can be checked by the relevant translation software; if it is manually approved, it can be passed. More professional and more localized manual inspections are approved.
步骤103:获取一个或多个分支的源代码文件,根据中央数据库中更正后的词条修改源代码文件,并进行编译验证后合入到代码服务器。Step 103: Acquire one or more branch source code files, modify the source code file according to the corrected terms in the central database, and compile and verify and merge into the code server.
可选地,所述根据中央数据库中更正后的词条修改源代码文件,包括:Optionally, the modifying the source code file according to the corrected term in the central database comprises:
将所述中央数据库中更正后的词条同步至中间文件;Synchronizing the corrected terms in the central database to an intermediate file;
根据中间文件中更正后的词条修改所述源代码文件。The source code file is modified according to the corrected entry in the intermediate file.
可选地,所述中间文件为Excel格式文件。Optionally, the intermediate file is an Excel format file.
如图2示,根据本公开的一种词条修改装置,包括更正单元201、审批单元202和合入单元203,其中:As shown in FIG. 2, a term modification device according to the present disclosure includes a
更正单元201,设置为:获取待更正的词条的属性,根据所获取的待更正的词条的属性在本地数据库中对所述待更正的词条进行更正,向中央数据库提交同步申请,通知审批单元202;The correcting
审批单元202,设置为:接收到更正单元201的通知,对提交至中央数 据库的同步申请进行审批,当审批通过时,将本地数据库中更正后的词条同步至中央数据库中,并通知合入单元203;The
合入单元203,设置为:接收到审批单元202的通知,获取一个或多个分支的源代码文件,根据中央数据库中更正后的词条修改源代码文件,并进行编译验证后合入到代码服务器。The merging
可选地,所述词条的属性包括词条主键key id和词条值。Optionally, the attributes of the entry include a term primary key id and a term value.
可选地,所述更正单元201的根据所获取的待更正的词条的属性,可为根据词条主键。Optionally, the attribute of the
可选地,如图3所示,所述词条修改装置还包括提取合并单元204,设置为:获取第一语种的源代码文件,提取包括词条主键和第一语种词条值的第一词条数据;获取第二语种的源代码文件,提取包括词条主键和第二语种词条值的第二词条数据;将第一词条数据和第二词条数据合并成包含词条主键、第一语种词条值和第二语种词条值的总词条数据,并将总词条数据存储至本地数据库中。Optionally, as shown in FIG. 3, the term modification device further includes an extract and merge
可选地,所述提取合并单元204是设置为:Optionally, the extraction and merge
将第一语种的源代码文件的路径或第二语种的源代码文件的路径存入本地数据库中,并将属于相同原始源代码文件的第一词条数据和第二词条数据存储至本地数据库中的同一数据表中。The path of the source code file of the first language or the path of the source code file of the second language is stored in the local database, and the first term data and the second term data belonging to the same original source code file are stored to the local database. In the same data table.
可选地,所述提取合并单元204还设置为:Optionally, the extract and merge
获取所有语种的源代码文件,提取包括词条主键和各种语种词条值的词条数据,并将所提取的词条数据存入中央数据库中。Obtain source code files of all languages, extract term data including entry primary key and various language term values, and store the extracted term data in a central database.
可选地,所述词条的属性还包括用于表示二维节点的词条值项数的条目编号item id。Optionally, the attribute of the term further includes an item number item id for indicating the number of terms of the two-dimensional node.
可选地,所述提取合并单元204还设置为:Optionally, the extract and merge
获取第一语种的源代码文件,提取包括词条主键、条目编号和第一语种词条值的第一词条数据;获取第二语种的源代码文件,提取包括词条主键、条目编号和第二语种词条值的第二词条数据;将第一词条数据和第二词条数据合并成包含词条主键、条目编号、第一语种词条值和第二语种词条值的总词条数据,并将总词条数据存储至本地数据库中。Obtaining a source code file of the first language, extracting first term data including a term primary key, an entry number, and a first language term value; acquiring a source code file of the second language, extracting the entry primary key, the entry number, and the The second term data of the second language term value; combining the first term data and the second term data into a total word including the term primary key, the item number, the first language term value, and the second language term value Strip data and store the total term data in a local database.
可选地,所述提取合并单元204还设置为:Optionally, the extract and merge
获取所有语种的源代码文件,提取包括词条主键、条目编号和各种语种词条值的词条数据,并将所提取的词条数据存入中央数据库中。Obtain source code files of all languages, extract term data including entry primary key, entry number and various language term values, and store the extracted term data in a central database.
可选地,所述合入单元203是设置为:Optionally, the joining
将所述中央数据库中更正后的词条同步至中间文件;Synchronizing the corrected terms in the central database to an intermediate file;
根据中间文件中更正后的词条修改所述源代码文件。The source code file is modified according to the corrected entry in the intermediate file.
可选地,所述中间文件为Excel格式文件。Optionally, the intermediate file is an Excel format file.
本公开实施例还提供了一个可选的实施例对本公开进行解释。The embodiments of the present disclosure also provide an alternative embodiment to explain the present disclosure.
如图4所示,本可选实施例的词条修改系统包括Git脚本、词条工具、词条中央数据库、手机在线修改词条软件四部分,其中:As shown in FIG. 4, the entry modification system of the optional embodiment includes a Git script, a terminology tool, a central database of terms, and an online modification of the terminology software of the mobile phone, wherein:
所述Git脚本设置为:获取不同的Git仓库的源资源可扩展标记语言(eXtensible Markup Language,xml)文件,并封装词条工具命令,将待录入词条更新到xml文件中,然后通过Git脚本上传到Git仓库中;The Git script is set to: obtain an eXtensible Markup Language (xml) file of a different Git repository, and encapsulate the entry tool command, update the entry to be entered into the xml file, and then pass the Git script. Uploaded to the Git repository;
所述词条工具设置为:提供xml文件和Excel文件的转换,同时也提供xml文件转成结构化查询语言(Structured Query Language,SQL)数据库(Data Base,DB)文件给手机在线修改词条软件使用,以及从词条中央数据库同步待录入词条等功能;The term tool is set to: provide conversion of xml file and Excel file, and also provide xml file into Structured Query Language (SQL) database (Data Base, DB) file to modify the entry software of mobile phone online Use, and synchronize the functions to be entered into the entry from the central database of the entry;
所述词条中央数据库是设置为:存储各种语言词条的数据库,同时还提供词条借鉴功能和各种修改词条的网络接口;The central database of the entry is set to: a database for storing various language terms, and also provides a network interface for the term reference function and various modified terms;
所述手机在线修改词条软件是客户端软件,当在UI界面上发现错误词条时,先通过屏幕在线编辑软件获取错误词条的属性,然后在手机本地SQL DB库过滤出是否具有该属性的词条,当有该属性的词条时,就获取到一条具有该属性词条的数据项,然后用正确的数据修改条数据项,最后上传到词条中央数据库上。The mobile phone online modification term software is a client software. When an error term is found on the UI interface, the online error editing term is used to obtain the attribute of the error entry, and then the local SQL DB library of the mobile phone filters out whether the attribute is present. The entry, when there is a term for the attribute, obtains a data item with the attribute entry, and then corrects the data item with the correct data, and finally uploads it to the central database of the entry.
值得说明的是,Git是为了帮助管理Linux内核开发而开发的一个开放源码的版本控制软件,可以有效、高速地处理从很小到非常大的项目版本管理。It is worth noting that Git is an open source version control software developed to help manage Linux kernel development. It can efficiently and quickly handle project version management from very small to very large.
如图5所示,词条是以xml格式的一个节点的形式保存,一个节点有多个属性和一个词条值,其中词条主键key id(图5中用属性1标示)和该节 点词条值构成一个字典对,这样两种语言(以英语词条值为基准语言)的字典对合并后,构成某key id的两种语言形成对比项,考虑到有些节点内还有小节点列表即二维节点(不考虑三维节点),所以在之前基础上,再增加一个属性item id(图5中用属性2标示)来描述子节点的属性,由于第二维的节点有些有属性,有些没有属性,只有值(词条),所以该item id只记录子节点的序号。As shown in Figure 5, the entry is stored in the form of a node in xml format. A node has multiple attributes and a value of a term, where the primary key id (indicated by attribute 1 in Figure 5) and the node word. The bar values form a dictionary pair, so that the dictionary pairs of the two languages (the English term is the reference language) are merged, and the two languages constituting a key id form a comparison item, considering that there are some small node lists in some nodes. Two-dimensional nodes (regardless of three-dimensional nodes), so on the basis of the previous, add an attribute item id (indicated by attribute 2 in Figure 5) to describe the attributes of the child nodes. Since the nodes of the second dimension have some attributes, some do not. The attribute has only the value (term), so the item id only records the sequence number of the child node.
例如,有如下一维数据:For example, there is one-dimensional data as follows:
<字符串名称(string name)=“电话应用标签”产品("phoneAppLabel"product)="便笺簿(tablet)">蜂窝数据(Cellular Data)</string><string name (string name) = "phone application label" product ("phoneAppLabel" product)="tablet" (tablet data) (Cellular Data) </string>
其中,phoneAppLabel就是key id,Cellular Data作为英语词条值(values);Among them, phoneAppLabel is the key id, and Cellular Data is the English value (values);
如果是小语种,则对应的一维数据为:If it is a small language, the corresponding one-dimensional data is:
<string name="phoneAppLabel"product="tablet">小语种值</string><string name="phoneAppLabel"product="tablet">small language value </string>
又如,有如下二维数据:Another example is the following two-dimensional data:
<string-array name="preferred_network_mode_choices_world_mode"><string-array name="preferred_network_mode_choices_world_mode">
<item>Global</item><item>Global</item>
<item>LTE/CDMA</item><item>LTE/CDMA</item>
<item>LTE/GSM/UMTS</item><item>LTE/GSM/UMTS</item>
</string-array></string-array>
上述二维数据有三个item属性,分别用0、1和2描述。The above two-dimensional data has three item attributes, which are described by 0, 1, and 2, respectively.
也即是说每条表数据将有key id、item id、英语词条值和其他语种词条值四个属性,但是这些数据都是属于某个目录下的xml信息,也就是还有一个目录信息没有描述,暂时用模块来描述这个,表明这些数据属于某个模块,模块实际的含义是用xml文件所在的相对路径来赋值的,就是词条工具运行路径到xml文件之间的相对路径,并且写在每个Excel的第一行第一列,格式为模块_key id,第一行第四列表明特定的其他语种名称。That is to say, each table data will have four attributes: key id, item id, English term value and other language term values, but the data belongs to the xml information in a certain directory, that is, there is another directory. The information is not described. The module is used to describe this temporarily, indicating that the data belongs to a module. The actual meaning of the module is assigned by the relative path of the xml file, which is the relative path between the path of the entry tool and the xml file. And written in the first column of the first row of each Excel, the format is module _key id, the fourth row of the first row specifies the specific other language names.
所述词条工具提供以下指令功能:The term tool provides the following command functions:
xml2excel转换:首先从英语的xml文件中提取key id、item id和英语词条值三个属性的数据,然后选择一个其他语言的xml文件同样提取key id、item id和其它语种词条值三个属性的数据,然后两组不同语言的三个属性数 据列表合并成一个四个属性数据列表,合并原则如下:Xml2excel conversion: First extract the data of the three attributes of key id, item id and English term value from the English xml file, and then select an xml file of another language to extract the key id, item id and other language terms. The attribute data, then the three attribute data lists of two different languages are merged into one four attribute data list, and the merge principle is as follows:
以英语的key id为准,如果其他语种也有该key id,那么其他语种的词条就作为第四个属性填入以英语为主的数据列表。没有的话就不用填了。这样之后就可以通过第四个属性是否为空来确定该key id的是否已经翻译。最后把这些信息按要求存成不同的Excel文件,提供他人使用。The key id of the English language is used. If the key id is also available in other languages, the entries in other languages are filled in the English-based data list as the fourth attribute. If not, you don't have to fill it out. After this, it can be determined whether the key id has been translated by whether the fourth attribute is empty. Finally, the information is saved into different Excel files as required and provided for use by others.
xml2sql转换:类似xml2excel转换指令(可用指令1表示)功能,但是是将xml文件中提取的数据存储至SQL可以使用的DB文件,供手机在线修改词条软件查询使用。Xml2sql conversion: similar to the xml2excel conversion instruction (represented by instruction 1) function, but the data extracted from the xml file is stored in the DB file that can be used by SQL for the mobile phone to modify the entry software query.
excel2xml转换:跟xml2excel转换指令功能相反,是把翻译回来的Excel文件词条合并到xml文件中。Excel2xml conversion: Contrary to the xml2excel conversion command function, the translated Excel file entries are merged into the xml file.
sync2excel转换:从词条中央数据库下载需要合入的词条,生成的Excel文件跟xml2excel功能产生的Excel文件格式一样。Sync2excel conversion: download the required entry from the central database of the entry, the generated Excel file is the same as the Excel file format generated by the xml2excel function.
all2excel转换:xml2excel转换指令生成的是两种语言的Excel表,而all2excel是把所有定义的语言做列属性合并在一起的一张大表。All2excel conversion: xml2excel conversion instructions generate Excel tables in two languages, and all2excel is a large table that combines all defined language column attributes.
对于市售的手机终端来说,刚开始都只有一个设置为存放手机源代码版本的Git仓库,有着相对稳定的资源xml文件以及目录结构。但是随着平台升级、定制开发和各种稳定项目拉出的Git仓库,有些目录结果不变,但是目录名称已经变了;更有甚者就是目录结构也发生变化。这样的后果就是以相对路径作为模块名(key id)的个数太多,而其实里边的xml文件却差不多。导致词条中央数据库会随着模块数增加而非常庞大,而实际上很多词条内容是重复的。For the commercially available mobile phone terminal, there is only one Git repository set to store the mobile phone source code version at the beginning, which has a relatively stable resource xml file and directory structure. But with platform upgrades, custom developments, and Git repositories pulled out by various stable projects, some directory results are the same, but the directory names have changed; even more so, the directory structure has changed. The consequence of this is that the relative path is too many as the module name (key id), but the xml file inside is similar. As a result, the central database of entries will be very large as the number of modules increases, and in fact many of the entries are duplicated.
为此我们可以想办法避免模块数过多,其实质就是如何进行类似模块的合并。可选操作就是把多个类似目录映射成一个目录。虽然是多对一的映射关系,但是每个Git仓库只会存在一个这样的对应关系,所以针对某个特定Git仓库操作的时候其实还是一对一关系,也就说明不会由于歧义导致无法导入。To this end, we can find ways to avoid too many modules, the essence of which is how to merge similar modules. The optional operation is to map multiple similar directories into one directory. Although there is a many-to-one mapping relationship, there is only one such correspondence in each Git repository, so there is actually a one-to-one relationship for a specific Git repository operation, which means that it cannot be imported due to ambiguity. .
因为不能限制词条工具在哪种系统上部署,Windows、Linux和Ios都有可能,所以词条工具使用Python语言(Python是一种面向对象的解释型计算机程序设计语言),保证词条工具可以不进行移植。但是由于不同操作系统 之间在处理某些细节上还是有区别,比如斜杠和反斜杠。而模块的定义[相对路径]里边是有斜杠或者反斜杠的,而且这些模块又都是需要在配置文件中描述的,不能定义多份ini配置文件,而宜做到自适应。所以模块的定义以Window的反斜杠为主,不管在哪种操作系统上导出,输出的模块都是反斜杠,然后根据实际的操作系统先做反斜杠和斜杠替换,以解决该差异。Windows, Linux, and Ios are possible because you can't restrict the deployment of the term tool on any system. So the term tool uses the Python language (Python is an object-oriented interpreted computer programming language), ensuring that the term tool can No porting. However, there are differences in the handling of certain details between different operating systems, such as slashes and backslashes. The definition of the module [relative path] has slashes or backslashes, and these modules need to be described in the configuration file. You cannot define multiple ini configuration files, but you should be adaptive. Therefore, the definition of the module is based on the backslash of Window. Regardless of which operating system is exported, the output modules are backslashes, and then the backslash and slash are replaced according to the actual operating system to solve the problem. difference.
模块映射是作为配置项供词条工具使用的,举个简单的例子:Module mapping is used as a configuration item for the terminology tool, for a simple example:
basemodule=packages\zte\VideoPlayer\res,packages\VideoPlayer\resBasemodule=packages\zte\VideoPlayer\res,packages\VideoPlayer\res
packages\zte\VideoPlayer\res=VideoPlayer\resPackages\zte\VideoPlayer\res=VideoPlayer\res
packages\VideoPlayer\res=VideoPlayer\resPackages\VideoPlayer\res=VideoPlayer\res
首先把原始的模块统一赋值给basemodule配置项,然后为每一条原始模块赋值一条映射后的配置项;First, the original module is uniformly assigned to the basemodule configuration item, and then a mapped configuration item is assigned to each original module;
使用方法:Instructions:
xml2excel命令:首先会遍历当前文件夹,获取所有的原始模块列表,然后逐一跟basemodule的模块进行比对,以确认是否要做映射,当比对确认要做映射时,后边可以有一条映射关系配置,从中获取映射后的模块。Xml2excel command: first traverse the current folder, get all the original module list, and then compare with the basemodule module one by one to confirm whether to do mapping, when the comparison confirms to do the mapping, there can be a mapping relationship behind From which the mapped module is obtained.
如图6所示,本可选实施例的词条修改方法可包括如下步骤:As shown in FIG. 6, the entry modification method of this alternative embodiment may include the following steps:
手机词条获取软件从本地数据库文件中通过词条的主属性匹配一条数据项,修改后向词条中央数据库提交合入申请;The mobile phone entry acquisition software matches a data item from the local database file through the main attribute of the entry, and then submits the application to the central database of the entry;
词条中央数据库审批(可以通过人工审批,也可以通过自动化审批)通过后新增一条未合入数据标志,然后通知自动更新系统;The central database approval of the entry (either through manual approval or through automated approval), after adding a new unincorporated data flag, and then notifying the automatic update system;
自动更新系统接收到有未合入数据的通知后,调用Sync2excel指令(可用指令2表示)将中央数据库中的未合入数据同步至本地的Excel文件;After receiving the notification of the unincorporated data, the automatic update system calls the Sync2excel command (indicated by the instruction 2) to synchronize the unincorporated data in the central database to the local Excel file;
Git脚本根据已有仓库定义遍历取出一个或多个分支的xml文件,然后调用excel2xml命令将修改后的词条合入到xml文件中,然后自动编译整个代码,当没有出错时,表明excel2xml合入正确,最后就可以合入到Git仓库中,从而实现了词条的在线修改。The Git script traverses the xml file of one or more branches according to the existing repository definition, and then calls the excel2xml command to merge the modified entry into the xml file, and then automatically compiles the entire code. When there is no error, it indicates that excel2xml is merged. Correct, and finally can be integrated into the Git repository, thus enabling online modification of the terms.
新词条的借鉴翻译流程如图7所示,首先通过词条工具中的All2xml指令(可用指令3表示)将所有定义的语言做列属性合并在一起以建立一张大表,保存至词条中央数据库中;当有新定制的xml资源时,首先通过词条工 具中的xml2excel转换指令将不同语言的词条数据合并成一个四个属性数据列表,找出其中未翻译的词条数据,即其它语种词条值为空的词条数据,然后跟词条中央数据库中的词条数据进行借鉴比对,当有相应的其它语种词条值时,可以直接借鉴使用,并通过sync2excel转换指令从词条中央数据库下载需要合入的词条,再通过excel2xml转换指令(可用指令4表示)将翻译回来的Excel文件词条合并到xml文件中。The translation process of the new entry is shown in Figure 7. First, all the defined language column attributes are merged together by the All2xml instruction (represented by the instruction 3) in the entry tool to create a large table and save it to the center of the entry. In the database; when there is a new custom xml resource, first merge the term data of different languages into a list of four attribute data through the xml2excel conversion instruction in the entry tool, and find out the untranslated term data, that is, other The vocabulary value of the vocabulary is empty, and then the reference data in the central database of the vocabulary is used for reference comparison. When there are corresponding values of other linguistic terms, they can be directly used for reference and converted from the word by sync2excel. The central database download needs to be merged into the entry, and then the translated Excel file entry is merged into the xml file by the excel2xml conversion instruction (represented by instruction 4).
本公开提供的词条修改方法和词条修改装置,通过在本地数据库中更正、同步至中央数据库,再合入一个或多个分支的源代码文件,减少了中间沟通的环节,大幅减少了人力成本,提高了词条故障修改的工作效率,并且积累了不断丰富的中央数据库。The term modification method and the term modification device provided by the present disclosure reduce the intermediate communication link by correcting and synchronizing to the central database in the local database, and then combining the source code files of one or more branches, thereby greatly reducing the manpower The cost has improved the efficiency of the change of the terminology and accumulated a constantly enriched central database.
本公开实施例还提供了一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被执行时实现上述词条修改方法。Embodiments of the present disclosure also provide a computer readable storage medium storing computer executable instructions that, when executed, implement the above-described term modification method.
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现,相应地,上述实施例中的每个模块/单元可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。本公开不限制于任何特定形式的硬件和软件的结合。One of ordinary skill in the art will appreciate that all or a portion of the steps described above can be accomplished by a program that instructs the associated hardware, such as a read-only memory, a magnetic or optical disk, and the like. Optionally, all or part of the steps of the foregoing embodiments may also be implemented by using one or more integrated circuits. Accordingly, each module/unit in the foregoing embodiment may be implemented in the form of hardware, or may be implemented by using a software function module. The form is implemented. The present disclosure is not limited to any specific form of combination of hardware and software.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可 移除介质。计算机存储介质包括但不限于随机存取存储器(RAM,Random Access Memory)、只读存储器(ROM,Read-Only Memory)、电可擦除只读存储器(EEPROM,Electrically Erasable Programmable Read-only Memory)、闪存或其他存储器技术、光盘只读存储器(CD-ROM,Compact Disc Read-Only Memory)、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。Those of ordinary skill in the art will appreciate that all or some of the steps, systems, and functional blocks/units of the methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical The components work together. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer readable medium, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and nonvolatile, implemented in any method or technology for storing information, such as computer readable instructions, data structures, program modules or other data. Sex, removable and non-removable media. The computer storage medium includes, but is not limited to, Random Access Memory (RAM), Read-Only Memory (ROM), and Electrically Erasable Programmable Read-only Memory (EEPROM). Flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or Any other medium used to store the desired information and that can be accessed by the computer. Moreover, it is well known to those skilled in the art that communication media typically includes computer readable instructions, data structures, program modules or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and can include any information delivery media. .
本领域的普通技术人员可以理解,可以对本公开的技术方案进行修改或者等同替换,而不脱离本公开技术方案的精神和范围,均应涵盖在本公开的权利要求范围当中。A person skilled in the art can understand that the technical solutions of the present disclosure may be modified or equivalent, without departing from the spirit and scope of the present disclosure, and should be included in the scope of the claims of the present disclosure.
本公开提供的词条修改方法和词条修改装置,通过在本地数据库中更正待更正的词条、同步至中央数据库,再合入一个或多个分支的源代码文件,减少了中间沟通的环节,大幅减少了人力成本,提高了词条故障修改的工作效率,并且积累了不断丰富的中央数据库。The term modification method and the term modification device provided by the present disclosure reduce the intermediate communication link by correcting the term to be corrected in the local database, synchronizing to the central database, and then combining the source code files of one or more branches. , greatly reducing labor costs, improving the efficiency of the modification of the terminology, and accumulating a constantly enriched central database.
Claims (11)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710750111.8A CN109829010B (en) | 2017-08-28 | 2017-08-28 | Entry modification method and entry modification device |
| CN201710750111.8 | 2017-08-28 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2019041889A1 true WO2019041889A1 (en) | 2019-03-07 |
Family
ID=65524851
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/087092 Ceased WO2019041889A1 (en) | 2017-08-28 | 2018-05-16 | Wording modifying method and device |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN109829010B (en) |
| WO (1) | WO2019041889A1 (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113986829A (en) * | 2021-11-03 | 2022-01-28 | 浪潮云信息技术股份公司 | A way to change Hive data based on index |
| IT202300026172A1 (en) * | 2023-12-06 | 2025-06-06 | Enel Global Services S R L | COMPUTATION ENVIRONMENT AND ASSOCIATED METHOD |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111966670B (en) * | 2020-07-08 | 2021-09-10 | 成都星时代宇航科技有限公司 | Remote sensing data distribution method and device based on mosaic data set and management platform |
| CN112819419B (en) * | 2020-08-13 | 2023-03-21 | 厦门汉印电子技术有限公司 | Android application international language management method and system based on Git |
| CN114638240A (en) * | 2022-03-28 | 2022-06-17 | 努比亚技术有限公司 | Method and equipment for translating entries of operating system and computer readable storage medium |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070016625A1 (en) * | 1999-06-17 | 2007-01-18 | Viktors Berstis | Method and Apparatus for Providing a Central Dictionary and Glossary Server |
| CN101030157A (en) * | 2007-04-20 | 2007-09-05 | 北京搜狗科技发展有限公司 | Method and system for updating user vocabulary synchronouslly |
| CN102955825A (en) * | 2011-08-30 | 2013-03-06 | 北京搜狗科技发展有限公司 | Method and system for updating input method lexicon |
| CN103986765A (en) * | 2014-05-16 | 2014-08-13 | 广东欧珀移动通信有限公司 | A method of using network to synchronize android multi-language |
Family Cites Families (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| GB2262368A (en) * | 1991-12-13 | 1993-06-16 | Kent | Generating databases. |
| AU6334000A (en) * | 1999-04-09 | 2000-11-10 | Sandpiper Software, Inc. | A method of mapping semantic context to enable interoperability among disparate sources |
| US7886267B2 (en) * | 2006-09-27 | 2011-02-08 | Symantec Corporation | Multiple-developer architecture for facilitating the localization of software applications |
| CN102364437A (en) * | 2011-09-22 | 2012-02-29 | 厦门游家网络有限公司 | Multi-language site development system and implementation method thereof |
| CN103544022A (en) * | 2013-11-04 | 2014-01-29 | 北京中搜网络技术股份有限公司 | HES system widget management method |
| CN103761092B (en) * | 2014-01-20 | 2017-01-11 | 中国科学院软件研究所 | Knowledge community based method and device of online collaborative analysis and sharing for source codes |
| CN106503195A (en) * | 2016-11-02 | 2017-03-15 | 四川译宝联科技有限公司 | A kind of translation word stocks search method and system based on search engine |
| CN106933811A (en) * | 2017-02-14 | 2017-07-07 | 南京南瑞继保电气有限公司 | A kind of entry automatic generation method and device |
-
2017
- 2017-08-28 CN CN201710750111.8A patent/CN109829010B/en active Active
-
2018
- 2018-05-16 WO PCT/CN2018/087092 patent/WO2019041889A1/en not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070016625A1 (en) * | 1999-06-17 | 2007-01-18 | Viktors Berstis | Method and Apparatus for Providing a Central Dictionary and Glossary Server |
| CN101030157A (en) * | 2007-04-20 | 2007-09-05 | 北京搜狗科技发展有限公司 | Method and system for updating user vocabulary synchronouslly |
| CN102955825A (en) * | 2011-08-30 | 2013-03-06 | 北京搜狗科技发展有限公司 | Method and system for updating input method lexicon |
| CN103986765A (en) * | 2014-05-16 | 2014-08-13 | 广东欧珀移动通信有限公司 | A method of using network to synchronize android multi-language |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113986829A (en) * | 2021-11-03 | 2022-01-28 | 浪潮云信息技术股份公司 | A way to change Hive data based on index |
| IT202300026172A1 (en) * | 2023-12-06 | 2025-06-06 | Enel Global Services S R L | COMPUTATION ENVIRONMENT AND ASSOCIATED METHOD |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109829010B (en) | 2023-11-14 |
| CN109829010A (en) | 2019-05-31 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2019041889A1 (en) | Wording modifying method and device | |
| US7571092B1 (en) | Method and apparatus for on-demand localization of files | |
| US9342301B2 (en) | Converting and input script to a natural language description | |
| US7636656B1 (en) | Method and apparatus for synthesizing multiple localizable formats into a canonical format | |
| CN111160045A (en) | Game resource file translation method, device and equipment | |
| CN113821496B (en) | Database migration method, system, device and computer readable storage medium | |
| CN110019111B (en) | Data processing method, data processing device, storage medium and processor | |
| US9442718B1 (en) | System for assisting in locating changes in source code version control system | |
| CN111729313A (en) | Language configuration method and device, storage medium, and electronic device | |
| US10754629B2 (en) | Method for automated detection, correction, and translation of un-localized lines | |
| CN114764558A (en) | SQL dialect conversion method, device, system and storage medium | |
| CN106570095B (en) | XML data operation method and equipment | |
| CN108664505B (en) | Method and device for exporting database table structure | |
| CN113901025B (en) | Database management method, device, equipment and storage medium | |
| CN110825739A (en) | Table building statement generation method, device, equipment and storage medium | |
| US20160224535A1 (en) | Automated data conversion and presentation utility | |
| CN109947711A (en) | A kind of multilingual file automating management method in pair of IOS project development process | |
| CN111144135A (en) | Entry conversion method, device, equipment and readable medium | |
| CN117453630A (en) | File path checking method and device, electronic equipment and readable storage medium | |
| WO2024041358A1 (en) | Configuration file updating method and apparatus, electronic device and readable storage medium | |
| CN117407102A (en) | Internationalization method, tool, storage medium and server for software project | |
| CN111221846B (en) | Automatic translation method and device for SQL sentences | |
| CN109597847B (en) | Medical data recovery method and device, storage medium, and electronic terminal | |
| CN106951427B (en) | Data extraction method and device for business object | |
| CN118193551B (en) | Method, device, equipment and medium for updating database table and querying business data |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 18849747 Country of ref document: EP Kind code of ref document: A1 |