Translation method and system for synchronous management of multi-source entries
By using automated tools to extract and identify scenarios to select translation modes, the inefficiency and inconsistency of manual translation in the synchronous management of internationalized entries have been solved. This has enabled efficient, accurate, and consistent management of multilingual entries and translation strategies that can adapt to different needs.
Patent Information
- Application Number
- CN202511102957.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-07
- Publication Date
- 2025-11-18
AI Technical Summary
In existing technologies, the collection and synchronization of internationalized terms mainly rely on manual translation, which suffers from low accuracy and efficiency. Furthermore, the management of multiple data sources leads to inconsistencies in translation and version chaos, making it difficult to expand to new languages. Manual rewriting is also prone to formatting errors.
The system extracts multi-source terms using automated tools, identifies usage scenarios to select translation modes, and achieves automated translation and rewriting. It supports multi-format output and combines machine translation with human proofreading to provide version control and intelligent incremental updates.
It enables unified management of multilingual entries, improves translation efficiency and accuracy, ensures consistency across different language versions, reduces human error and resource consumption, and provides a flexible translation strategy to meet professional and testing needs.
Smart Images

Figure CN120975104A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and more specifically, to a translation method and system for synchronous management of multi-source terms. Background Technology
[0002] In the context of a globalized digital economy, the synchronized management of multi-source terms in databases has become a crucial foundation for enterprises expanding into overseas markets. However, current technologies for collecting and synchronizing international terms generally rely on manual translation, which has several drawbacks: First, manual translation suffers from low accuracy and efficiency: developers' translations are often inaccurate, resulting in low overall accuracy; the barrier to entry for non-developers is high; and adding new languages is difficult when translating terms manually. When a product needs to support new languages, the entire process from term extraction and translation to verification requires repetitive manual operations, making language expansion a time-consuming and burdensome task. Regarding multi-data source management, hard-coded text in front-end and back-end resource files has long been disconnected from international terms in the database. This decentralized management model not only causes the same phrase to be translated repeatedly in different modules, making unified management impossible, but also leads to confusion during version iterations where some terms are updated while others are omitted. Furthermore, translated terms need to be manually written back to the code or database, which can easily cause formatting errors and misplacement. Summary of the Invention
[0003] To address the aforementioned technical problems, this application discloses a translation method and system for simultaneous management of multi-source terms. Specifically, the technical solution of this application is as follows:
[0004] Firstly, this application discloses a translation method for simultaneous management of multi-source terms, comprising the following steps:
[0005] Obtain a data source file and automatically extract multi-source terms from the data source file; simultaneously record the related term information of the multi-source terms; save the multi-source terms and the related term information in a specified format file to be translated according to the configuration information;
[0006] Identify the usage scenario of the data source file, and select different translation modes based on the current usage scenario to perform document translation processing on the file to be translated, thereby obtaining a translated file;
[0007] Extract the translated multi-source terms from the translation file; based on the relevant term information, write the translated multi-source terms back to a specified location in the data source file.
[0008] In some implementations, before obtaining the data source file and automatically extracting multi-source terms from the data source file, the method further includes:
[0009] Complete the system initialization configuration, including defining multi-source term scanning rules, setting the target translation language, and configuring database connection parameters; to obtain the configuration information.
[0010] In some implementations, the data source file includes: a front-end resource file, a back-end resource file, and a database file.
[0011] In some implementations, the related term information includes the language information of the multi-source terms and the source location information of the multi-source terms in the data source file.
[0012] In some implementations, the step of saving the multi-source terms and related term information in a specified format file to be translated according to the configuration information specifically includes:
[0013] Based on the preset configuration information, the data source file is obtained from the specified directory, the untranslated internationalized multi-source terms in the data source file are automatically extracted, and output to the target directory; a first format file to be translated or a second format file to be translated is generated.
[0014] In some implementations, identifying the usage scenario of the data source file and selecting different translation modes based on the current usage scenario to perform document translation processing on the file to be translated, thereby obtaining a translated file, specifically includes the following steps:
[0015] Analyze the attribute and contextual features of the data source file to identify its usage scenarios.
[0016] Based on the first usage scenario, the first translation mode is selected to perform document translation processing on the document to be translated, resulting in a translated document;
[0017] Based on the second usage scenario, the second translation mode is selected to perform document translation processing on the document to be translated, resulting in a translated document.
[0018] In some implementations, the step of writing the translated multi-source terms back to a designated location in the data source file based on the relevant term information specifically includes the following steps:
[0019] The translation file is parsed, and the format of the translated multi-source terms is converted based on the configuration information;
[0020] Based on the source location information of the multi-source terms, the multi-source terms in the target format are written back to the specified location of the data source file.
[0021] Secondly, this application also discloses a translation system for simultaneous management of multiple source terms, including a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the steps of the translation method for simultaneous management of multiple source terms described in any of the above embodiments.
[0022] Thirdly, this application also discloses a computer-readable storage medium storing a computer program / instructions thereon, which, when executed by a processor, implements the steps of a translation method for multi-source term synchronization management as described in any of the above embodiments.
[0023] Fourthly, this application also discloses a computer program product, including a computer program / instruction that, when executed by a processor, implements the steps of a translation method for multi-source term synchronization management as described in any of the above embodiments.
[0024] Compared with the prior art, this application has at least one of the following beneficial effects:
[0025] 1. This application's multi-source term extraction engine can simultaneously scan multiple term data sources, covering front-end / back-end resource files and database data terms, solving industry pain points. Through multi-source term synchronization management, this application ensures that all translated content can be uniformly stored, version-controlled, and reused, guaranteeing consistency across different language versions. Furthermore, this application features a fully automated process: compared to traditional manual processing, automated tools significantly improve term processing efficiency.
[0026] 2. This application utilizes a bidirectional synchronization algorithm between the development language and the target language. During the multi-source term extraction process, it records term location information using metadata retention technology. After translation, the translated terms are accurately written back to the designated location, avoiding errors easily caused by manual writing, resulting in high accuracy.
[0027] 3. This application identifies the usage scenario of the data source file and selects different translation modes to process the document to be translated based on the current usage scenario. It supports three collaborative modes: the first translation mode imports the document to be translated into a professional translation management system for translation in professional scenarios; the second translation mode uses machine translation for translation in testing or non-critical scenarios; and the third translation mode is a hybrid mode that combines automatic pre-translation with manual proofreading, resulting in more accurate document translation processing of the document to be translated.
[0028] 4. This application implements a standardized output process, adopts industry-standard file formats, and is fully compatible with mainstream translation management systems, enabling translators without technical backgrounds to efficiently participate in international translation workflows. The system provides a robust version control mechanism, supports the management of internationalized terms, and effectively ensures the consistency and traceability of multilingual resources.
[0029] 5. The system employs an intelligent incremental update strategy, synchronizing only the changed terminology, significantly reducing system resource consumption and network transmission load, ensuring the efficiency and economy of the internationalization update process. This design meets both the technical needs of professional translation teams and the efficiency requirements of project management. Attached Figure Description
[0030] The preferred embodiments will now be described in a clear and easy-to-understand manner, in conjunction with the accompanying drawings, to further explain the above-mentioned characteristics, technical features, advantages, and implementation methods of this application.
[0031] Figure 1 This is a flowchart illustrating the steps of an embodiment of a translation method for simultaneous management of multi-source terms according to this application.
[0032] Figure 2 This is a schematic diagram of the overall system operation process in the embodiments of this application;
[0033] Figure 3 This is a schematic diagram illustrating the process of writing the translated file back to the original data file in an embodiment of this application;
[0034] Figure 4 This is a schematic diagram of the process for exporting the file to be translated in an embodiment of this application;
[0035] Figure 5 This is a schematic diagram of the structure of an embodiment of a translation system for simultaneous management of multi-source terms according to this application. Detailed Implementation
[0036] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0037] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or sets.
[0038] To keep the drawings concise, each figure only schematically shows the parts relevant to the invention, and these do not represent the actual structure of the product. Furthermore, to facilitate understanding, in some figures, only one of components with the same structure or function is schematically depicted, or only one is labeled. In this document, "one" not only means "only one," but can also mean "more than one."
[0039] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0040] Furthermore, in the description of this application, the terms "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0041] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the specific implementation methods of this application will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings and other implementation methods can be obtained based on these drawings without creative effort.
[0042] Synchronized management of multi-source database entries is a core aspect of global software development. Its fundamental purpose is to ensure that products can efficiently, accurately, and consistently adapt to the needs of users in different languages and regions. In the digital economy era, enterprises that wish to successfully expand into international markets must overcome language, cultural, and technological barriers, and systematic entry management is key to solving these problems.
[0043] First, the collection and synchronization of internationalized terms can significantly improve the development efficiency of multilingual products. In traditional development models, text content in software is often hard-coded directly into the program logic. This means that every time a new language is added or the text is modified, developers have to manually find and replace the strings in the code, a process that is both tedious and error-prone.
[0044] Therefore, ensuring synchronized updates across language versions during product iterations is essential. To address the inconsistency in translations caused by distributed storage in multi-source database terminology synchronization management, this application provides a dynamic internationalization solution that supports centralized management of multilingual terms. This effectively prevents duplicate translations or version differences of the same term across different databases or code files.
[0045] Reference manual attached Figure 1 As shown, an embodiment of a translation method for simultaneous management of multi-source terms in this application specifically includes the following steps:
[0046] S100: Obtain the data source file and automatically extract multi-source terms from the data source file; simultaneously record the related term information of the multi-source terms; save the multi-source terms and the related term information in a specified format file to be translated according to the configuration information.
[0047] Optionally, in some implementations, the data source file includes: a front-end resource file, a back-end resource file, and a database file.
[0048] In this embodiment, step S1 uses automated tools to scan data source files in front-end resource files, back-end resource files, and database files to identify and extract multi-source terms that need to be internationalized. Multi-source terms include interface text or multilingual fields in the database. Optionally, the automated tools include GLOB extraction or SQL scanning; each is suitable for different data source files. Technical personnel can select the appropriate automated tool for multi-source term extraction based on the specific format of the data source file. (Reference) Figure 2 .
[0049] Furthermore, internationalized multi-source terms are extracted according to pre-configured rules, and these terms, along with related term information, are saved to a file in a specified format to be translated. This file will be used for subsequent translation, export, and import steps. This automated extraction and standardized storage method significantly reduces the workload of manually collecting terms, avoids omitting code or content to be translated from the database, and ensures the integrity of term context information, thereby improving translation efficiency and accuracy, and supporting subsequent management and maintenance of internationalized terms.
[0050] In other embodiments, the relevant term information includes the language information of the multi-source terms and the source location information of the multi-source terms in the data source file. In other embodiments, the system records the context information of the terms while extracting them, such as code location, column description in the database table, module or usage scenario. This relevant term information helps maintain semantic accuracy during subsequent translation.
[0051] S200: Identify the usage scenario of the data source file, select different translation modes based on the current usage scenario to perform document translation processing on the file to be translated, and obtain the translated file.
[0052] In this embodiment, optionally, multiple translation modes are provided to adapt to the needs of different scenarios, achieving a flexible and efficient multilingual processing workflow. (See attached specification.) Figure 2 As shown. Figure 2 This is a schematic diagram of the overall system operation process in the embodiments of this application.
[0053] In professional scenarios, the first translation mode is adopted. The system imports standard format files to be translated, such as XLIFF (XML Localization Interchange File Format), into a professional translation management system (TMS). With the help of terminology database, translation memory, and professional translators, high-quality human translation is carried out to ensure the accuracy and professionalism of important content.
[0054] In testing or non-critical scenarios, i.e. developer scenarios, enabling the second translation mode will first convert professional format files into simplified formats, such as XSLX, using the system's built-in format conversion tool. Then, it will call machine translation APIs, such as Google Translate, to perform fast automatic translation and quickly generate translation packages that can be used for testing or temporary purposes.
[0055] The advantage of this multi-mode design lies in its ability to ensure the translation quality of core content through the primary translation mode, while simultaneously enabling rapid fulfillment of testing and demonstration needs through an automated mode, significantly reducing translation costs and time. Furthermore, the use of format conversion tools allows the same set of terms to circulate across different toolchains, improving the system's adaptability and scalability. This allows teams to flexibly choose the most suitable translation strategy based on project stage and importance, optimizing resource allocation while ensuring quality.
[0056] S300: Extract the translated multi-source terms from the translation file; based on the relevant term information, write the translated multi-source terms back to a specified location in the data source file.
[0057] After acquiring multilingual files that have been manually edited and translated, the system automatically parses the translated content and converts it into a format that meets the requirements of code or database storage. For example, the translated key-value pairs are written to front-end resource files, back-end resource files, or database files. By recognizing the location markers of the entries, the system automatically backfills the translated content into the development environment, forming a complete closed-loop process from exporting the content to be translated to manual processing and then backfilling the translation results. This creates a "development-translation-backfill" closed loop, improving efficiency.
[0058] Reference manual attached Figure 3 As shown. Figure 3 This is a schematic diagram illustrating the process of writing the translated file back to the original data file in an embodiment of this application.
[0059] In this embodiment, writing the translated files back to the original data file reduces the workload of developers manually maintaining multilingual entries, avoids errors that may occur due to manual copying and pasting, and ensures real-time synchronization of translated content with code or database through a standardized process, significantly improving the overall efficiency of internationalization development. Furthermore, the closed-loop design of the write-back allows for rapid iteration of translation updates, which is particularly suitable for scenarios with frequent adjustments to multilingual versions, while also reducing the risk of version inconsistencies caused by manual operations.
[0060] Based on the above embodiments, this application discloses another embodiment of a translation method for synchronous management of multi-source terms. Before step S100: obtaining a data source file and automatically extracting multi-source terms from the data source file, the method further includes step S010: completing system initialization configuration work, including defining multi-source term scanning rules, target translation language settings, and database connection parameter configurations to obtain the configuration information.
[0061] In this embodiment, the configuration process is mainly used to implement the system's internationalization support and database connection settings. First, by configuring the front-end / back-end resource files, database internationalization scanning rules, and translation languages, the system can automatically scan internationalization resource files under a specified path and translate them according to the specified translation languages, ensuring that the system can display corresponding language content based on the needs of users in different regions. Second, by configuring database connection information, the system can establish a connection with the database, which includes key information such as username, password, host address, and port, providing basic support for data storage and retrieval. In some implementations of this embodiment, during the configuration phase, the developer configures the front-end / back-end resource files, database internationalization scanning rules, and translation languages according to system needs, as shown in the following code:
[0062]
[0063] In other embodiments of this example, the configuration phase further includes configuring database connection information, as shown in the following code:
[0064] {
[0065] "url":"postgres: / / [username]:[password]@[host]:[port] / "
[0066] }
[0067] Specifically, this configuration defines the scanning path for internationalized resources and the database connection parameters. In the internationalization configuration section, it specifies the file path patterns the system needs to scan, including properties files in the i18n directory, properties files in the enum directory, json files in the locale directory, and json files in the db directory. These files are typically used to store internationalized text for front-end / back-end resource files and the database. It also configures the supported languages, such as American English (en-US) and Simplified Chinese (zh-CN), ensuring the system can handle the translation and display of these two languages.
[0068] The database configuration section sets the database connection string, which includes the URL template required to access the database and contains key information such as username, password, host address, and port. This information is used by the application to establish a connection with the database and interact with data. These configurations provide the basic framework for multilingual support and data access to the system.
[0069] This application provides another embodiment of a translation method for simultaneous management of multi-source terms. Based on any embodiment of the above method, step S100: obtaining a data source file, automatically extracting multi-source terms from the data source file; simultaneously recording the related term information of the multi-source terms; saving the multi-source terms and the related term information in a file to be translated in a specified format according to the configuration information; specifically including: obtaining a data source file from a specified directory based on the preset configuration information, automatically extracting untranslated internationalized multi-source terms from the data source file, and outputting them to a target directory; generating a file to be translated in a first format; or a file to be translated in a second format.
[0070] In this embodiment, the first format of the file to be translated can be XLIFF format, which is suitable for the already translated mode; the second format of the file to be translated can be XSLX format, which is suitable for the second translation mode.
[0071] The system first extracts untranslated internationalized multi-source terms from the specified address directory of the data source file according to the configuration information and puts them into the target address directory. Specifically, it scans the source code resources under the 1_res directory according to preset rules, automatically identifies and extracts untranslated multilingual terms, and then outputs these terms to the 4_export directory in a standardized format according to the usage scenario requirements.
[0072] Secondly, the extracted target address directory is saved as a translation file in either the first format or the second format and exported. Specifically, in professional translation scenarios, the system generates translation files conforming to the XLIFF international standard. This format supports the integration of professional tools such as translation memories and terminology databases, and can completely preserve the contextual metadata of terms. In automated testing or non-critical scenarios, the system outputs XSLX spreadsheet format, which is convenient for batch processing using machine translation APIs or for rapid manual editing. This application's multi-format output enables flexible adaptation of the translation workflow. The XLIFF format ensures the translation quality and consistency of critical business texts, while the XSLX format significantly improves the efficiency of test data preparation. The combination of the two meets the refined management needs of professional localization teams.
[0073] In one embodiment of this example, step S100 specifically includes the following sub-steps:
[0074] S111: An automated export script provided by the system exports relevant internationalized terms from code or business databases and saves them as XLIFF format files.
[0075] S112: An automated import script provided by the system imports translated terms in XLIFF format into the corresponding location in the code or business database.
[0076] S113: An automated build script provided by the system can build XLIFF format file entries into an internationalized entry package for dynamic deployment of internationalized entries.
[0077] S114: An automated conversion script provided by the system that can convert terminology files between XLIFF and XSLX formats, meeting the needs of most automated translation tools.
[0078] Optionally, in subsequent processes, in professional scenarios, the system can use automatic translation tools to translate the XSLX files provided by the system and quickly complete the translation test; in non-professional scenarios, the translation management system / professional management system can be used to directly manage the XLIFF files and complete the professional translation work.
[0079] In some other embodiments of this example, optionally, during the term development stage, the developer runs the command according to the above scheme prompts, specifically including the following sub-steps.
[0080] S121: Extract the input source file: i18n-tools 1-import-res, obtain the source file that meets the rules in the 1_res directory.
[0081] Specifically, first execute the 1-import-res command to scan the source code files in the 1_res directory and filter out file resources that conform to internationalization rules.
[0082] S122: Create a development language entry: i18n-tools 2-create-XLIFF, obtain the development language entry file i18n.xlff in the 1_res directory.
[0083] Specifically, the 2-create-XLIFF command generates an XLIFF baseline file i18n.XLIFF containing the development language terminology as the basis for translation.
[0084] S123: Create translation language entries: i18n-tools 3-create-XLIFF-others, obtain the translation language entry files i18n_zh-CN.xlff and i18n_en-US.xlff in the 1_res directory.
[0085] Specifically, the 3-create-XLIFF-others command is invoked to create XLIFF translation file templates for each target language based on the baseline file, such as Simplified Chinese zh-CN and English en-US versions.
[0086] S124: Export untranslated terms: i18n-tools 4-export-XLIFF, the 4_export directory will obtain the terminology files i18n_zh-CN.xlff and i18n_en-US.xlff for the languages to be translated.
[0087] Specifically, these templates to be translated are output to the 4_export directory using the 4-export-XLIFF command for use in the translation process.
[0088] S125: Convert untranslated terms to XSLX format: i18n-tools to-XSLX, obtain the export.XSLX file from the 4_export directory.
[0089] Specifically, the to-XSLX command converts XLIFF format to the more editable XSLX spreadsheet format, enabling batch processing via machine translation APIs or collaborative translation with humans.
[0090] In this embodiment, the first format of the file to be translated, namely the XLIFF format, fully preserves the context and metadata of the entries, ensuring professional translation quality. The second format, the XSLX conversion, provides flexible large-scale translation processing capabilities. The entire process, through directory isolation and format conversion, ensures the integrity of development resources while achieving efficient and controllable translation workflows, significantly reducing the risk of errors and workload associated with manually maintaining multilingual resources.
[0091] This application provides another embodiment of a translation method for simultaneous management of multi-source terms. Based on any of the above embodiments, step S200: identifying the usage scenario of the data source file, selecting different translation modes based on the current usage scenario to perform document translation processing on the file to be translated, and obtaining a translated file; specifically including the following steps.
[0092] S211: Analyze the attribute characteristics and contextual characteristics of the data source file to identify the usage scenarios of the data source file.
[0093] S212: Based on the first usage scenario, select the first translation mode to perform document translation processing on the document to be translated, and obtain the translated document.
[0094] S213: Based on the second usage scenario, select the second translation mode to perform document translation processing on the document to be translated, and obtain the translated document.
[0095] In this embodiment, a differentiated translation processing flow is achieved through intelligent scene recognition and pattern adaptation mechanisms. The system first analyzes the attribute characteristics and usage context of the data source file, automatically determines whether the current scene belongs to a professional production environment or a test and verification environment, and then dynamically selects the corresponding translation processing mode.
[0096] In the first use case, i.e. the professional scenario, the system adopts the professional translation mode, which calls the TMS system interface and applies professional resources such as terminology database and translation memory for accurate translation; in the second use case, i.e. the testing or non-critical scenario, the second translation mode is enabled, which achieves fast automatic conversion by integrating machine translation API.
[0097] In some implementations of this embodiment, based on a first usage scenario, a first translation mode is selected to perform document translation processing on the first format document to be translated, thereby obtaining a translated document; based on a second usage scenario, a second translation mode is selected to perform document translation processing on the second format document to be translated, thereby obtaining a translated document.
[0098] Specifically, in the first use case, i.e., the professional scenario, the system uses a Translation Management System (TMS) and other professional tools to translate the first format of the file to be translated, i.e., the XLIFF format file. In the second use case, i.e., the testing or non-critical scenario, the system's provided format conversion tool can be used to convert the second format of the file to be translated, i.e., the XLIFF format file to the XSLX format file, and then an automatic translation tool such as "Google Translate" can be used to translate the content, ultimately efficiently completing the creation and testing of the terminology package with lower professional requirements.
[0099] Optionally, in some other embodiments of this example, other translation modes are also provided, such as a third translation mode, namely a hybrid mode, which supports automatic pre-translation + manual proofreading.
[0100] This scenario-based intelligent decision-making mechanism ensures the optimal balance between translation quality and efficiency. The first translation mode guarantees the accuracy and consistency of important business texts, while the second translation mode significantly improves the processing speed of non-critical content. This allows organizations to flexibly allocate translation resources according to actual business needs, avoiding excessive consumption of professional translation resources and ensuring rapid iteration in the testing and verification process. At the same time, the unified scenario recognition standard enables automated management of translation strategies, reducing the cost of manual decision-making and improving the intelligence level and operational efficiency of the overall internationalization process.
[0101] In other embodiments of this example, in the second translation mode, the XSLX format file obtained in the above steps is uploaded to an automated translation tool for automated translation, and the translated XSLX file is saved in the 5_import directory. A system-provided command is then executed to convert the format to XLIFF format.
[0102] Based on the above embodiments, step S300 involves extracting the translated multi-source terms from the translation file. Based on the relevant term information, the translated multi-source terms are written back to a specified location in the data source file. Specifically, this includes: S311, parsing the translation file and converting the format of the translated multi-source terms based on the configuration information; and S312, writing back the multi-source terms in the target format to a specified location in the data source file based on the source location information of the multi-source terms.
[0103] Specifically, in this embodiment, the system first parses the translated file, accurately extracting the multilingual terms and their associated metadata information that have undergone professional or machine translation. Then, based on the original location identifiers recorded in the term metadata, such as code file paths, database table names and field names, key-value pair IDs, etc., the system automatically locates the corresponding position in the data source file and performs a precise content update operation.
[0104] For code files, translated text is written according to the format specifications of internationalization resource files. For the database, corresponding update statements are generated and executed. This implementation ensures that each term can be accurately traced back to its original context by establishing a complete translation traceability mechanism, avoiding misalignments or omissions that may be caused by manual operation. Its main advantages are that it achieves seamless integration between the translation process and the development environment, significantly reduces the cost of multilingual maintenance, ensures real-time synchronization between translated content and source code / database, and eliminates the risk of errors caused by manual intervention through automated processing, enabling rapid iteration of internationalization updates.
[0105] In some implementations of this embodiment, the process of exporting and writing back XLIFF files to a data source file is achieved using GLOB expressions. GLOB expressions are a pattern syntax for file path matching, which uses special wildcards to achieve batch file filtering. Its core function is to allow developers to quickly match sets of files that conform to a specific naming pattern using concise syntax rules. (See attached specification.) Figure 4 As shown. Figure 4 This is a schematic diagram of the process for exporting the file to be translated in this application embodiment; it mainly includes the following steps:
[0106] 1. Scan project files, match filenames according to the configured GLOB expression, and generate development files.
[0107] 2. Scan project files, match filenames according to the configured GLOB expressions, and save the translated language terms as translation files.
[0108] 3. Scan the database data, match field names according to the configured GLOB expression regular expression, and generate development files.
[0109] 4. Scan the database's internationalization terminology development files and save the terms as translation files.
[0110] The development documentation specifies a particular language as the development language. The corresponding terms for that language serve as the basis for all translated terms. The translation documentation consists of terminology files in other languages translated from the development language terms.
[0111] In some other embodiments of this example, the developer runs the command according to the above-described scheme prompts.
[0112] 1. Import the translated term file: i18n-tools 5-import-xliff.
[0113] 2. Export the entries and write them back to the data source file: i18n-tools 6-export-res.
[0114] 3. According to the requirements of the experimental system, compile the output files in the 6_res_export directory into an internationalized language package and upload it to the system for verification testing.
[0115] Specifically, this embodiment achieves automated integration and verification of translated content through a standardized command flow. First, the `5-import-xliff` command is executed to parse the translated XLIFF file, extracting the reviewed multilingual terms and their associated metadata. Then, the `6-export-res` command writes the translation results back to the corresponding code resource file or database script according to the original data structure. This process strictly adheres to the file paths, keys, and other location information recorded in the terminology metadata, ensuring that the translated content is accurately updated to the specified location in the internationalization resource file of the source code. Finally, the toolchain packages the processed resource files into standardized language packages according to the experimental system specifications and uploads them to the test environment for functional verification through an automated deployment process. This application effectively improves the iteration efficiency and quality controllability of internationalized terms.
[0116] Based on the same concept, this application also discloses a translation system for simultaneous management of multi-source terms. The system is used to implement the steps described in any of the above method embodiments. Specifically, one embodiment of the translation system for simultaneous management of multi-source terms in this application includes:
[0117] The development module is used to acquire a data source file and automatically extract multi-source terms from it. It also records related term information for each multi-source term. According to the configuration information, the multi-source terms and related term information are saved in a specified format file to be translated.
[0118] The translation module is used to identify the usage scenario of the data source file, select different translation modes based on the current usage scenario, and perform document translation processing on the file to be translated to obtain a translated file.
[0119] The write-back module is used to extract the translated multi-source terms from the translation file. Based on the relevant term information, the translated multi-source terms are written back to a specified location in the data source file.
[0120] In other embodiments of the application, the translation system for simultaneous management of multi-source terms includes the following structure, as detailed in the attached specification. Figure 5 As shown.
[0121] The input / output unit specifically includes input sources and output products. Input sources include front-end / back-end resource files and databases, etc. Output products refer to the internationalized terminology artifacts required by the target system.
[0122] The core processing layer includes modules for file scanning, XLIFF generation, and translation management. The file scanning module is responsible for scanning the database and files according to user-configured rules to extract internationalized terms. The XLIFF generation module reads and writes XLIFF format terminology files. The translation management module manages the terminology translation process and exports the final output.
[0123] Toolchain layer: This describes the core tools provided and used by the system under this scheme, including the provided command-line interface, build system, template engine, etc. It also includes an integration layer: This describes the interaction process between the system and external systems.
[0124] Based on the same concept, this application also discloses a computer-readable storage medium storing a computer program / instructions thereon, which, when executed by a processor, implements the steps of a translation method for multi-source term synchronization management as described in any of the above embodiments.
[0125] This application also discloses a computer program product, including a computer program / instruction that, when executed by a processor, implements the steps of a translation method for multi-source term synchronization management as described in any of the above embodiments.
[0126] The translation method and system for multi-source term synchronization management in this application, as well as the corresponding storage medium and program product, have the same technical concept. The technical details of the above embodiments are applicable to each other, and will not be repeated here to reduce repetition.
[0127] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of program modules is merely an example. In practical applications, the above functions can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program units or modules to complete all or part of the functions described above. The program modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software program unit. Furthermore, the specific names of the program modules are only for easy differentiation and are not intended to limit the scope of protection of this application.
[0128] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
Claims
1. A translation method for simultaneous management of multi-source terms, characterized in that, Includes the following steps: Obtain a data source file and automatically extract multi-source terms from the data source file; simultaneously record the related term information of the multi-source terms; save the multi-source terms and the related term information in a specified format file to be translated according to the configuration information; Identify the usage scenario of the data source file, and select different translation modes based on the current usage scenario to perform document translation processing on the file to be translated, thereby obtaining a translated file; Extract the translated multi-source terms from the translated file; Based on the relevant term information, the translated multi-source terms are written back to a specified location in the data source file.
2. The translation method for simultaneous management of multi-source terms as described in claim 1, characterized in that, Before obtaining the data source file and automatically extracting multi-source terms from the data source file, the process also includes: Complete the system initialization configuration, including defining multi-source term scanning rules, setting the target translation language, and configuring database connection parameters; to obtain the configuration information.
3. The translation method for simultaneous management of multi-source terms as described in claim 1, characterized in that: The data source files include: front-end resource files, back-end resource files, and database files.
4. The translation method for simultaneous management of multi-source terms as described in claim 1, characterized in that: The relevant term information includes the language information of the multi-source terms and the source location information of the multi-source terms in the data source file.
5. The translation method for simultaneous management of multi-source terms as described in claim 1, characterized in that: The step of saving the multi-source terms and related terms information in a specified format file to be translated according to the configuration information specifically includes: Based on the preset configuration information, the data source file is obtained from the specified directory, the untranslated internationalized multi-source terms in the data source file are automatically extracted, and output to the target directory; a first format file to be translated or a second format file to be translated is generated.
6. The translation method for simultaneous management of multi-source terms as described in claim 1, characterized in that: The process involves identifying the usage scenario of the data source file, selecting different translation modes based on the current usage scenario, performing document translation processing on the file to be translated, and obtaining a translated file. Specifically, the following steps are included: Analyze the attribute and contextual features of the data source file to identify its usage scenarios. Based on the first usage scenario, the first translation mode is selected to perform document translation processing on the document to be translated, resulting in a translated document; Based on the second usage scenario, the second translation mode is selected to perform document translation processing on the document to be translated, resulting in a translated document.
7. The translation method for simultaneous management of multi-source terms as described in claim 4, characterized in that: Based on the relevant term information, the translated multi-source terms are written back to a specified location in the data source file; Specifically, the following steps are included: The translation file is parsed, and the format of the translated multi-source terms is converted based on the configuration information; Based on the source location information of the multi-source terms, the multi-source terms in the target format are written back to the specified location of the data source file.
8. A translation system for simultaneous management of multiple source terms, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the translation method for multi-source term synchronization management as described in any one of claims 1-7.
9. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that... When the computer program / instruction is executed by the processor, it implements the steps of the translation method for multi-source term synchronization management as described in any one of claims 1-7.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the steps of the translation method for multi-source term synchronization management as described in any one of claims 1-7.
Citation Information
Patent Citations
Entry translation method and device, electronic equipment and storage medium
CN115545046A
Character string resource localization method and device, equipment and medium
CN118036621A
Language translation implementation method and device, electronic equipment and storage medium
CN118194884A