US2015121199A1PendingUtilityA1

Method for processing and loading web pages supporting multiple languages and system thereof

Assignee: HANGZHOU HIKVISION DIGITAL TECPriority: Jun 1, 2012Filed: Nov 16, 2012Published: Apr 30, 2015
Est. expiryJun 1, 2032(~5.8 yrs left)· nominal 20-yr term from priority
G06F 16/2282G06F 40/131G06F 16/986H03M 7/707G06F 16/958G06F 40/197H03M 7/3088G06F 17/2247G06F 40/58G06F 40/143
45
PatentIndex Score
0
Cited by
0
References
0
Claims

Abstract

The present invention relates to the application field of computer networks, and disclosed are a method for processing and loading a web page supporting multiple languages and a system thereof, so as to reduce time and cost of labor investment when some language is added or modified, save storage capacity of a web page server, increase the speed of page loading and translation rendering, and reduce the redundancy of a translation file set. The present invention is based on a tree-shaped translation file set, where each hypertext markup language (HTML) has a corresponding translation file. The method includes the following steps: scanning all translation files in a translation file set; extracting a same language string in different translation files or in different node sets of a same translation file, and inserting the same language string into a minimum common ancestor translation file of the different translation files or a common node set of the same translation file; deleting the same language string from the original translation files or node sets.

Claims

exact text as granted — not AI-modified
1 . A method for processing a web page supporting multiple languages, based on a tree-shaped translation file set, where each hypertext markup language HTML file has a corresponding translation file, wherein, the method includes the following steps:
 scanning all translation files in the translation file set;   extracting the same language string in different translation files or in different node sets of a same translation file, and inserting the same language string into a minimum common ancestor translation file of the different translation files or a common node set of the same translation file;   deleting the same language string from the original translation files or node sets.   
     
     
         2 . The method for processing a web page supporting multiple languages according to  claim 1 , wherein,
 the translation file is an eXtensible Markup Language file;   one tree-shaped eXtensible Markup Language file set corresponds to one language type.   
     
     
         3 . The method for processing a web page supporting multiple languages according to  claim 1 , wherein,
 the translation file is an eXtensible Markup Language file;   the method further comprises the following steps before the step of scanning all translation files in the translation file set:   querying a language type supported by a web page when the web page is switched from a language file, where the language file is used for storing a set of language types supported by a web page and a default language;   choosing a corresponding tree-shaped eXtensible Markup Language file set according to the language type supported by the web page.   
     
     
         4 . The method for processing a web page supporting multiple languages according to  claim 1 , wherein,
 the translation file is an eXtensible Markup Language file;   the method further comprises the following steps before the step of scanning all translation files in the translation file set:   setting the tags corresponding to the HTML files containing the same strings in the XML files to have a same name property;   writing the same name property into a key name of the same language strings.   
     
     
         5 . The method for processing a web page supporting multiple languages according to  claim 1 , wherein the method comprises the following steps after the step of deleting the same language string from the original translation files or node sets:
 pre-creating corresponding closures for respective code segments relating to dynamic language strings in the HTML files;   compressing the closures into a pre-created callback queue to execute code segments corresponding to respective closures in the callback queue according to a principle that the one entering the callback queue first is executed first, when a web page switches languages.   
     
     
         6 . A method for loading a web page supporting multiple languages, based on a tree-shaped translation file set, where each hypertext markup language HTML file has a corresponding translation file, wherein the method includes the following steps:
 downloading a translation file corresponding to a current HTML file and all ancestor translation files corresponding to the translation file from a server;   combining a language string in the translation file with common the language string in all the ancestor translation files of this translation file;   inserting the combined language string to the language tag content of the HTML file or replacing the language tag content of the HTML file with the combined language string to display or switch multiple languages.   
     
     
         7 . The method for loading a web page supporting multiple languages according to  claim 6 , wherein,
 the translation file is an eXtensible Markup Language file;   one tree-shaped eXtensible Markup Language file set corresponds to one language type.   
     
     
         8 . The method for loading a web page supporting multiple languages according to  claim 6 , wherein the method comprises the following steps before the step of downloading a translation file corresponding to a current HTML file and all ancestor translation files corresponding to the translation file from a server:
 loading a language file, where the language file is used for storing a set of language types supported by a web page and a default language;   querying a language type supported by a loaded web page in the language file;   choosing a corresponding tree-shaped eXtensible Markup Language file set according to the language type supported by the web page.   
     
     
         9 . The method for loading a web page supporting multiple languages according to  claim 6 , wherein,
 the translation file is an eXtensible Markup Language file;   the step of combining a language string in the translation file with the common language string in all the ancestor translation files of this translation file further comprises the following sub-steps:   combining the XML file and all the ancestor XML files of the XML file into one document structure;   scanning a key name of a language string in the combined document structure;   inserting the scanned key name which is taken as index to the language tag content of the HTML file or replacing the language tag content of the HTML file with the scanned key name.   
     
     
         10 . The method for loading a web page supporting multiple languages according to  claim 6 , wherein, the translation file is an eXtensible Markup Language file;
 the step of inserting the combined language string into the language tag content of the HTML file or replacing the language tag content of the HTML file with the combined language string to display or switch multiple languages further comprises the following sub-steps:   executing code segments corresponding to respective closures in the callback queue according to a principle that the one entering the callback queue first is executed first, where the closure is created by a corresponding code segment related to a dynamic language string in the HTML file, and the callback queue can be empty.   
     
     
         11 . A system for processing a web page supporting multiple languages, based on a tree-shaped translation file set, where each hypertext markup language HTML file has a corresponding translation file, wherein, the system includes the following modules:
 a scanning module configured to scan all translation files in the translation file set;   an extracting module configured to extract the same language string in different translation files scanned by the scanning module or in different node sets of a same translation file scanned by the scanning module;   an inserting module configured to insert the same language string extracted by the extracting module into a minimum common ancestor translation file of the different translation files or a common node set of the same translation file;   a deleting module configured to delete the same language string extracted by the extracting module from the original translation files or node sets.   
     
     
         12 . The system for processing a web page supporting multiple languages according to  claim 11 , wherein, the translation file is an eXtensible Markup Language file;
 one tree-shaped eXtensible Markup Language file set corresponds to one language type.   
     
     
         13 . The system for processing a web page supporting multiple languages according to  claim 11 , wherein, the translation file is an eXtensible Markup Language file;
 the system further comprises the following modules:   a query module configured to query a language type supported by a web page when the web page is switched from a language file, where the language file is used for storing a set of language types supported by a web page and a default language;   a choosing module configured to choose a corresponding tree-shaped eXtensible Markup Language file set according to the language type supported by the web page.   
     
     
         14 . The system for processing a web page supporting multiple languages according to  claim 11 , wherein, the translation file is an eXtensible Markup Language file;
 the system further comprises the following modules:   a setting module configured to set the tags corresponding to the HTML files containing the same strings in the XML files to have a same name property;   a writing module configured to write the same name property set by the setting module into a key name of the same language strings.   
     
     
         15 . The system for processing a web page supporting multiple languages according to  claim 11 , wherein, the system further comprises the following modules:
 a queue module configured to pre-create corresponding closures for respective code segments relating to dynamic language strings in the HTML files and compress the closures into a pre-created callback queue;   a callback module configured to execute code segments corresponding to respective closures in the callback queue according to a principle that the one entering the callback queue first is executed first, when a web page switches languages.   
     
     
         16 . A system for loading a web page supporting multiple languages, based on a tree-shaped translation file set, where each hypertext markup language HTML file has a corresponding translation file, wherein, the system includes the following modules:
 a downloading module configured to download a translation file corresponding to a current HTML file and all ancestor translation files corresponding to the translation file from a server;   a combining module configured to combine a language string in the translation file downloaded by the downloading module with common language string in all the ancestor translation files of this translation file;   a translation rendering module configured to insert the combined language string combined by the combining module to the language tag content of the HTML file or replacing the language tag content of the HTML file with the combined language string to display or switch multiple languages.   
     
     
         17 . The system for loading a web page supporting multiple languages according to  claim 16 , wherein, the translation file is an eXtensible Markup Language file;
 one tree-shaped eXtensible Markup Language file set corresponds to one language type.   
     
     
         18 . The system for loading a web page supporting multiple languages according to  claim 16 , wherein, the system further comprises the following modules:
 a loading module configured to load a language file, where the language file is used for storing a set of language types supported by a web page and a default language;   a language querying module configured to query a language type supported by a loaded web page in the language file loaded by the loading module;   a selecting module configured to choose a corresponding tree-shaped eXtensible Markup Language file set according to the language type supported by the web page chosen by the language querying module.   a dynamically translation rendering module configured to execute code segments corresponding to respective index functions in the callback queue according to a principle that the one entering the callback queue first is executed first, where the index function is created by a corresponding code segment related to a dynamic language string in the HTML file, and the callback queue can be empty.

Join the waitlist — get patent alerts

Track US2015121199A1 — get alerts on status changes and closely related new filings.

We store only your email — no account needed. See our privacy policy.