CN102982127A - Method of replacing characters in batch to achieve multi-language version and batch processing device - Google Patents
Method of replacing characters in batch to achieve multi-language version and batch processing device Download PDFInfo
- Publication number
- CN102982127A CN102982127A CN2012104585227A CN201210458522A CN102982127A CN 102982127 A CN102982127 A CN 102982127A CN 2012104585227 A CN2012104585227 A CN 2012104585227A CN 201210458522 A CN201210458522 A CN 201210458522A CN 102982127 A CN102982127 A CN 102982127A
- Authority
- CN
- China
- Prior art keywords
- character string
- file
- batch
- excel document
- batches
- 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.)
- Granted
Links
Images
Landscapes
- Document Processing Apparatus (AREA)
Abstract
The invention provides a method of replacing characters in batch to achieve a multi-language version and a batch processing device of the method of replacing characters in batch to achieve the multi-language version. The method of replacing characters in batch to achieve the multi-language version comprises steps as below: (1) separating character strings of each hypertext mark language (HTML) in the way of combing labels with identifications (id) of the character strings, and taking a corresponding javascript (JS) file as a source JS file after identifying raw character strings corresponding with the id of the character strings. (2) All ids and corresponding character strings of each JS file are obtained and are stored in an excel file. (3) Character strings of the excel file is translated into an target language, and a novel excel file is obtained. (4) Character strings of the excel file is written back to the corresponding source JS file, and an objective JS file is obtained. (5) The source JS file is replaced by the target JS file. The method of replacing characters in batch to achieve the multi-language version and the batch processing device of the method of replacing characters in batch to achieve the multi-language version achieves the development of a multi-language version through replacing character strings of the corresponding JS file loaded by the html page, and has the advantages of being accurate, high-efficient, low in cost, and strong in practicality and the like.
Description
Technical field
The present invention relates to Webpage development technique field, relate in particular to a kind of batch and replace method and the batch processing device that WEB webpage character string realizes multi-lingual version.
Background technology
Along with the development of society, the fierceness of competition is starting point in line with consumer uppermost, now, the product that increasing manufacturer provides and associative operation and service can realize that by the access WEB page it is addressable and control that the user need not install client, and be simple, convenient.Professional development, incident is the expansion of service area, the client increases; Demand to the WEB page operation also increases thereupon, and multi-lingual demand is also brought into schedule.And on the product of operation flow more complicated, for example: modem, function and operation relative complex, corresponding WEB operation pages is numerous, the hundreds of page easily, each page has again hundreds of character string; And such product demand abroad is quite vigorous, thereby also very general to multi-lingual demand, if but often develop a kind of language, all need each craft that corresponding language is found out and replaced to the character string on the WEB page, development amount and large, and make mistakes easily; In addition on the one hand, when taking source file away translation, also very inconvenience; So must develop a kind of new technology, to raise the efficiency.
Summary of the invention
The object of the present invention is to provide a kind of batch to replace method and batch processing device that WEB webpage character string realizes multi-lingual version, can batch processing, improve the development efficiency of multi-lingual version, reduce cost.
The objective of the invention is to be achieved through the following technical solutions:
A kind of batch is replaced the method that WEB webpage character string realizes multi-lingual version, comprising:
(1) successively each html page and corresponding JS file are done following the processing:
For the current html page, adopt label in conjunction with the mode of character string id the character string on the html page to be separated; And in the character string corresponding with each character string id of definition in the JS file of the corresponding loading of the current html page, character string corresponding to each character string id is consistent with character string in the current html page, and the JS file after the definition is as source JS file;
(2) batch extracting goes out all id and corresponding character string in each JS file, is saved to original excel document;
(3) character string in the original excel document is translated into target language, obtain new excel document;
(4) character string in the new excel document is write back in batches in the corresponding source JS file, obtain target JS file;
(5) replace corresponding source JS file with target JS file.
Wherein, described label is specially:<span 〉.
Wherein, also comprise: with described original excel document storing, when realizing new language version, repeating step (3) is to (5).
Wherein, realize that according to JS filename and character string id the batch of all id in each JS file and corresponding character string reads.
Wherein, according to JS filename and character string id the character string in the new excel document is write back in the corresponding source JS file in batches.
A kind of batch processing device comprises:
Reading unit is used for according to JS filename and character string id in batches, and batch extracting goes out all character string id and corresponding character string thereof in the JS file, and information extraction is saved to original excel document;
Writing unit is used for according to JS filename and character string id in batches, and the character string after the translation of all character string id in the new excel document and correspondence thereof is write back in the corresponding JS file in batches.
Compared with prior art, the embodiment of the invention has following beneficial effect:
The embodiment of the invention is mainly according to the characteristics of html programming language, in conjunction with independently developed batch treating tool, character string in the batch extracting JS file is translated to the translator, and then the character string after will translating in batches writes the JS file, thereby reach the batch of WEB page character string is replaced, realized the multi-lingual display effect of the WEB page.Not only improve work efficiency in the whole performance history, saved human and material resources and financial resources, and reduced the unknown losses that the manual operations error brings, practical.
Description of drawings
Fig. 1 replaces the method flow diagram that WEB webpage character string realizes multi-lingual version in batches in the embodiment of the invention.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, is not intended to limit the present invention.
In the present embodiment, replacing WEB webpage character string realizes that the method for multi-lingual version may further comprise the steps in batches:
101, successively each html page and corresponding JS file are carried out following processing:
For the current html page, with label each character string on the html page is separated, and in each label, increased a character string id attribute;
Generate one and be used for the JS file (being source JS file) that the current html page loads, in this JS file according to certain character string corresponding to formal definition character string id, the character string that each character string id is corresponding at this moment is consistent with the character string in the current html page, as source string, for further work is prepared.
In the html language, a kind of label<span is arranged 〉, it is the capable interior element that is used to make up in the document, does not have set form, can be by<span in the delegation〉be divided into several zones, thus realize certain certain effects.Thereby, present embodiment utilization<span〉label divides each character string in the html page, and at<span in increase an id attribute (as:<span id=test_01〉this is a test string 1.</span).
102, all id and the corresponding character string that defines in each JS file extracted according to JS filename, character string id with independently developed batch treating tool, deposit the excel document in.
103, the excel shelves are offered translator's translation, the new excel document of generation after translation is finished.
When exploitation, can be with the excel document storing that obtains in the step 102, source file as the character string translation, if will translate any other language later, only this excel document need to be offered the translator, the translator translates corresponding language in character string back corresponding to the every row of excel shelves again and gets final product.
104, the excel document after will translating with independently developed batch treating tool writes back in the corresponding source JS file according to the JS filename of record, the character string id character string after translation, obtains target JS file.
So far, the character string after the corresponding translation of each character string id in the target JS file.As: test_01:this is a new string is 2..
105, replace corresponding source JS file with target JS file.Like this, when the html page shows, the html page can according on the page<span id attribute in the label goes to load in the corresponding target JS file corresponding character string, thereby the html page is final show be target JS document definition the id character string 2., rather than 1. actual character string replaces effect thereby reach character string in the webpage.
In the performance history of multi-lingual version, above-mentioned steps 101,102 work only need be done once, no matter to realize later the demonstration of any other state's language, the work that only needs repeating step 103-105 just, whole process, just translation is after translation is good, but other work is batch processing all, as long as a few minutes can finish.
In the present embodiment, use independently developed batch processing device and carry out above-mentioned batch processing, this device comprises:
Reading unit is used for according to JS filename and character string id in batches, and batch extracting goes out all character string id and corresponding character string thereof in the JS file, and information extraction is saved to original excel document;
Writing unit is used for according to JS filename and character string id in batches, and the character string after the translation of all character string id in the new excel document and correspondence thereof is write back in the corresponding JS file in batches.
To sum up, the present invention has realized the batch processing to character string replacement in the WEB webpage, and is simple to operate, practical, efficient, is convenient to develop multi-lingual version, in time the customer in response demand.
The above only is preferred embodiment of the present invention, not in order to limiting the present invention, all any modifications of doing within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.
Claims (6)
1. a batch is replaced the method that WEB webpage character string realizes multi-lingual version, it is characterized in that the method comprises:
(1) successively each html page and corresponding JS file are done following the processing:
For the current html page, adopt label in conjunction with the mode of character string id the character string on the html page to be separated; And in the character string corresponding with each character string id of definition in the JS file of the corresponding loading of the current html page, character string corresponding to each character string id is consistent with character string in the current html page, and the JS file after the definition is as source JS file;
(2) batch extracting goes out all id and corresponding character string in each JS file, is saved to original excel document;
(3) character string in the original excel document is translated into target language, obtain new excel document;
(4) character string in the new excel document is write back in batches in the corresponding source JS file, obtain target JS file;
(5) replace corresponding source JS file with target JS file.
2. batch as claimed in claim 1 is replaced the method that WEB webpage character string realizes multi-lingual version, it is characterized in that described label is specially:<span 〉.
3. batch as claimed in claim 1 or 2 is replaced the method that WEB webpage character string realizes multi-lingual version, it is characterized in that the method also comprises: with described original excel document storing, when realizing new language version, repeating step (3) is to (5).
4. batch as claimed in claim 1 or 2 is replaced the method that WEB webpage character string realizes multi-lingual version, it is characterized in that, in the method, realizes that according to JS filename and character string id the batch of all id in each JS file and corresponding character string reads.
5. batch as claimed in claim 1 or 2 is replaced the method that WEB webpage character string realizes multi-lingual version, it is characterized in that, in the method, according to JS filename and character string id the character string in the new excel document is write back in the corresponding source JS file in batches.
6. a batch processing device is characterized in that, comprising:
Reading unit is used for according to JS filename and character string id in batches, and batch extracting goes out all character string id and corresponding character string thereof in the JS file, and information extraction is saved to original excel document;
Writing unit is used for according to JS filename and character string id in batches, and the character string after the translation of all character string id in the new excel document and correspondence thereof is write back in the corresponding JS file in batches.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210458522.7A CN102982127B (en) | 2012-11-15 | 2012-11-15 | Batch substitute character string realizes method and the batch-processed devices of multi-lingual version |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210458522.7A CN102982127B (en) | 2012-11-15 | 2012-11-15 | Batch substitute character string realizes method and the batch-processed devices of multi-lingual version |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102982127A true CN102982127A (en) | 2013-03-20 |
CN102982127B CN102982127B (en) | 2015-10-21 |
Family
ID=47856145
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210458522.7A Active CN102982127B (en) | 2012-11-15 | 2012-11-15 | Batch substitute character string realizes method and the batch-processed devices of multi-lingual version |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102982127B (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103279341A (en) * | 2013-05-09 | 2013-09-04 | 四三九九网络股份有限公司 | Method and device for Chinesization of flash games in batches |
WO2016082671A1 (en) * | 2014-11-28 | 2016-06-02 | 深圳市九洲电器有限公司 | Method and system for processing multi-language character string |
CN106648925A (en) * | 2016-11-17 | 2017-05-10 | 捷开通讯(深圳)有限公司 | Mobile terminal and acquisition method of character string information thereof |
CN106802966A (en) * | 2015-11-26 | 2017-06-06 | 北京华大九天软件有限公司 | A kind of method of batch replacement unit name |
CN107329958A (en) * | 2017-06-08 | 2017-11-07 | 努比亚技术有限公司 | Language transfer method and device based on webpage |
CN110083845A (en) * | 2019-04-25 | 2019-08-02 | 数译(成都)信息技术有限公司 | Web page translation method and system |
CN110618816A (en) * | 2019-09-19 | 2019-12-27 | 四川长虹电器股份有限公司 | Python-based iOS APP international file management method |
CN110795915A (en) * | 2018-07-31 | 2020-02-14 | 中兴通讯股份有限公司 | Method, system, equipment and computer-readable storage medium for modifying xml file in batch |
CN111158682A (en) * | 2019-12-27 | 2020-05-15 | 四川天邑康和通信股份有限公司 | ID (identification) -based multi-language page design method and system for router |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101916248A (en) * | 2010-09-03 | 2010-12-15 | 无锡诺宝科技发展有限公司 | Method for translating internet webpage |
CN102508878A (en) * | 2011-10-18 | 2012-06-20 | 深圳市共进电子股份有限公司 | Method for generating standard foreign language page by means of machine translation system |
CN102637168A (en) * | 2012-03-19 | 2012-08-15 | 深圳市共进电子股份有限公司 | Method for realizing automatic language translation in graphical user interface |
-
2012
- 2012-11-15 CN CN201210458522.7A patent/CN102982127B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101916248A (en) * | 2010-09-03 | 2010-12-15 | 无锡诺宝科技发展有限公司 | Method for translating internet webpage |
CN102508878A (en) * | 2011-10-18 | 2012-06-20 | 深圳市共进电子股份有限公司 | Method for generating standard foreign language page by means of machine translation system |
CN102637168A (en) * | 2012-03-19 | 2012-08-15 | 深圳市共进电子股份有限公司 | Method for realizing automatic language translation in graphical user interface |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103279341B (en) * | 2013-05-09 | 2016-08-17 | 四三九九网络股份有限公司 | The method and apparatus of batch Chinesizing flash game |
CN103279341A (en) * | 2013-05-09 | 2013-09-04 | 四三九九网络股份有限公司 | Method and device for Chinesization of flash games in batches |
WO2016082671A1 (en) * | 2014-11-28 | 2016-06-02 | 深圳市九洲电器有限公司 | Method and system for processing multi-language character string |
CN106802966A (en) * | 2015-11-26 | 2017-06-06 | 北京华大九天软件有限公司 | A kind of method of batch replacement unit name |
CN106648925B (en) * | 2016-11-17 | 2020-07-24 | 捷开通讯(深圳)有限公司 | Mobile terminal and method for acquiring character string information thereof |
CN106648925A (en) * | 2016-11-17 | 2017-05-10 | 捷开通讯(深圳)有限公司 | Mobile terminal and acquisition method of character string information thereof |
CN107329958A (en) * | 2017-06-08 | 2017-11-07 | 努比亚技术有限公司 | Language transfer method and device based on webpage |
CN107329958B (en) * | 2017-06-08 | 2021-03-26 | 努比亚技术有限公司 | Language conversion method and device based on webpage |
CN110795915A (en) * | 2018-07-31 | 2020-02-14 | 中兴通讯股份有限公司 | Method, system, equipment and computer-readable storage medium for modifying xml file in batch |
CN110083845A (en) * | 2019-04-25 | 2019-08-02 | 数译(成都)信息技术有限公司 | Web page translation method and system |
CN110618816A (en) * | 2019-09-19 | 2019-12-27 | 四川长虹电器股份有限公司 | Python-based iOS APP international file management method |
CN110618816B (en) * | 2019-09-19 | 2021-08-06 | 四川长虹电器股份有限公司 | Python-based iOS APP international file management method |
CN111158682A (en) * | 2019-12-27 | 2020-05-15 | 四川天邑康和通信股份有限公司 | ID (identification) -based multi-language page design method and system for router |
Also Published As
Publication number | Publication date |
---|---|
CN102982127B (en) | 2015-10-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102982127A (en) | Method of replacing characters in batch to achieve multi-language version and batch processing device | |
CN102693322B (en) | Multi-language supporting webpage processing method, webpage loading method and systems | |
CN101661391B (en) | Object serializing method, object deserializing method, device and system | |
CN102024039B (en) | Form generating method based on electric operation maintenance system (EOMS) | |
CN101916192A (en) | Multi-language switching method and device for user interface | |
CN103559184A (en) | Form page display method and device | |
CN102855244B (en) | Method and device for file catalogue processing | |
CN101271463A (en) | Representation method and system of layout file logical structure information | |
CN103389992A (en) | Structured data storage method and device | |
CN101667118A (en) | Method and device for multi-language version development and replacement | |
CN103412868A (en) | Method and device for generating document | |
CN102637168A (en) | Method for realizing automatic language translation in graphical user interface | |
CN105589959A (en) | Form processing method and form processing system | |
CN103970751A (en) | Multi-language web page converting system and method | |
CN101710282A (en) | Method and device for realizing system support for multi-language resource | |
CN109670129A (en) | A kind of method and device for switching to html web page to be adapted to MIP format | |
CN113076167A (en) | Code processing method and related equipment | |
CN101008940A (en) | Method and device for automatic processing font missing | |
CN107479866A (en) | The method that open terminal applies data and function are realized based on reconfiguration technique | |
CN106776779B (en) | Method for generating entity file by JSON data based on Mac platform | |
CN104375814A (en) | Generation method and device of an interface document | |
CN109491884A (en) | Code method for testing performance, device, computer equipment and medium | |
CN110969501A (en) | Method, system, equipment and storage medium for displaying pages of network shopping cart | |
CN104572730A (en) | Method and device for importing and exporting digital resources | |
CN102855115A (en) | Method and system for displaying character label based on splicing wall |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |