CN104978394A - Webpage tag data organization and update method for multi-language display - Google Patents

Webpage tag data organization and update method for multi-language display Download PDF

Info

Publication number
CN104978394A
CN104978394A CN201510234023.3A CN201510234023A CN104978394A CN 104978394 A CN104978394 A CN 104978394A CN 201510234023 A CN201510234023 A CN 201510234023A CN 104978394 A CN104978394 A CN 104978394A
Authority
CN
China
Prior art keywords
tag
web page
languages
title
data file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510234023.3A
Other languages
Chinese (zh)
Inventor
黄金霖
王晨
王亮
杨浩
高勤胜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anhui Technical College of Mechanical and Electrical Engineering
Original Assignee
Anhui Technical College of Mechanical and Electrical Engineering
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Anhui Technical College of Mechanical and Electrical Engineering filed Critical Anhui Technical College of Mechanical and Electrical Engineering
Priority to CN201510234023.3A priority Critical patent/CN104978394A/en
Publication of CN104978394A publication Critical patent/CN104978394A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a webpage tag data organization and update method for multi-language display. The method comprises: step 101: for multiple languages, creating corresponding multiple data files, wherein the data files store identifiers of tag elements required to be written or be modified in web pages; step 102: acquiring and loading a corresponding language data file according to a selected language, parsing the language data file and traversing a key-value pair array in the language data file; and step 103: substituting the multiple tag element identifiers in the language data file for multiple tag element identifiers of a corresponding web page. According to the invention, the web page tag data organization and update method for multi-language display solves the problem that mass web page codes of a current web site need to be modified in order to support multi-language display and the modification reduces web site maintainability.

Description

Support the web page tag Organization of Data update method of multilingual display
Technical field
The present invention relates to web content data tissue and display packing, particularly, relate to and support multilingual web page element content display Organization of Data update method.
Background technology
Along with the fast development of economy, internationalization trend is more and more obvious, website uses crowd to relate to every country, the various colour of skin, the user of dissimilar (use different language) is had to log in and use website, in order to enable the clog-free access of the crowd of different language and use website, need the info web of different language version, common way writes the webpage of many cover languages, often increase the support to a kind of languages, all need to revise web page code even structure in a large number, when needs amendment structure of web page or information time, need to revise to overlap webpage more simultaneously, the maintainability of website can be reduced like this.
Summary of the invention
The object of this invention is to provide a kind of web page tag Organization of Data update method supporting multilingual display, the web page tag Organization of Data update method of the multilingual display of this support solves current site to be needed to revise a large amount of web page code when realizing the support to multilingual display, reduces the problem of website maintainability.
The invention provides a kind of web page tag Organization of Data update method supporting multilingual display, the method comprises: step 101, for multiple languages, set up corresponding multiple data files, in each data file, comprise in webpage the tag element mark needing to fill or revise; Step 102, the languages according to selecting obtain and load corresponding languages data file, resolve described languages data file, travel through the key-value pair array in described languages data file; Multiple tag element marks in described languages data file are substituted in the multiple tag element marks in corresponding webpage by step 103.
Preferably, in described step 101, in each data file, comprise in webpage the id title, name title or the class title that need the web page element filled or revise.
Preferably, in described step 102, exchange interface according to user or server carries out selection languages.
Preferably, in described step 101, adopt the mode of key-value pair, set up corresponding multiple data files.
Preferably, the method comprises:
Step 104, the tag element mark in described webpage is replaced to new element value content by the naming rule according to tag element mark.
Preferably, at step 104, the naming rule of described tag element mark is:
The id title of web page element is replaced to value id title; The name title of web page element is replaced to value name title by the naming rule according to tag element mark; The class title of web page element is replaced to value class title by the naming rule according to tag element mark.
By above-mentioned embodiment, when website of the present invention will increase the support to new languages, only need the formatted data file increasing corresponding languages corresponding label content, content of pages amendment is not seldom even with amendment, make the change of the languages of website more flexible, to combine closely the programming feature of html and javascript language, the effective substitutions and modifications to most elements content in the page can be realized, and this rule can also have been expanded further.
Other features and advantages of the present invention are described in detail in embodiment part subsequently.
Accompanying drawing explanation
Accompanying drawing is used to provide a further understanding of the present invention, and forms a part for instructions, is used from explanation the present invention, but is not construed as limiting the invention with embodiment one below.In the accompanying drawings:
Fig. 1 is the process flow diagram of the web page tag Organization of Data update method of the multilingual display of support of a kind of preferred implementation of the present invention.
Embodiment
Below in conjunction with accompanying drawing, the specific embodiment of the present invention is described in detail.Should be understood that, embodiment described herein, only for instruction and explanation of the present invention, is not limited to the present invention.
The invention provides a kind of web page tag Organization of Data and the update method of supporting multilingual display, as shown in Figure 1, the method comprises:
Step 101, for multiple languages, sets up corresponding multiple data files, and described data file stores in webpage the tag element mark needing to fill or revise;
Step 102, the languages according to selecting obtain and load corresponding languages data file, resolve described languages data file, travel through the key-value pair array in described languages data file;
Multiple tag element marks in described languages data file are substituted in the multiple tag element marks in corresponding webpage by step 103.
Wherein, key-value pair array is a kind of mode of json data layout tissue, with the mode organising data of key-value pair (key-value), corresponding one or a group element can be found in the page according to key key, and with the displaying contents of value value corresponding to this key according to the naming rule more new element of key.
Create the json formatted data that each languages are corresponding, data layout and explanation (key-value), json data layout is the text formatting being totally independent of language, and it is desirable data interchange language, is easy to people and reads and write.
The present invention is that to organize also be update method, multi-language tag data are with json format organization and be stored in associated documents, the page has been loaded into the rear json file selecting to load corresponding languages according to current language information, traversal json file update page coherent element displaying contents.
In the embodiment example of a kind of json formatted data of the present invention:
First, the corresponding json file of Chinese languages, filename lang_zh.json:
In addition, the corresponding json file of English languages, filename lang_eng.json:
In the above-described embodiment, the step of page loading function onload () acquisition json formatted data comprises:
In the present invention, the concrete mode code of Substitution Rules is as follows:
4 groups of key-value pairs are had in above word, contain the key key of different naming rule in 4, the different element of use is searched update method by the key of different naming rule: 1) XXX_id, representing searching id in the page when searching page elements to be the only element of XXX_id, upgrading its displaying contents; 2) XXX_class, time page elements is searched in expression, will search the group element of one group of class attribute kit containing " XXX_class ", and the real content of this group element of batch updating; 3) XXX_val, representing searching id in the page when searching page elements to be the only element of XXX_val, revising the value attribute of this element; 4) XXX_name, searches the group element that element name is XXX_name, upgrades its content.Above rule all uses value corresponding to key to upgrade the interior perhaps attribute of respective element.
By above-mentioned embodiment, when website of the present invention will increase the support to new languages, only need the formatted data file increasing corresponding languages corresponding label content, content of pages amendment is not seldom even with amendment, make the change of the languages of website more flexible, to combine closely the programming feature of html and javascript language, the effective substitutions and modifications to most elements content in the page can be realized, and this rule can also have been expanded further.
In a kind of embodiment of the present invention, in described step 101, in each data file, comprise in webpage the id title, name title or the class title that need the web page element filled or revise.
In a kind of embodiment of the present invention, in described step 102, interface is exchanged or server carries out selection languages according to user, webpage needs the mark arranging languages so that browser identification request and the json formatted data file loading corresponding languages accordingly when loading, when user is by browser access website, by identifying from main separation languages or by Servers installed languages generation languages the json file obtaining corresponding languages for browser.By above-mentioned mode, the languages of present embodiment are selected.
In this kind of embodiment, in described step 101, adopt the mode of key-value pair, set up corresponding multiple data files, the mode of key-value pair, adopts in such a way, mainly contains some benefit following:
1) be convenient to later maintenance amendment, multiple languages display element content, when needs revise certain element under certain languages during displaying contents, only need to revise the value of relevant key in this languages respective file;
2) in conjunction with the naming rule of key, the multiple different update method of web page element displaying contents can be adapted to, and the complicacy that need not improve array organization is (according to key-value pair method, the naming rule of associative key just can realize multiple different page elements update method, and need not use complicated data organization method).
In this kind of embodiment, the method comprises:
Step 104, tag element mark in described webpage is replaced to new element value content by the naming rule according to tag element mark, the method is update method, when the new languages of needs are changed, only needs tag element mark to be carried out replacing by above-mentioned naming rule.
In this kind of embodiment, at step 104, according to the naming rule of tag element mark, the method that the tag element mark in described webpage replaces to new element value content is comprised:
The id title of web page element is replaced to value id title by the naming rule according to tag element mark; The name title of web page element is replaced to value name title by the naming rule according to tag element mark; The class title of web page element is replaced to valueclass title by the naming rule according to tag element mark.
Above-mentioned embodiment is as follows:
A kind ofly support that in the web page tag Organization of Data update method of multilingual display, most preferably method comprises of the present invention:
Corresponding json data file (json formatted data) is created for each languages, adopt the mode of key-value pair, every data key represents in webpage the tag element mark needing to fill or revise, can be id, name or class title of web page element, key be that English feature is generally English according to html language.Key used in the json formatted data file that each languages are corresponding is identical, and the value that key is corresponding is then element tags names corresponding to each languages; Webpage after loading is complete according to user arrange languages or determine languages by server, obtain and load the json data file of corresponding languages, resolution file, key-value pair array in traversal json data, is substituted in the page page display content of the element being designated key by value value corresponding for each key according to certain rule.
The present invention also provides a kind of label data update method, comprising:
Label data update method gets key title according in said method, the value refresh page surface element strategy using this key corresponding can be determined: be upgrade an element value content based on id according to key naming rule, be that the element content of key or value attribute (the value attribute of the corresponding page note of value herein, but not the value that in json data, key is corresponding) replace with value id by id in the page; Or according to element name, be that a group element content of key replaces with valuename by name in the page; Or according to element class attribute-name, group element content class in the page being comprised key replaces with value class.
Below the preferred embodiment of the present invention is described in detail by reference to the accompanying drawings; but; the present invention is not limited to the detail in above-mentioned embodiment; within the scope of technical conceive of the present invention; can carry out multiple simple variant to technical scheme of the present invention, these simple variant all belong to protection scope of the present invention.
It should be noted that in addition, each concrete technical characteristic described in above-mentioned embodiment, in reconcilable situation, can be combined by any suitable mode, in order to avoid unnecessary repetition, the present invention illustrates no longer separately to various possible array mode.
In addition, also can carry out combination in any between various different embodiment of the present invention, as long as it is without prejudice to thought of the present invention, it should be considered as content disclosed in this invention equally.

Claims (6)

1. support a web page tag Organization of Data update method for multilingual display, it is characterized in that, the method comprises:
Step 101, for multiple languages, sets up corresponding multiple data files, and described data file stores in webpage the tag element mark needing to fill or revise;
Step 102, the languages according to selecting obtain and load corresponding languages data file, resolve described languages data file, travel through the key-value pair array in described languages data file;
Multiple tag element marks in described languages data file are substituted in the multiple tag element marks in corresponding webpage by step 103.
2. the web page tag Organization of Data update method of the multilingual display of support according to claim 1, it is characterized in that, in described step 101, in each data file, comprise in webpage the id title, name title or the class title that need the web page element filled or revise.
3. the web page tag Organization of Data update method of the multilingual display of support according to claim 1, is characterized in that, in described step 102, exchanges interface or server carries out selection languages according to user.
4. the web page tag Organization of Data update method of the multilingual display of support according to claim 1, is characterized in that, in described step 101, adopts the mode of key-value pair, sets up corresponding multiple data files.
5. the web page tag Organization of Data update method of the multilingual display of support according to claim 1, it is characterized in that, the method comprises:
Step 104, the tag element mark in described webpage is replaced to new element value content by the naming rule according to tag element mark.
6. the web page tag Organization of Data update method of the multilingual display of support according to claim 5, is characterized in that, at step 104, the naming rule of described tag element mark is:
The id title of web page element is replaced to value id title; The name title of web page element is replaced to value name title by the naming rule according to tag element mark; The class title of web page element is replaced to value class title by the naming rule according to tag element mark.
CN201510234023.3A 2015-05-08 2015-05-08 Webpage tag data organization and update method for multi-language display Pending CN104978394A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510234023.3A CN104978394A (en) 2015-05-08 2015-05-08 Webpage tag data organization and update method for multi-language display

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510234023.3A CN104978394A (en) 2015-05-08 2015-05-08 Webpage tag data organization and update method for multi-language display

Publications (1)

Publication Number Publication Date
CN104978394A true CN104978394A (en) 2015-10-14

Family

ID=54274899

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510234023.3A Pending CN104978394A (en) 2015-05-08 2015-05-08 Webpage tag data organization and update method for multi-language display

Country Status (1)

Country Link
CN (1) CN104978394A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106534155A (en) * 2016-11-30 2017-03-22 珠海迈越信息技术有限公司 Data processing method and system
CN107122190A (en) * 2017-04-27 2017-09-01 努比亚技术有限公司 A kind of multilingual static page generation method, server and storage medium
CN107357568A (en) * 2017-06-12 2017-11-17 北京天健通泰科技有限公司 A kind of original language replacement method based on multi-lingual label
CN108885544A (en) * 2017-10-10 2018-11-23 深圳中兴力维技术有限公司 Front end page internationalization processing method, application server and computer readable storage medium
CN109035623A (en) * 2018-07-18 2018-12-18 深圳怡化电脑股份有限公司 Interface display method, interface display apparatus and the electronic equipment of self-aided terminal
CN109976840A (en) * 2017-12-27 2019-07-05 航天信息股份有限公司 The method and system of multilingual automatic adaptation are realized under a kind of separation platform based on front and back
CN111105481A (en) * 2018-10-25 2020-05-05 长沙博为软件技术股份有限公司 Method for automatically reading, identifying and formatting json file and recombining, identifying and storing json file
CN114265539A (en) * 2021-10-11 2022-04-01 统信软件技术有限公司 Data display method, computing device and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398845A (en) * 2008-11-05 2009-04-01 深圳市金蝶中间件有限公司 Multi-language binding method and system in web applications
US7957954B2 (en) * 2004-09-02 2011-06-07 International Business Machines Corporation System and computer program product for national language support using a multi-language property file
CN103970751A (en) * 2013-01-28 2014-08-06 鸿富锦精密工业(深圳)有限公司 Multi-language web page converting system and method
CN104281711A (en) * 2014-10-27 2015-01-14 浪潮(北京)电子信息产业有限公司 Multi-language processing method and multi-language processing device for WEB application

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7957954B2 (en) * 2004-09-02 2011-06-07 International Business Machines Corporation System and computer program product for national language support using a multi-language property file
CN101398845A (en) * 2008-11-05 2009-04-01 深圳市金蝶中间件有限公司 Multi-language binding method and system in web applications
CN103970751A (en) * 2013-01-28 2014-08-06 鸿富锦精密工业(深圳)有限公司 Multi-language web page converting system and method
CN104281711A (en) * 2014-10-27 2015-01-14 浪潮(北京)电子信息产业有限公司 Multi-language processing method and multi-language processing device for WEB application

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106534155A (en) * 2016-11-30 2017-03-22 珠海迈越信息技术有限公司 Data processing method and system
CN106534155B (en) * 2016-11-30 2019-11-08 珠海迈越信息技术有限公司 A kind of data processing method and system
CN107122190A (en) * 2017-04-27 2017-09-01 努比亚技术有限公司 A kind of multilingual static page generation method, server and storage medium
CN107357568A (en) * 2017-06-12 2017-11-17 北京天健通泰科技有限公司 A kind of original language replacement method based on multi-lingual label
CN108885544A (en) * 2017-10-10 2018-11-23 深圳中兴力维技术有限公司 Front end page internationalization processing method, application server and computer readable storage medium
CN109976840A (en) * 2017-12-27 2019-07-05 航天信息股份有限公司 The method and system of multilingual automatic adaptation are realized under a kind of separation platform based on front and back
CN109976840B (en) * 2017-12-27 2022-03-04 航天信息股份有限公司 Method and system for realizing multi-language automatic adaptation based on foreground and background separation platform
CN109035623A (en) * 2018-07-18 2018-12-18 深圳怡化电脑股份有限公司 Interface display method, interface display apparatus and the electronic equipment of self-aided terminal
CN111105481A (en) * 2018-10-25 2020-05-05 长沙博为软件技术股份有限公司 Method for automatically reading, identifying and formatting json file and recombining, identifying and storing json file
CN114265539A (en) * 2021-10-11 2022-04-01 统信软件技术有限公司 Data display method, computing device and readable storage medium
CN114265539B (en) * 2021-10-11 2023-07-07 统信软件技术有限公司 Data display method, computing device and readable storage medium

Similar Documents

Publication Publication Date Title
CN104978394A (en) Webpage tag data organization and update method for multi-language display
CN101916192B (en) Multi-language switching method and device for user interface
US8554800B2 (en) System, methods and applications for structured document indexing
CN108351768B (en) Method for implementing a user interface for processing data of an information system while writing a document in a markup language
CN104375808B (en) interface display method and device
US7784026B1 (en) Web application internationalization
US20060004725A1 (en) Automatic generation of a search engine for a structured document
CN102567384A (en) Webpage multi-language dynamic switching method and system based on webpage browser engine
CN103198074A (en) Page design method and system for dynamic publishing website
GB2474839A (en) In-context exact matching of lookup segment to translation memory source text
CN104794177A (en) Data storing method and device
CN103544306A (en) Multi-language display supporting method and device of website
JPH10124495A (en) Original text generation processor and medium for storing program for the same
CN108595697A (en) Webpage integrated approach, apparatus and system
CN102364437A (en) Multi-language site development system and implementation method thereof
CN109976840A (en) The method and system of multilingual automatic adaptation are realized under a kind of separation platform based on front and back
CN104798067A (en) Web server system, dictionary system, dictionary call method, screen control display method, and demonstration application generation method
CN103678486A (en) Method and system for page type setting
CN104281711B (en) The multilingual treating method and apparatus of WEB application
CN108021423A (en) A kind of Multilingual website generating method, system and computer-readable recording medium
WO2008090420A1 (en) System and method of content and translations management in multi-language enabled applications
CN110807298B (en) Method and system for processing marking information
CN111221617A (en) Method and system for multi-language switching in single project based on webpage
McGrath HTML in easy steps
CN104376125B (en) A kind of method that business form dynamic increases and decreases content

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20151014

RJ01 Rejection of invention patent application after publication