CN116227505A - Internationalization file translation method, device, equipment and medium - Google Patents
Internationalization file translation method, device, equipment and medium Download PDFInfo
- Publication number
- CN116227505A CN116227505A CN202310142888.1A CN202310142888A CN116227505A CN 116227505 A CN116227505 A CN 116227505A CN 202310142888 A CN202310142888 A CN 202310142888A CN 116227505 A CN116227505 A CN 116227505A
- Authority
- CN
- China
- Prior art keywords
- translated
- file
- internationalized
- translation
- document
- 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.)
- Pending
Links
- 238000013519 translation Methods 0.000 title claims abstract description 126
- 238000000034 method Methods 0.000 title claims abstract description 38
- 238000011161 development Methods 0.000 claims abstract description 15
- 238000006243 chemical reaction Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 10
- 238000012216 screening Methods 0.000 claims description 4
- 238000012546 transfer Methods 0.000 claims description 3
- 238000012545 processing Methods 0.000 abstract description 6
- 230000000007 visual effect Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 2
- 230000014509 gene expression Effects 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/40—Processing or translation of natural language
- G06F40/58—Use of machine translation, e.g. for multi-lingual retrieval, for server-side translation for client devices or for real-time translation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/951—Indexing; Web crawling techniques
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Data Mining & Analysis (AREA)
- Machine Translation (AREA)
- Stored Programmes (AREA)
Abstract
The present invention relates to the field of software multilingual, and in particular, to an internationalized file translation method, device, apparatus, and medium. The method comprises the following steps: acquiring an internationalized source file to be translated, and configuring translation parameters for the internationalized source file to be translated; analyzing the internationalized source file to be translated to convert the internationalized source file to object data; performing deep traversal operation on the converted object data to screen out a word line text to be translated and the position of the word line text to be translated in the object data; and transferring the word strip document to be translated and the translation parameters into a translation interface through a crawler to generate a target document, and replacing the target document to a corresponding position. The scheme of the invention greatly improves the efficiency of processing internationalized files for developers, releases the developers from repeated and boring translation work, accelerates the development progress of products and optimizes the development experience.
Description
Technical Field
The present invention relates to the field of software multilingual, and in particular, to an internationalized file translation method, device, apparatus, and medium.
Background
Along with the continuous acceleration of globalization, our products need to be laid out in the domestic market and go overseas, and are oriented to users in the global market. The first concern of the product going out of the sea is the need to adapt to foreign language environments, which requires that we do international configuration in the project. In the project we develop at present, internationalized language file configuration requires manual maintenance by our developers, especially new developed products or new requirements, requiring new and increased amounts of vocabulary entries. After we maintain a chinese configuration file, the subsequent manual entry translation to generate a new language configuration file is a tedious and burdensome task for the developer.
At present, a lot of online file translation tools exist on the network, but most of these file translation services only support files in formats of doc, pdf, ppt and the like, and internationalized files of our developers are usually js and json files, and have no internationalized file translation services capable of meeting the demands of our developers and lack pertinence. It is necessary and highly desirable to implement a tool that can release the developer from the manual translation effort to address the need for internationalized file translation of our developer products.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an internationalized file translation method, device, apparatus and medium.
According to a first aspect of the present invention, there is provided an internationalized file translation method, the method comprising:
acquiring an internationalized source file to be translated, and configuring translation parameters for the internationalized source file to be translated;
analyzing the internationalized source file to be translated to convert the internationalized source file to object data;
performing deep traversal operation on the converted object data to screen out a word line text to be translated and the position of the word line text to be translated in the object data;
and transferring the word strip document to be translated and the translation parameters into a translation interface through a crawler to generate a target document, and replacing the target document to a corresponding position.
In some embodiments, obtaining an internationalized source file to be translated and configuring translation parameters for the internationalized source file to be translated includes:
uploading or selecting an internationalized source file to be translated by using an Electron development user interface, and submitting the internationalized source file to be translated to a file parser;
setting an original language type and a target language type for the internationalized source file to be translated, and storing the original language type and the target language type into a register.
In some embodiments, parsing the internationalized source file to be translated for conversion into object data includes:
reading an internationalized source file to be translated by using a node by a file analyzer, analyzing and converting character string data into js objects to survive object data, and submitting the object data to a traversal judging device;
and acquiring the file name and the format information of the internationalized source file to be translated by a file parser, and storing the file name and the format information into a register.
In some embodiments, performing a deep traversal operation on the converted object data to screen out a to-be-translated term document and a position of the to-be-translated term document in the object data, including:
depth traversing, by a traversal determiner, each value in the object data according to the following rule:
the position of the value is stored in a key array layer by layer, and the current depth is recorded through the deep so as to correct the key length at any time;
if the value is a character string, the character string is used as a word line document to be translated, and the word line document to be translated and the position of the word line document to be translated in the object data are submitted to a translation replacer;
if the value is the object, the object is entered for continued traversal.
In some embodiments, transferring the to-be-translated term document, the translation parameters, and the target document into a corresponding location through a crawler call translation interface includes:
invoking a translation interface by a translation replacer through a crawler;
the original language type and the target language type which are taken out from the register are transmitted into the translation interface together with the to-be-translated word stock text transmitted from the traversal judging device, and the translated text returned by the translation interface is used as the target text;
the position of the to-be-translated word strip document in the object data is positioned through traversing the keys, and the to-be-translated word strip document at the position is replaced by the target document;
and responding to the completion of replacement of all the to-be-translated term texts, and submitting the file data completed by the last replacement to a file survivor.
In some embodiments, the method further comprises:
acquiring file data from the translation replacer by a file survivor, and taking out the target language type, the file name and the format information from a register;
determining a file name to be generated for the file name according to the target language type;
and reorganizing the file data according to the format information to obtain file contents to be generated.
In some embodiments, the internationalized source file to be translated is a js file or json file.
According to a second aspect of the present invention, there is provided an internationalized file translation device, the device comprising:
the acquisition module is configured to acquire an internationalized source file to be translated and configure translation parameters for the internationalized source file to be translated;
the conversion module is configured to parse the internationalized source file to be translated to convert the internationalized source file into object data;
the screening module is configured to perform depth traversal operation on the converted object data to screen out a to-be-translated term document and the position of the to-be-translated term document in the object data;
and the translation replacement module is configured to call a translation interface through a crawler to transfer the to-be-translated word strip document and the translation parameters so as to generate a target document, and replace the target document to a corresponding position.
According to a third aspect of the present invention, there is also provided a computer device comprising:
at least one processor; and
and a memory storing a computer program executable on a processor, the processor executing the internationalized file translation method described above when executing the program.
According to a fourth aspect of the present invention there is also provided a computer readable storage medium storing a computer program which when executed by a processor performs the internationalized file translation method described previously.
According to the internationalization file translation method, the acquired internationalization source file is configured with the translation related parameters, internationalization objects in the file are deeply traversed, the vocabulary entry needing to be translated is found through judgment, then the translation result of the vocabulary entry is obtained through the crawler access translation interface, and then the original vocabulary entry is replaced, so that the conversion work from the untranslated nationalization source file to the internationalization file of the appointed language is completed, the efficiency of processing the internationalization file by a developer is greatly improved, the developer is liberated from repeated and boring translation work, the development progress of products is accelerated, and the development experience is optimized.
In addition, the invention also provides an internationalization file translating device, a computer device and a computer readable storage medium, which can also achieve the technical effects, and are not repeated here.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are necessary for the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention and that other embodiments may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an internationalization file translation method according to an embodiment of the present invention;
FIG. 2 is a flowchart of another method for internationalization file translation according to another embodiment of the present invention;
FIG. 3 is a schematic diagram of an internationalized file translation device according to another embodiment of the present invention;
fig. 4 is an internal structural view of a computer device according to another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention will be described in further detail with reference to the accompanying drawings.
It should be noted that, in the embodiments of the present invention, all the expressions "first" and "second" are used to distinguish two entities with the same name but different entities or different parameters, and it is noted that the "first" and "second" are only used for convenience of expression, and should not be construed as limiting the embodiments of the present invention, and the following embodiments are not described one by one.
In one embodiment, referring to fig. 1, the present invention provides an internationalized file translation method 100, specifically, the method includes the following steps:
According to the internationalization file translation method, the acquired internationalization source file is configured with the translation related parameters, internationalization objects in the file are deeply traversed, the vocabulary entry needing to be translated is found through judgment, then the translation result of the vocabulary entry is obtained through the crawler access translation interface, and then the original vocabulary entry is replaced, so that the conversion work from the untranslated nationalization source file to the internationalization file of the appointed language is completed, the efficiency of processing the internationalization file by a developer is greatly improved, the developer is liberated from repeated and boring translation work, the development progress of products is accelerated, and the development experience is optimized.
In some embodiments, the step 101, obtaining an internationalized source file to be translated, and configuring translation parameters for the internationalized source file to be translated includes:
uploading or selecting an internationalized source file to be translated by using an Electron development user interface, and submitting the internationalized source file to be translated to a file parser;
setting an original language type and a target language type for the internationalized source file to be translated, and storing the original language type and the target language type into a register.
In some embodiments, the foregoing step 102, parsing the internationalized source file to be translated to convert the internationalized source file to object data, includes:
reading an internationalized source file to be translated by using a node by a file analyzer, analyzing and converting character string data into js objects to survive object data, and submitting the object data to a traversal judging device;
and acquiring the file name and the format information of the internationalized source file to be translated by a file parser, and storing the file name and the format information into a register.
In some embodiments, the step 103 performs a depth traversal operation on the converted object data to screen out a to-be-translated term document and a position of the to-be-translated term document in the object data, including:
depth traversing, by a traversal determiner, each value in the object data according to the following rule:
the position of the value is stored in a key array layer by layer, and the current depth is recorded through the deep so as to correct the key length at any time;
if the value is a character string, the character string is used as a word line document to be translated, and the word line document to be translated and the position of the word line document to be translated in the object data are submitted to a translation replacer;
if the value is the object, the object is entered for continued traversal.
In some embodiments, the foregoing step 104, transferring the to-be-translated term document and the translation parameter into the to-be-translated term document through a crawler call translation interface to generate a target document, and replacing the target document to a corresponding position, includes:
invoking a translation interface by a translation replacer through a crawler;
the original language type and the target language type which are taken out from the register are transmitted into the translation interface together with the to-be-translated word stock text transmitted from the traversal judging device, and the translated text returned by the translation interface is used as the target text;
the position of the to-be-translated word strip document in the object data is positioned through traversing the keys, and the to-be-translated word strip document at the position is replaced by the target document;
and responding to the completion of replacement of all the to-be-translated term texts, and submitting the file data completed by the last replacement to a file survivor.
In some embodiments, the method further comprises:
acquiring file data from the translation replacer by a file survivor, and taking out the target language type, the file name and the format information from a register;
determining a file name to be generated for the file name according to the target language type;
and reorganizing the file data according to the format information to obtain file contents to be generated.
In some embodiments, the internationalized source file to be translated is a js file or json file.
In yet another embodiment, in order to facilitate understanding of the scheme of the present invention, taking selecting a file and a language to be translated by using an Electron development user interface as an example, the present embodiment provides another internationalization file translation method 200, where the principle of implementing an operation on a file through node. Js, traversing internationalization objects in the file deeply, determining that an entry to be translated is found, then accessing a translation interface through a crawler to obtain a translation result of the entry, replacing the original entry, and filling all contents into a newly generated file after traversing is completed; the method needs to use five parts of a visual operation unit, a file parser, a register, a traversal judging device, a translation replacing device and a file generator, and referring to fig. 2, the specific implementation process is as follows:
(1) Configuring parameters, namely the language type of a file needing to be translated and the target language type needing to be converted;
(2) Clicking and selecting the uploaded internationalized source files, mostly in json and js formats;
(3) After form submission, the file data is submitted to a file parser, and the selected language configuration parameters and internationalized file format are saved in registers.
(1) Reading file content data by using a node according to the file position, and analyzing and converting the character string data into js objects;
(2) And acquiring file name and format information, and placing the file name and the format information into a register.
(1) Receiving source file data, traversing object data deeply, judging each value, storing the position keys of the value layer by layer in a key array, recording the current depth through a deep, and correcting the key length at any time;
(2) If the value is a character string, transmitting the text of the character string and the position (key) of the text in the object into a translation replacer;
(3) If the value is the object, entering the object to continue traversing;
(4) And after traversing is completed, sending the processed data into a file generator.
And 204, the translation replacer translates the character string text transmitted from the traversal judge device through the crawler and then replaces the character string text in the object.
(1) The language type of the file to be translated is taken out from the register, the target language type to be translated is taken as a parameter, and the character string text transmitted from the traversal judging device is transmitted to the translation interface together, so that the translated text is obtained;
(2) The text at this point is replaced with the translated text by traversing the keys to locate the position of the currently translated text in the object.
The internationalization file translation method of the embodiment has at least the following beneficial technical effects: uploading an internationalization source file in a visual operation unit, configuring relevant translated parameters, reading file data information, deeply traversing internationalization objects in the file, judging to find an entry needing translation, accessing a translation interface through a crawler to obtain a translation result of the entry, replacing an original entry, and obtaining data and configuration information subjected to translation processing after traversing is completed to generate a brand new internationalization file. The whole device completes the conversion work from an untranslated nationalized source file to an internationalized file of a designated language through simple visual operation, greatly improves the efficiency of processing the internationalized file for a developer, releases the developer from repeated and boring translation work, accelerates the development progress of products and optimizes the development experience.
In some embodiments, referring to fig. 3, the present invention further provides an internationalized file translation device 300, which includes:
an obtaining module 301, configured to obtain an internationalized source file to be translated, and configure translation parameters for the internationalized source file to be translated;
a conversion module 302, configured to parse the internationalized source file to be translated to convert the internationalized source file into object data;
the screening module 303 is configured to perform a deep traversal operation on the converted object data to screen out a to-be-translated term document and a position of the to-be-translated term document in the object data;
and the translation replacement module 304 is configured to transfer the to-be-translated term document and the translation parameters into a translation interface through a crawler call to generate a target document, and replace the target document to a corresponding position.
According to the internationalization file translating device, the acquired internationalization source file is configured with the translation related parameters, internationalization objects in the file are deeply traversed, the vocabulary entry needing to be translated is found through judgment, then the translation result of the vocabulary entry is obtained through the crawler access translation interface, and then the original vocabulary entry is replaced, so that the conversion work from the untranslated nationalization source file to the internationalization file of the appointed language is completed, the efficiency of processing the internationalization file by a developer is greatly improved, the developer is liberated from repeated and boring translation work, the development progress of products is accelerated, and the development experience is optimized.
In some embodiments, the acquisition module 301 is further configured to:
uploading or selecting an internationalized source file to be translated by using an Electron development user interface, and submitting the internationalized source file to be translated to a file parser;
setting an original language type and a target language type for the internationalized source file to be translated, and storing the original language type and the target language type into a register.
In some embodiments, the conversion module 302 is further configured to:
reading an internationalized source file to be translated by using a node by a file analyzer, analyzing and converting character string data into js objects to survive object data, and submitting the object data to a traversal judging device;
and acquiring the file name and the format information of the internationalized source file to be translated by a file parser, and storing the file name and the format information into a register.
In some embodiments, the screening module 303 is further configured to:
depth traversing, by a traversal determiner, each value in the object data according to the following rule:
the position of the value is stored in a key array layer by layer, and the current depth is recorded through the deep so as to correct the key length at any time;
if the value is a character string, the character string is used as a word line document to be translated, and the word line document to be translated and the position of the word line document to be translated in the object data are submitted to a translation replacer;
if the value is the object, the object is entered for continued traversal.
In some embodiments, the translation replacement module 304 is further configured to:
invoking a translation interface by a translation replacer through a crawler;
the original language type and the target language type which are taken out from the register are transmitted into the translation interface together with the to-be-translated word stock text transmitted from the traversal judging device, and the translated text returned by the translation interface is used as the target text;
the position of the to-be-translated word strip document in the object data is positioned through traversing the keys, and the to-be-translated word strip document at the position is replaced by the target document;
and responding to the completion of replacement of all the to-be-translated term texts, and submitting the file data completed by the last replacement to a file survivor.
In some embodiments, the apparatus further comprises a file generation module configured to:
acquiring file data from the translation replacer by a file survivor, and taking out the target language type, the file name and the format information from a register;
determining a file name to be generated for the file name according to the target language type;
and reorganizing the file data according to the format information to obtain file contents to be generated.
In some embodiments, the internationalized source file to be translated is a js file or json file.
It should be noted that, for specific limitation of the internationalized file translating device, reference may be made to the limitation of the internationalized file translating method hereinabove, and no further description is given here. The above-described individual modules in the internationalized file translation device may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
According to another aspect of the present invention, there is provided a computer device, which may be a server, and an internal structure thereof is shown in fig. 4. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements the internationalized file translation method described above, in particular the method comprises the steps of:
acquiring an internationalized source file to be translated, and configuring translation parameters for the internationalized source file to be translated;
analyzing the internationalized source file to be translated to convert the internationalized source file to object data;
performing deep traversal operation on the converted object data to screen out a word line text to be translated and the position of the word line text to be translated in the object data;
and transferring the word strip document to be translated and the translation parameters into a translation interface through a crawler to generate a target document, and replacing the target document to a corresponding position.
According to a further aspect of the present invention, there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the internationalized file translation method described above, in particular comprising the steps of:
acquiring an internationalized source file to be translated, and configuring translation parameters for the internationalized source file to be translated;
analyzing the internationalized source file to be translated to convert the internationalized source file to object data;
performing deep traversal operation on the converted object data to screen out a word line text to be translated and the position of the word line text to be translated in the object data;
and transferring the word strip document to be translated and the translation parameters into a translation interface through a crawler to generate a target document, and replacing the target document to a corresponding position.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.
Claims (10)
1. An internationalized file translation method, the method comprising:
acquiring an internationalized source file to be translated, and configuring translation parameters for the internationalized source file to be translated;
analyzing the internationalized source file to be translated to convert the internationalized source file to object data;
performing deep traversal operation on the converted object data to screen out a word line text to be translated and the position of the word line text to be translated in the object data;
and transferring the word strip document to be translated and the translation parameters into a translation interface through a crawler to generate a target document, and replacing the target document to a corresponding position.
2. The method for translating an internationalized file according to claim 1, wherein obtaining an internationalized source file to be translated and configuring translation parameters for the internationalized source file to be translated comprises:
uploading or selecting an internationalized source file to be translated by using an Electron development user interface, and submitting the internationalized source file to be translated to a file parser;
setting an original language type and a target language type for the internationalized source file to be translated, and storing the original language type and the target language type into a register.
3. The internationalized file translation method of claim 2, wherein parsing the internationalized source file to be translated for conversion into object data comprises:
reading an internationalized source file to be translated by using a node by a file analyzer, analyzing and converting character string data into js objects to survive object data, and submitting the object data to a traversal judging device;
and acquiring the file name and the format information of the internationalized source file to be translated by a file parser, and storing the file name and the format information into a register.
4. The internationalized file translation method of claim 3, wherein performing a deep traversal operation on the converted object data to screen out the to-be-translated term text and the position of the to-be-translated term text in the object data, comprises:
depth traversing, by a traversal determiner, each value in the object data according to the following rule:
the position of the value is stored in a key array layer by layer, and the current depth is recorded through the deep so as to correct the key length at any time;
if the value is a character string, the character string is used as a word line document to be translated, and the word line document to be translated and the position of the word line document to be translated in the object data are submitted to a translation replacer;
if the value is the object, the object is entered for continued traversal.
5. The internationalized file translation method of claim 4, wherein transferring the to-be-translated term document, the translation parameters to generate a target document and replacing the target document to a corresponding location through a crawler call translation interface comprises:
invoking a translation interface by a translation replacer through a crawler;
the original language type and the target language type which are taken out from the register are transmitted into the translation interface together with the to-be-translated word stock text transmitted from the traversal judging device, and the translated text returned by the translation interface is used as the target text;
the position of the to-be-translated word strip document in the object data is positioned through traversing the keys, and the to-be-translated word strip document at the position is replaced by the target document;
and responding to the completion of replacement of all the to-be-translated term texts, and submitting the file data completed by the last replacement to a file survivor.
6. The internationalized file translation method of claim 5, further comprising:
acquiring file data from the translation replacer by a file survivor, and taking out the target language type, the file name and the format information from a register;
determining a file name to be generated for the file name according to the target language type;
and reorganizing the file data according to the format information to obtain file contents to be generated.
7. The internationalized file translation method according to any one of claims 1 to 6, wherein the internationalized source file to be translated is js file or json file.
8. An internationalized file translation device, the device comprising:
the acquisition module is configured to acquire an internationalized source file to be translated and configure translation parameters for the internationalized source file to be translated;
the conversion module is configured to parse the internationalized source file to be translated to convert the internationalized source file into object data;
the screening module is configured to perform depth traversal operation on the converted object data to screen out a to-be-translated term document and the position of the to-be-translated term document in the object data;
and the translation replacement module is configured to call a translation interface through a crawler to transfer the to-be-translated word strip document and the translation parameters so as to generate a target document, and replace the target document to a corresponding position.
9. A computer device, comprising:
at least one processor; and
a memory storing a computer program executable in the processor, the processor performing the method of any of claims 1-7 when the program is executed.
10. A computer readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, performs the method of any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310142888.1A CN116227505A (en) | 2023-02-17 | 2023-02-17 | Internationalization file translation method, device, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310142888.1A CN116227505A (en) | 2023-02-17 | 2023-02-17 | Internationalization file translation method, device, equipment and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116227505A true CN116227505A (en) | 2023-06-06 |
Family
ID=86572610
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310142888.1A Pending CN116227505A (en) | 2023-02-17 | 2023-02-17 | Internationalization file translation method, device, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116227505A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117114019A (en) * | 2023-10-23 | 2023-11-24 | 天津异乡好居网络科技股份有限公司 | Internationalized resource file extraction and back-filling method and device and continuous integration platform thereof |
CN117744671A (en) * | 2024-02-21 | 2024-03-22 | 睿云联(厦门)网络通讯技术有限公司 | Intelligent intercom product full-automatic multi-language solving method, equipment and medium |
-
2023
- 2023-02-17 CN CN202310142888.1A patent/CN116227505A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117114019A (en) * | 2023-10-23 | 2023-11-24 | 天津异乡好居网络科技股份有限公司 | Internationalized resource file extraction and back-filling method and device and continuous integration platform thereof |
CN117114019B (en) * | 2023-10-23 | 2024-01-12 | 天津异乡好居网络科技股份有限公司 | Internationalized resource file extraction and back-filling method and device and continuous integration platform thereof |
CN117744671A (en) * | 2024-02-21 | 2024-03-22 | 睿云联(厦门)网络通讯技术有限公司 | Intelligent intercom product full-automatic multi-language solving method, equipment and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN116227505A (en) | Internationalization file translation method, device, equipment and medium | |
US9152542B2 (en) | Automatic generation of test scripts | |
CN112540862A (en) | Interface document data generation method, device, equipment and storage medium | |
CN111831384A (en) | Language switching method and device, equipment and storage medium | |
CN115796190B (en) | Front-end internationalization multi-language conversion method and system based on vue and weback | |
CN110780860A (en) | Generation method and device of table building script, computer equipment and storage medium | |
CN112306620B (en) | Multi-language loading method and device for user-defined form control | |
CN110377291A (en) | Structural data conversion method, device, computer equipment and storage medium | |
CN113076167A (en) | Code processing method and related equipment | |
CN112463261B (en) | Interface calling method, device, electronic equipment, medium and product | |
CN111290996A (en) | Document format conversion method, device, equipment and readable storage medium | |
CN117010345A (en) | Method, device, equipment and storage medium for generating function document | |
CN106776779B (en) | Method for generating entity file by JSON data based on Mac platform | |
CN111240790B (en) | Multi-language adaptation method, device, client and storage medium for application | |
CN109947711B (en) | Automatic multi-language file management method in IOS project development process | |
CN111443979B (en) | Document processing method, device, computer equipment and storage medium | |
CN110275712B (en) | Text replacement method, device and equipment | |
CN105279247A (en) | Expression library generation method and device | |
US10922106B2 (en) | Systems and methods for providing globalization features in a service management application interface | |
CN113590564A (en) | Data storage method and device, electronic equipment and storage medium | |
CN115618887B (en) | Dynamic long text internationalization method, device, equipment and storage medium | |
CN110955433B (en) | Automatic deployment script generation method and device | |
CN112445469B (en) | Code generation method, system, computer equipment and storage medium | |
CN110704055B (en) | Interface preposition optimization method and device, electronic equipment and storage medium | |
CN112559930B (en) | Webpage integration method, webpage integration device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |