TW202324140A - System for using target language corresponding to page language to displaying webpage and method thereof - Google Patents

System for using target language corresponding to page language to displaying webpage and method thereof Download PDF

Info

Publication number
TW202324140A
TW202324140A TW110146124A TW110146124A TW202324140A TW 202324140 A TW202324140 A TW 202324140A TW 110146124 A TW110146124 A TW 110146124A TW 110146124 A TW110146124 A TW 110146124A TW 202324140 A TW202324140 A TW 202324140A
Authority
TW
Taiwan
Prior art keywords
language
page
character string
string
module
Prior art date
Application number
TW110146124A
Other languages
Chinese (zh)
Inventor
陳龍
徐佳木
Original Assignee
英業達股份有限公司
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 英業達股份有限公司 filed Critical 英業達股份有限公司
Priority to TW110146124A priority Critical patent/TW202324140A/en
Publication of TW202324140A publication Critical patent/TW202324140A/en

Links

Images

Abstract

A system for using a target language corresponding to a page language to displaying a webpage and a method thereof are provided. By loading a language resource file when determining that a page language of a webpage is different from a target language, obtaining a first string of a HTML element contained in the webpage, obtaining a second string corresponding to the first string and being the target language from the language resource file, and replacing the first string with the second string in the webpage, the system and the method can achieve the effect of reducing workload of developers to develop multi-language webpages.

Description

以對應頁面語種之目標語種顯示網頁頁面之系統及方法System and method for displaying web page in target language corresponding to page language

一種多語言網頁顯示系統及其方法,特別係指一種以對應頁面語種之目標語種顯示網頁頁面之系統及方法。A multilingual web page display system and method thereof, particularly a system and method for displaying web pages in a target language corresponding to the page language.

隨著企業產品、民族文化等在文化與經濟在國際間發展,資訊領域的發展主流之一為國際化,也就是讓網頁或應用程式與語言分離,藉以可以輕易地改變網頁或應用程式的語言而無須修改網頁或應用程式。With the international development of corporate products, national culture, etc. in culture and economy, one of the mainstream developments in the information field is internationalization, that is, to separate the webpage or application from the language, so that the language of the webpage or application can be easily changed without modifying web pages or applications.

在網頁專案中,目前讓網頁頁面呈現國際化的多語言方案主要是在頁面中需要呈現多語言的區域填入變數或鍵值,並為各種語言提供不同的資源檔。當客戶端發出頁面請求時,伺服端可以依據變數或鍵值由各個語言的資源檔中讀出對應的字串並以所讀出之字串取代網頁頁面中的變數或鍵值,使得網頁頁面支援多語言。In web projects, the current multilingual solution to make web pages internationalized is mainly to fill in variables or key values in areas that need to be multilingual on the page, and provide different resource files for each language. When the client sends a page request, the server can read the corresponding string from the resource file of each language according to the variable or key value and replace the variable or key value in the web page with the read string, so that the web page Supports multiple languages.

在上述實現方案中,與不提供多語言的網頁相比,開發人員需要先定義鍵值或變數的名稱,並在網頁頁面中的對應位置填入鍵值或變數,而後要收集所有的鍵值或變數並製作對應各種語言的資源檔,如此,增加了開發人員的工作量。同時,因為鍵值或變數需要特別彙整,因此,也容易發生某些網頁頁面中的鍵值或變數被開發人員遺漏而導致在客戶端顯示網頁頁面時鍵值或變數直接被顯示在網頁頁面中的情況。In the above implementation scheme, compared with web pages that do not provide multiple languages, developers need to first define the names of key values or variables, and fill in the key values or variables in the corresponding positions on the web page, and then collect all key values or variables and make resource files corresponding to various languages, thus increasing the workload of developers. At the same time, because the key values or variables need to be specially compiled, it is also easy to happen that the key values or variables in some web pages are omitted by the developer, resulting in the key values or variables being directly displayed in the web page when the client displays the web page Case.

綜上所述,可知先前技術中長期以來一直存在開發多語言網頁會增加開發人員工作量的問題,因此有必要提出改進的技術手段,來解決此一問題。To sum up, it can be seen that there has been a long-standing problem in the prior art that developing multilingual webpages will increase the workload of developers. Therefore, it is necessary to propose improved technical means to solve this problem.

有鑒於先前技術存在開發多語言網頁會增加開發人員工作量的問題,本發明遂揭露一種以對應頁面語種之目標語種顯示網頁頁面之系統及方法,其中:In view of the problem that the development of multilingual webpages in the prior art will increase the workload of developers, the present invention discloses a system and method for displaying webpages in the target language corresponding to the language of the page, wherein:

本發明所揭露之以對應頁面語種之目標語種顯示網頁頁面之系統,至少包含:資料載入模組,用以載入網頁頁面;語種判斷模組,用以判斷判斷網頁頁面之頁面語種與目標語種是否相同,資料載入模組更用以於頁面語種與目標與種不同時,載入語言資源檔;頁面剖析模組,用以剖析網頁頁面之原始碼,並取得網頁頁面所包含之特定網頁元素中之第一字串;字串取代模組,用以由語言資源檔中取得與第一字串對應且為目標語種之第二字串,並於網頁頁面中以第二字串取代第一字串;頁面顯示模組,用以顯示字串取代後之網頁頁面。The system for displaying web pages in the target language corresponding to the page language disclosed by the present invention at least includes: a data loading module for loading web pages; a language judgment module for judging the language and target of the web pages Whether the language is the same, the data loading module is used to load the language resource file when the language of the page is different from the target type; the page analysis module is used to analyze the source code of the web page and obtain the specific information contained in the web page The first character string in the web page element; the character string replacement module is used to obtain the second character string corresponding to the first character string and the target language from the language resource file, and replace it with the second character string in the web page The first string; a page display module, used to display the web page after the string is replaced.

本發明所揭露之以對應頁面語種之目標語種顯示網頁頁面之方法,其步驟至少包括:載入網頁頁面;判斷網頁頁面之頁面語種與目標語種不同時,載入語言資源檔;剖析網頁頁面之原始碼,並取得網頁頁面所包含之特定網頁元素中之第一字串;由語言資源檔中取得與第一字串對應且為目標語種之第二字串;於網頁頁面中以第二字串取代第一字串;顯示字串取代後之網頁頁面。The method for displaying a web page in a target language corresponding to the page language disclosed by the present invention, the steps at least include: loading the web page; judging that the page language of the web page is different from the target language, loading the language resource file; analyzing the content of the web page Source code, and obtain the first character string in the specific web page element contained in the web page; obtain the second character string corresponding to the first character string and the target language from the language resource file; use the second character string in the web page String to replace the first string; display the web page after the string is replaced.

本發明所揭露之系統與方法如上,與先前技術之間的差異在於本發明透過判斷網頁頁面之頁面語種與目標語種不同時載入語言資源檔,並取得網頁頁面所包含之特定網頁元素中之第一字串後,由語言資源檔中取得與第一字串對應且為目標語種之第二字串,於網頁頁面中以第二字串取代第一字串,藉以解決先前技術所存在的問題,並可以達成降低開發人員工作量的技術功效。The system and method disclosed in the present invention are as above, and the difference between it and the prior art is that the present invention loads the language resource file at the same time by judging that the page language of the web page is different from the target language, and obtains the specific web page elements included in the web page. After the first string, obtain the second string corresponding to the first string and the target language from the language resource file, and replace the first string with the second string in the web page, so as to solve the problems existing in the prior art problems, and can achieve the technical effect of reducing the workload of developers.

以下將配合圖式及實施例來詳細說明本發明之特徵與實施方式,內容足以使任何熟習相關技藝者能夠輕易地充分理解本發明解決技術問題所應用的技術手段並據以實施,藉此實現本發明可達成的功效。The features and implementation methods of the present invention will be described in detail below in conjunction with the drawings and embodiments, the content is enough to enable anyone familiar with the relevant art to easily and fully understand the technical means used to solve the technical problems of the present invention and implement them accordingly, thereby realizing The effect that the present invention can achieve.

本發明可以依據網頁頁面的頁面語種將網頁頁面中的文字內容取代為目標語種的同義文字。其中,目標語種通常為使用者的第一語言或慣用語言,但本發明並不以此為限。According to the page language of the web page, the present invention can replace the text content in the web page with the synonymous text of the target language. Wherein, the target language is usually the user's first language or customary language, but the present invention is not limited thereto.

以下先以「第1圖」本發明所提之以對應頁面語種之目標語種顯示網頁頁面之系統架構圖來說明本發明的系統運作。如「第1圖」所示,本發明之系統應用在客戶端100中,含有資料載入模組110、語種判斷模組120、頁面剖析模組130、字串取代模組150、頁面顯示模組160,及可附加的資料傳輸模組170。其中,要說明的是,客戶端100可以是習知的網頁瀏覽程式,如此,資料載入模組110與頁面顯示模組160為客戶端100的原有功能,語種判斷模組120、頁面剖析模組130、字串取代模組150、資料傳輸模組170等模組則可以由客戶端100之外掛程式或擴充元件所提供,但本發明並不以此為限,客戶端100也可以是包含本發明之語種判斷模組120、頁面剖析模組130、字串取代模組150、資料傳輸模組170等模組的新網頁瀏覽程式。The system operation of the present invention will be described below with "Fig. 1", a system architecture diagram of displaying webpages in the target language corresponding to the page language mentioned in the present invention. As shown in "Fig. 1", the system of the present invention is applied in the client terminal 100, including a data loading module 110, a language judgment module 120, a page analysis module 130, a string replacement module 150, and a page display module. group 160, and an optional data transfer module 170. Among them, it should be noted that the client 100 can be a known web browsing program, so the data loading module 110 and the page display module 160 are the original functions of the client 100, the language judgment module 120, page analysis Modules such as the module 130, the string replacement module 150, and the data transmission module 170 can be provided by plug-ins or expansion components of the client 100, but the present invention is not limited thereto, and the client 100 can also be A new webpage browsing program including modules such as the language judgment module 120, the page analysis module 130, the word string replacement module 150, and the data transmission module 170 of the present invention.

資料載入模組110負責載入網頁頁面(webpage)。一般而言,網頁頁面是向伺服端200請求而取得,但本發明並不以此為限,例如,資料載入模組110也可以直接載入儲存於客戶端100上的網頁頁面。The data loading module 110 is responsible for loading webpages. Generally speaking, the webpage is obtained by requesting the server 200 , but the present invention is not limited thereto. For example, the data loading module 110 can also directly load the webpage stored on the client 100 .

資料載入模組110也負責載入語言資源檔。一般而言,資料載入模組110可以在語種判斷模組120產生資源載入訊息時或語種判斷模組120所產生之語種判斷結果表示語種不同時,載入與語種判斷模組120所判斷出之頁面語種對應的語言資源檔,但資料載入模組110判斷載入語言資源檔之時機並不以上述為限。資料載入模組110所載入的語言資源檔中可以記載以頁面語種呈現之各種單字、單詞與句子在以目標語種所呈現之同意的文字及目標語種的語種識別資料。例如,若頁面語種為中文,目標語種為英文,則語言資源檔中可以包含以頁面語種呈現的單詞「使用者帳號」、目標語種的語種識別資料「en-us」、及以目標語種呈現之相同意義的單詞「account」。The data loading module 110 is also responsible for loading language resource files. Generally speaking, the data loading module 110 can load the resources determined by the language judging module 120 when the language judging module 120 generates a resource loading message or when the language judging result generated by the language judging module 120 indicates that the languages are different. The language resource file corresponding to the language of the displayed page, but the timing for the data loading module 110 to determine the loading of the language resource file is not limited to the above. The language resource file loaded by the data loading module 110 can record various words, words and sentences presented in the language of the page, the agreed text presented in the target language and the language identification data of the target language. For example, if the language of the page is Chinese and the target language is English, the language resource file may contain the word "user account" presented in the language of the page, the language identification data "en-us" of the target language, and the word "en-us" presented in the target language The word "account" in the same sense.

語種判斷模組120負責判斷資料載入模組110所載入之網頁頁面的頁面語種。舉例來說,語種判斷模組120可以取得網頁頁面的頁面內碼(codepage),並依據頁面內碼得知網頁頁面的頁面語種;語種判斷模組120也可以依據儲存網頁頁面所使用的編碼得知網頁頁面的頁面語種;語種判斷模組120也可以依據網頁頁面中之字符所屬的字元集得知網頁頁面的頁面語種,但語種判斷模組120取得網頁頁面之頁面語種的方式並不以上述為限。The language judging module 120 is responsible for judging the language of the web page loaded by the data loading module 110 . For example, the language judgment module 120 can obtain the page internal code (codepage) of the webpage, and obtain the page language of the webpage according to the page internal code; the language judgment module 120 can also obtain the Know the page language of the web page; the language judgment module 120 can also know the page language of the web page according to the character set to which the characters in the web page belong, but the language judgment module 120 does not use the method of obtaining the page language of the web page The above is limited.

語種判斷模組120也負責判斷所取得之網頁頁面的頁面語種與目標語種是否相同,並負責在判斷頁面語種與目標語種不同時通知資料載入模組110,例如,語種判斷模組120可以在判斷頁面語種與目標語種不同時產生資源載入訊息並可以將資源載入訊息提供給資料載入模組110,也可以產生頁面語種與目標語種是否相同的語種判斷結果並將語種判斷結果提供給資料載入模組110,但本發明並不以此為限。其中,語種判斷模組120可以提供設定目標語種。The language judging module 120 is also responsible for judging whether the page language of the obtained web page is the same as the target language, and is responsible for notifying the data loading module 110 when judging that the page language is different from the target language. For example, the language judging module 120 can be in When it is judged that the page language is different from the target language, a resource loading message is generated and the resource loading message can be provided to the data loading module 110, and a language judgment result of whether the page language and the target language are the same can also be generated and the language judgment result can be provided to The data is loaded into the module 110, but the present invention is not limited thereto. Wherein, the language judging module 120 can provide setting target language.

頁面剖析模組130負責剖析(phase)資料載入模組110所載入之網頁頁面的原始碼。由於剖析網頁頁面之原始碼的方式已為習知,如習知網頁瀏覽程式所使用之方式,故本發明不再贅述。The page analysis module 130 is responsible for analyzing (phase) the source code of the web page loaded by the data loading module 110 . Since the method of analyzing the source code of a web page is known, such as the method used by a conventional web browsing program, the present invention will not repeat it.

頁面剖析模組130也負責依據資料載入模組110所載入之網頁頁面的剖析結果取得網頁頁面所包含的各種網頁元素,並負責由所取得之特定的網頁元素(在本發明中也可能以「特定網頁元素」表示)中取出元素內容,在本發明中被頁面剖析模組130所取出的元素內容也被稱為「第一字串」。其中,特定網頁元素為能夠在網頁頁面中呈現元素內容的網頁元素,包含但不限於p元素、div元素、span元素、lable元素等容器元素。The page analysis module 130 is also responsible for obtaining various webpage elements contained in the webpage according to the analysis results of the webpage loaded by the data loading module 110, and is responsible for obtaining specific webpage elements (in the present invention, it is also possible to Denoted by "specific web page element", the element content extracted by the page analysis module 130 in the present invention is also called "first string". Wherein, the specific webpage element is a webpage element capable of presenting element content in a webpage, including but not limited to p element, div element, span element, label element and other container elements.

頁面剖析模組130也可以先判斷特定網頁元素的屬性是否滿足替換條件,並可以在特定網頁元素之屬性滿足替換條件時才由特定網頁元素中取出第一字串。其中,替換條件可以是特定網頁元素之屬性為特定字串或特定屬性之資料為特定字串等,但本發明所提之替換條件並不以上述為限。The page analysis module 130 can also first determine whether the attribute of the specific webpage element meets the replacement condition, and can extract the first character string from the specific webpage element only when the attribute of the specific webpage element meets the replacement condition. Wherein, the replacement condition may be that the attribute of a specific webpage element is a specific string or the data of a specific attribute is a specific string, etc., but the replacement conditions mentioned in the present invention are not limited to the above.

字串取代模組150負責判斷資料載入模組110所載入之語言資源檔中是否包含頁面剖析模組130所取得之第一字串。字串取代模組150也負責在語言資源檔中包含第一字串時,由語言資源檔中取得與第一字串及與目標語種之語種識別資料對應的第二字串,也就是取得與第一字串同意且以目標語種呈現的第二字串。字串取代模組150並負責將資料載入模組110所載入之網頁頁面中的第一字串取代為第二字串。The string replacement module 150 is responsible for judging whether the language resource file loaded by the data loading module 110 contains the first string obtained by the page analysis module 130 . The string replacement module 150 is also responsible for obtaining the second string corresponding to the first string and the language identification data of the target language from the language resource file when the first string is included in the language resource file, that is, obtaining the second string corresponding to the language identification data of the target language. The first string agrees with the second string in the target language. The character string replacing module 150 is responsible for replacing the first character string in the web page loaded by the data loading module 110 with the second character string.

頁面顯示模組160負責顯示字串取代模組150將第一字串取代為第二字串後的網頁頁面。The page display module 160 is responsible for displaying the webpage after the string replacement module 150 replaces the first string with the second string.

資料傳輸模組170可以在字串取代模組150判斷資料載入模組110所載入之語言資源檔中沒有包含頁面剖析模組130所取得的第一字串時,將第一字串及目標語種的語種識別資料傳送給伺服端200。在部分的實施例中,字串取代模組150可以透過非同步方法( Asynchronous Method)將第一字串傳送給伺服端200,但本發明並不以此為限。 The data transfer module 170 may replace the first character string and The language identification data of the target language is sent to the server 200 . In some embodiments, the string replacement module 150 can transmit the first string to the server 200 through an asynchronous method ( Asynchronous Method ), but the present invention is not limited thereto.

伺服端200可以提供網頁頁面及語言資源檔。伺服端200更可以如「第2圖」之元件示意圖所示,包含網路服務模組210、資料處理模組220、字串產生模組230、資料編輯模組240、資源更新模組250。The server 200 can provide web pages and language resource files. The server 200 can further include a network service module 210 , a data processing module 220 , a character string generation module 230 , a data editing module 240 , and a resource updating module 250 as shown in the schematic diagram of components in “FIG. 2 ”.

網路服務模組210可以傳送客戶端100所請求的網頁頁面與語言資源檔,並可以接收客戶端100所傳送的第一字串及語種識別資料。其中,網路服務模組210可以包含網頁伺服元件(圖中未示),網頁伺服元件可以提供網頁頁面與語言資源檔給客戶端100,並可以提供應用程式介面(API)給客戶端100上傳第一字串,但本發明並不以此為限,例如,網路服務模組210也可以包含提供網頁頁面與語言資源檔的網頁伺服元件及提供應用程式介面的資料接收元件。The network service module 210 can transmit the web pages and language resource files requested by the client 100 , and can receive the first character string and language identification data transmitted by the client 100 . Wherein, the network service module 210 can include a web server component (not shown in the figure), and the web server component can provide web pages and language resource files to the client 100, and can provide an application programming interface (API) for the client 100 to upload The first character string, but the present invention is not limited thereto. For example, the web service module 210 may also include web server components providing web pages and language resource files, and data receiving components providing APIs.

資料處理模組220可以儲存網路服務模組210所接收到的第一字串及語種識別資料。舉例來說,資料處理模組220可以將第一字串與語種識別資料儲存到待辦資源檔中。在部分的實施例中,資料處理模組220也可以在接收到第一字串時通知管理者。The data processing module 220 can store the first character string and language identification data received by the network service module 210 . For example, the data processing module 220 can store the first character string and the language identification data in the to-do resource file. In some embodiments, the data processing module 220 may also notify the administrator when receiving the first string.

字串產生模組230可以取得與資料處理模組220所儲存之第一字串對應的第二字串。例如,字串產生模組230可以先依據資料處理模組220所儲存之語種識別資料取得對應的目標語種,再產生包含目標語種與資料處理模組220所儲存之第一字串的翻譯請求,並可以將所產生之翻譯請求傳送給外部伺服器(圖中未示),及可以接收外部伺服器依據目標語種翻譯第一字串所產生之翻譯結果,其中,字串產生模組230所接收到之翻譯結果即為第二字串;又如,字串產生模組230也可以使用執行伺服端200之計算設備中的翻譯資料庫查詢第一字串在與語種識別資料對應之目標語種所呈現的文字。但字串產生模組230取得與第一字串對應之第二字串的方式並不以上述為限。The string generation module 230 can obtain a second string corresponding to the first string stored in the data processing module 220 . For example, the character string generating module 230 can first obtain the corresponding target language according to the language identification data stored in the data processing module 220, and then generate a translation request including the target language and the first character string stored in the data processing module 220, And the generated translation request can be sent to an external server (not shown in the figure), and the translation result generated by the external server according to the target language translation of the first string can be received, wherein the string generation module 230 receives The obtained translation result is the second string; for another example, the string generation module 230 can also use the translation database in the computing device executing the server 200 to query the first string in the target language corresponding to the language identification data. The rendered text. However, the manner in which the character string generation module 230 obtains the second character string corresponding to the first character string is not limited to the above.

資料編輯模組240可以提供輸入與資料處理模組220所儲存之第一字串對應的第二字串。資料編輯模組240可以在執行伺服端200之計算設備上提供使用者介面,使得開發管理人員透過使用者介面輸入以目標語種呈現之與第一字串同意的第二字串;資料編輯模組240也可以透過網路服務模組210提供使用者介面給管理端(圖中未示),使得開發維護人員可以操作管理端在使用者介面中輸入以目標語種呈現之與第一字串同意的第二字串並將第二字串傳送到伺服端200,藉以讓資料編輯模組240透過網路服務模組210取得第二字串。但資料編輯模組240取得與第一字串對應之第二字串的方式並不以上述為限。其中,資料編輯模組240所提供之使用者介面能夠顯示第一字串及提示與資料處理模組220所儲存之語種識別資料所表示之目標語種。The data editing module 240 may input a second character string corresponding to the first character string stored in the data processing module 220 . The data editing module 240 can provide a user interface on the computing device that executes the server 200, so that the development manager can input the second character string that agrees with the first character string presented in the target language through the user interface; the data editing module 240 can also provide a user interface to the management terminal (not shown in the figure) through the network service module 210, so that the development and maintenance personnel can operate the management terminal to enter the user interface in the target language and agree with the first character string. and send the second character string to the server 200 so that the data editing module 240 can obtain the second character string through the network service module 210 . However, the method for the data editing module 240 to obtain the second character string corresponding to the first character string is not limited to the above. Wherein, the user interface provided by the data editing module 240 can display the first character string and the target language represented by the prompt and the language identification data stored in the data processing module 220 .

在部分的實施例中,資料編輯模組240也可以檢核被輸入之第二字串是否為與資料處理模組220所儲存之語種識別資料對應的目標語種。In some embodiments, the data editing module 240 may also check whether the input second character string is the target language corresponding to the language identification data stored in the data processing module 220 .

資源更新模組250可以將資料處理模組220所儲存之語種識別資料及字串產生模組230或資料編輯模組240所取得的第二字串加入提供給客戶端100的語言資源檔中。舉例來說,資源更新模組250可以開啟與第一字串之語種對應的語言資源檔中,並可以在語言資源檔中搜尋第一字串。若有搜尋到第一字串,則資源更新模組250可以將語種識別資料與第二字串依照預定的格式加入記載第一字串的段落中,藉以將語種識別資料與第二字串寫入語言資源檔中;而若資源更新模組250沒有搜尋到第一字串,則資源更新模組250可以將第一字串、語種識別資料及第二字串依照預定的格式寫入語言資源檔的最後段落或符合排序(如依筆畫或部首排序)的段落。The resource updating module 250 can add the language identification data stored in the data processing module 220 and the second string obtained by the string generating module 230 or the data editing module 240 into the language resource file provided to the client 100 . For example, the resource update module 250 can open a language resource file corresponding to the language of the first string, and can search for the first string in the language resource file. If the first string is found, the resource update module 250 can add the language identification data and the second string to the paragraph recording the first string according to a predetermined format, so as to write the language identification data and the second string and if the resource update module 250 does not find the first character string, then the resource update module 250 can write the first character string, the language identification data and the second character string into the language resource according to a predetermined format The last paragraph of the file or the paragraphs that match the sorting (such as sorting by strokes or radicals).

資源更新模組250也可以依據開發維護人員所管理之資源整合檔產生與一種或多種語種對應的語言資源檔。一般而言,資源整合檔包含多個鍵值及與各個鍵值對應的語言資料。其中,資源整合檔中的鍵值不會重複,但可能與不同語種的鍵值具有相同的意義,例如,資源整合檔中可以同時存在「使用者帳號」與「Account」兩個鍵值;每一個鍵值可以對應一筆或多筆語言資料,每一筆語言資料可以包含特定語種的語種識別資料及以特定語種呈現之與鍵值相同意義的文字。The resource update module 250 can also generate language resource files corresponding to one or more languages according to the resource integration files managed by the development and maintenance personnel. Generally speaking, a resource integration file includes multiple key values and language data corresponding to each key value. Among them, the key values in the resource integration file will not be repeated, but may have the same meaning as the key values in different languages. A key value can correspond to one or more language data, and each language data can contain language identification data of a specific language and words with the same meaning as the key value presented in a specific language.

資源更新模組250可以由資源整合檔中分別取出鍵值之語種相同的語言資料,並分別將所取出之語言資料儲存為與被取出之語言資料之語種對應的語言資源檔,藉以產生與各語種對應的語言資源檔;資源更新模組250也可以由資源整合檔中取出鍵值之為特定語種的語言資料,並將所取出之語言資料儲存為與該特定語種對應的語言資源檔。The resource update module 250 can extract the language data of the same language as the key value from the resource integration file, and store the extracted language data as language resource files corresponding to the language of the extracted language data, so as to generate The language resource file corresponding to the language; the resource update module 250 can also extract the language data whose key value is a specific language from the resource integration file, and store the extracted language data as a language resource file corresponding to the specific language.

但資源更新模組250產生語言資源檔的方式並不以上述為限,例如,資源更新模組250也可以依據資源整合檔產生同時與兩種語種對應的語言資源檔,例如,產生同時與頁面語種與目標語種對應的語言資源檔,更詳細的,資源更新模組250可以由資源整合檔中取出鍵值為頁面語種且包含以目標語種呈現之文字的語言資料,如此,資源更新模組250便可以產生包含第一字串與第二字串之與頁面語種及目標語種對應的語言資源檔。However, the way the resource update module 250 generates language resource files is not limited to the above. For example, the resource update module 250 can also generate language resource files corresponding to two languages at the same time according to the resource integration file. The language resource file corresponding to the language type and the target language type. In more detail, the resource update module 250 can extract the language data whose key value is the page language and contains text presented in the target language type from the resource integration file. In this way, the resource update module 250 Then a language resource file corresponding to the page language and the target language including the first character string and the second character string can be generated.

資源更新模組250可以在判斷語言資源檔不存在時依據資源整合檔產生語言資源檔。例如,資源更新模組250可以在伺服端200被啟動時檢查與各個語種對應的語言資源檔是否存在或可以在特定語種對應的語言資源檔被開啟時先檢查與該語種對應的語言資源檔是否存在。若有語言資源檔不存在,則資源更新模組250可以產生相對應的語言資源檔。The resource update module 250 can generate the language resource file according to the resource integration file when it is determined that the language resource file does not exist. For example, the resource update module 250 can check whether the language resource file corresponding to each language exists when the server 200 is started, or can first check whether the language resource file corresponding to the language is opened when the language resource file corresponding to the specific language is opened. exist. If a language resource file does not exist, the resource update module 250 can generate a corresponding language resource file.

要特別說明的是,客戶端100與伺服端200通常可以被安裝在不同的計算設備上執行,分別執行客戶端100與伺服端200的計算設備可以透過有線或無線網路相互傳遞資料或訊號。但本發明並不限於將客戶端100與伺服端200安裝在兩個不同的計算設備上執行,客戶端100與伺服端200也可以安裝在同一個計算設備上執行,在此情況下,客戶端100的資料傳輸模組170可以不存在,字串取代模組150可以將第一字串直接提供給網路服務模組220或資料處理模組220。It should be noted that the client 100 and the server 200 can generally be installed and executed on different computing devices, and the computing devices respectively executing the client 100 and the server 200 can transmit data or signals to each other through a wired or wireless network. However, the present invention is not limited to installing the client 100 and the server 200 on two different computing devices. The client 100 and the server 200 can also be installed on the same computing device. In this case, the client The data transmission module 170 of 100 may not exist, and the string replacement module 150 may directly provide the first string to the network service module 220 or the data processing module 220 .

接著以一個實施例來解說本發明的運作系統與方法,並請參照「第3A圖」本發明所提之以對應頁面語種之目標語種顯示網頁頁面之方法流程圖。Next, an embodiment is used to illustrate the operating system and method of the present invention, and please refer to "FIG. 3A" for the flow chart of the method for displaying web pages in the target language corresponding to the page language in the present invention.

當網頁開發人員使用本發明開發多語言網頁時,網頁開發人員可以操作客戶端100瀏覽欲測試的網頁,使得客戶端100中的資料載入模組110由伺服端200載入網頁頁面(步驟310)。在本實施例中,不論客戶端100與伺服端200是在相同的計算設備中執行或分別在透過網路連接的不同計算設備中執行,資料載入模組110都可以向伺服器200的網路服務模組210請求下載網頁並在完成網頁下載後載入網頁頁面。When a webpage developer uses the present invention to develop a multilingual webpage, the webpage developer can operate the client 100 to browse the webpage to be tested, so that the data loading module 110 in the client 100 is loaded into the webpage by the server 200 (step 310 ). In this embodiment, regardless of whether the client 100 and the server 200 are executed in the same computing device or are executed in different computing devices connected through the network, the data loading module 110 can send data to the network of the server 200 The road service module 210 requests to download the webpage and loads the webpage after the webpage is downloaded.

在客戶端100的資料載入模組110載入網頁頁面(步驟310)後,客戶端100的語種判斷模組120可以判斷被載入之網頁頁面的頁面語種是否與目標語種相同。在本實施例中,若客戶端100為習知之瀏覽器程式,網頁開發人員可以在客戶端100中安裝支援本發明的外掛程式或擴充元件,使得客戶端100在外掛程式或擴充元件被執行後包含本發明的各個模組;網頁開發人員也可以在欲測試的網頁中加入載入支援本發明之腳本檔案的語法,使得客戶端110在載入網頁頁面後繼續載入並執行腳本檔案而產生本發明的語種判斷模組120、頁面剖析模組130、字串取代模組150等模組。After the data loading module 110 of the client 100 loads the webpage (step 310 ), the language judging module 120 of the client 100 can judge whether the page language of the loaded webpage is the same as the target language. In this embodiment, if the client 100 is a known browser program, the webpage developer can install a plug-in program or an extension component supporting the present invention in the client 100, so that the client 100 is executed after the plug-in program or extension component is executed. Including various modules of the present invention; webpage developers can also add the grammar of loading script files supporting the present invention in the webpage to be tested, so that the client 110 continues to load and execute the script file after loading the webpage to generate The language judgment module 120, the page analysis module 130, the word string replacement module 150 and other modules of the present invention.

若客戶端100的語種判斷模組120判斷資料載入模組110所載入之網頁頁面的頁面語種與目標語種相同,則字串取代模組150不會取代網頁頁面中的任何字串,頁面顯示模組160可以依據資料載入模組110所載入之網頁頁面的原始碼顯示網頁頁面的網頁內容;而若客戶端100的語種判斷模組120判斷資料載入模組110所載入之網頁頁面的頁面語種與目標語種不同,則資料載入模組110可以載入語言資源檔(步驟320)。在本實施例中,假設頁面語種為中文,目標語種為英文,則語種判斷模組120可以產生包含下載路徑的資源載入訊息,資料載入模組110可以依據下載路徑載入與頁面語種對應的語言資源檔或資源整合檔。If the language judgment module 120 of the client 100 judges that the page language of the web page loaded by the data loading module 110 is the same as the target language, then the character string replacement module 150 will not replace any character string in the web page, and the page The display module 160 can display the webpage content of the webpage according to the source code of the webpage loaded by the data loading module 110; If the page language of the web page is different from the target language, the data loading module 110 can load the language resource file (step 320 ). In this embodiment, assuming that the language of the page is Chinese and the target language is English, the language judgment module 120 can generate a resource loading message including the download path, and the data loading module 110 can load the resource corresponding to the language of the page according to the download path. language resource file or resource integration file for .

實務上,在伺服端200被執行時,或在資料載入模組請求下載與所載入之網頁頁面之頁面語種對應的語言資源檔時,伺服端200的資源更新模組250可以如「第3B圖」之流程所示,依據單一語種或任意兩語種之組合由資源整合檔中取出語言資料以產生相對應的語言資源檔(步驟390),例如,資源更新模組250可以由資源整合檔中取出鍵值之語種為中文的語言資料以產生與中文對應的語言資源檔,相似的,資源更新模組250也可以由資源整合檔中分別取出鍵值之語種為英文、日文、或西文的語言資料並產生分別與英文、日文、或西文等單一語種對應的語言資源檔;資源更新模組250也可以由資源整合檔中取出鍵值之語種為中文且語種識別資料表示為英文之語言資料,相似的,資源更新模組250也可以由資源整合檔中取出鍵值之語種為中文且語種識別資料表示為日文/西文之語言資料,且由資源整合檔中取出鍵值之語種為英文且語種識別資料表示為中文/日文/西文之語言資料,藉以產生分別與中文及英文(或日文、或西文)、英文及中文(或日文、或西文)等兩種語種對應的語言資源檔。In practice, when the server 200 is executed, or when the data loading module requests to download the language resource file corresponding to the page language of the loaded webpage, the resource update module 250 of the server 200 can be as follows: As shown in the flow chart of Figure 3B, the language data is extracted from the resource integration file according to a single language or any combination of two languages to generate a corresponding language resource file (step 390). Take out the language data whose key value is Chinese to generate a language resource file corresponding to Chinese. Similarly, the resource update module 250 can also extract the key value language from the resource integration file as English, Japanese, or Western. language data and generate language resource files corresponding to a single language such as English, Japanese, or Western; the resource update module 250 can also extract the language of the key value from the resource integration file as Chinese and the language identification data as English Language data, similarly, the resource update module 250 can also extract the language of the key value from the resource integration file as Chinese and the language identification data is expressed as Japanese/Western language data, and extract the language of the key value from the resource integration file It is English and the language identification data is expressed as Chinese/Japanese/Western language data, so as to generate corresponding to Chinese and English (or Japanese or Western), English and Chinese (or Japanese or Western) and other two languages language resource file for .

同樣在客戶端100的資料載入模組110載入網頁頁面(步驟310)後,客戶端100的頁面剖析模組130可以剖析被載入之網頁頁面的原始碼,並取得網頁頁面所包含之特定網頁元素中的第一字串(步驟330)。在本實施例中,假設頁面剖析模組130可以如「第3C圖」之流程所示,在剖析網頁頁面(步驟331)後,可以取得網頁頁面中的所有網頁元素(步驟333),並可以由所取得之網頁元素中篩選出容器元素。其中,頁面剖析模組130更可以逐一判斷所取得之網頁元素(容器元素)的屬性是否滿足替換條件(步驟335),若否,則頁面剖析模組130將繼續判斷其他未判斷過是否滿足替換條件的網頁元素(步驟339),而若頁面剖析模組130判斷網頁元素的屬性滿足替換條件,例如網頁元素存在「noi18n」的屬性,或網頁元素的某個屬性值為「noi18n」,則頁面剖析模組130可以由網頁元素中取得元素內容作為第一字串(步驟337),並持續判斷是否還有未判斷是否滿足替換條件的網頁元素(步驟339),直到所有取得的網頁元素都經過判斷為止。Also after the data loading module 110 of the client 100 loads the web page (step 310), the page analysis module 130 of the client 100 can analyze the source code of the loaded web page, and obtain the information contained in the web page. The first string in a specific web page element (step 330). In this embodiment, it is assumed that the page analysis module 130 can obtain all web page elements in the web page (step 333) after analyzing the web page (step 331), as shown in the flow of "Fig. 3C", and can Filter out container elements from the obtained web page elements. Among them, the page analysis module 130 can further judge whether the attributes of the acquired web page elements (container elements) meet the replacement conditions (step 335), if not, the page analysis module 130 will continue to judge whether other elements that have not been judged meet the replacement conditions. Conditional webpage element (step 339), and if the page analysis module 130 determines that the attribute of the webpage element satisfies the replacement condition, for example, the webpage element has the attribute "noi18n", or a certain attribute value of the webpage element is "noi18n", then the page The analysis module 130 can obtain the element content from the webpage element as the first string (step 337), and continue to judge whether there are any webpage elements that have not been judged whether they meet the replacement conditions (step 339), until all the webpage elements obtained have been passed until judgement.

在客戶端100的頁面剖析模組130取得資料載入模組110所載入之網頁頁面所包含之特定網頁元素中的第一字串(步驟330)後,客戶端100的字串取代模組150可以由資料載入模組110所載入之語言資源檔中取得與第一字串對應且為目標語種的第二字串(步驟350),並可以在網頁頁面中使用所取得之第二字串取代第一字串(步驟360)。在本實施例中,假設字串取代模組150可以由與網頁頁面之頁面語種對應的語言資源檔中取得鍵值為第一字串且與種識別資料表示為目標語種的第二字串,並可以將網頁頁面中的第一字串取代為第二字串,例如,第一字串為「使用者帳號」,第二字串為「Account」。After the page analysis module 130 of the client 100 obtains the first string in the specific webpage element contained in the webpage loaded by the data loading module 110 (step 330), the string of the client 100 replaces the module 150 can obtain the second character string corresponding to the first character string and being the target language from the language resource file loaded by the data loading module 110 (step 350), and can use the obtained second character string in the webpage The string replaces the first string (step 360). In this embodiment, it is assumed that the string replacement module 150 can obtain the second string whose key value is the first string and which is represented as the target language by the type identification data from the language resource file corresponding to the page language of the web page, And the first character string in the web page can be replaced by the second character string, for example, the first character string is "user account number" and the second character string is "Account".

在客戶端100的字串取代模組150在網頁頁面中以所取得之第二字串取代第一字串(步驟360)後,客戶端100的頁面顯示模組160可以顯示第一字串被第二字串取代的網頁頁面(步驟370)。在本實施例中,中文的網頁頁面將被頁面顯示模組160顯示為英文的網頁頁面。After the character string replacement module 150 of the client 100 replaces the first character string with the obtained second character string in the web page (step 360), the page display module 160 of the client 100 can display that the first character string is replaced The web page to be replaced by the second string (step 370). In this embodiment, the Chinese webpage will be displayed as an English webpage by the page display module 160 .

另外,在客戶端100的字串取代模組150由資料載入模組110所載入之語言資源檔中取得與第一字串對應且為目標語種的第二字串(步驟350)時,字串取代模組150可以如「第3D圖」之流程所示,先判斷語言資源檔是否包含第一字串(步驟351),若是,則字串取代模組150可以由語言資源檔中取得與第一字串對應且為目標語種的第二字串(步驟355),並可以在資料載入模組110所載入之網頁頁面中使用所取得的第二字串取代第一字串(步驟360);而若字串取代模組150無法由語言資源檔中取得第二字串,也就是語言資源檔中沒有包含第一字串,則伺服端200的資料處理模組220可以儲存第一字串與目標語種的語種識別資料(步驟381)。在本實施例中,若客戶端100與伺服端200由不同的計算設備執行,則客戶端100的資料傳輸模組170可以將第一字串與目標語種的語種識別資料傳送給伺服端200的網路服務模組210;而若客戶端100與伺服端200由相同的計算設備執行,則字串取代模組150或資料傳輸模組170可以將第一字串與語種識別資料提供給網路服務模組210。如此,資料處理模組220可以將網路服務模組210所接收到的第一字串與語種識別資料儲存到待辦資源檔中。In addition, when the character string replacement module 150 of the client 100 obtains the second character string corresponding to the first character string and being the target language from the language resource file loaded by the data loading module 110 (step 350), The string replacement module 150 can be shown in the process of "3D", first judge whether the language resource file contains the first string (step 351), if so, the string replacement module 150 can be obtained from the language resource file Corresponding to the first character string and being the second character string of the target language (step 355), the obtained second character string can be used in the web page loaded by the data loading module 110 to replace the first character string ( Step 360); and if the string replacement module 150 cannot obtain the second string from the language resource file, that is, the language resource file does not contain the first string, then the data processing module 220 of the server 200 can store the second string A string and language identification data of the target language (step 381). In this embodiment, if the client 100 and the server 200 are executed by different computing devices, the data transmission module 170 of the client 100 can transmit the first character string and the language identification data of the target language to the server 200. Network service module 210; and if the client 100 and the server 200 are executed by the same computing device, the character string replacement module 150 or the data transmission module 170 can provide the first character string and language identification data to the network Service module 210 . In this way, the data processing module 220 can store the first character string and language identification data received by the network service module 210 into the pending resource file.

在伺服端200的資料處理模組220儲存第一字串與目標語種的語種識別資料(步驟381)後,字串產生模組230或資料編輯模組240可以取得與第一字串對應的第二字串(步驟383),資源更新模組250可以將第一字串與第二字串加入語言資源檔中(步驟385),或是加入資源整合檔中,並如「第3B圖」所示,依據頁面語種或頁面語種與目標語種由資源整合檔中取出包含第一字串與第二字串的語言資料以產生與頁面語種對應的語言資源檔(步驟390)。After the data processing module 220 of the server 200 stores the first character string and the language identification data of the target language (step 381), the character string generating module 230 or the data editing module 240 can obtain the first character string corresponding to the first character string Two strings (step 383), the resource update module 250 can add the first string and the second string to the language resource file (step 385), or add it to the resource integration file, and as shown in "Fig. 3B" According to the language of the page or the language of the page and the target language, the language data including the first string and the second string are extracted from the resource integration file to generate a language resource file corresponding to the language of the page (step 390).

如此,透過本發明,可以依照網頁開發人員的慣用語言或第一語言開發多語言網頁,不再需要以變數產生多語言網頁。In this way, through the present invention, multilingual webpages can be developed according to the customary language or the first language of the webpage developers, and it is no longer necessary to generate multilingual webpages with variables.

綜上所述,可知本發明與先前技術之間的差異在於具有判斷網頁頁面之頁面語種與目標語種不同時載入語言資源檔,並取得網頁頁面所包含之特定網頁元素中之第一字串後,由語言資源檔中取得與第一字串對應且為目標語種之第二字串,於網頁頁面中以第二字串取代第一字串之技術手段,藉由此一技術手段可以來解決先前技術所存在開發多語言網頁導致工作量增加的問題,進而達成降低開發人員工作量之技術功效。In summary, it can be seen that the difference between the present invention and the prior art lies in the ability to load the language resource file when judging that the page language of the web page is different from the target language, and obtain the first character string in the specific web element included in the web page Afterwards, obtain the second word string corresponding to the first word string and being the target language from the language resource file, and replace the first word string with the second word string in the web page, by means of this technical means can be Solve the problem of increased workload caused by developing multilingual web pages in the previous technology, and then achieve the technical effect of reducing the workload of developers.

再者,本發明之以對應頁面語種之目標語種顯示網頁頁面之方法,可實現於硬體、軟體或硬體與軟體之組合中,亦可在電腦系統中以集中方式實現或以不同元件散佈於若干互連之電腦系統的分散方式實現。Furthermore, the method for displaying web pages in the target language corresponding to the page language of the present invention can be implemented in hardware, software, or a combination of hardware and software, and can also be implemented in a centralized manner in a computer system or distributed with different components Implemented in a decentralized manner over several interconnected computer systems.

雖然本發明所揭露之實施方式如上,惟所述之內容並非用以直接限定本發明之專利保護範圍。任何本發明所屬技術領域中具有通常知識者,在不脫離本發明所揭露之精神和範圍的前提下,對本發明之實施的形式上及細節上作些許之更動潤飾,均屬於本發明之專利保護範圍。本發明之專利保護範圍,仍須以所附之申請專利範圍所界定者為準。Although the embodiments disclosed in the present invention are as above, the content described is not intended to directly limit the scope of protection of the present invention. Anyone with ordinary knowledge in the technical field of the present invention, without departing from the spirit and scope disclosed in the present invention, makes some changes and modifications to the form and details of the implementation of the present invention, all of which belong to the patent protection of the present invention scope. The scope of patent protection of the present invention shall still be defined by the scope of the attached patent application.

100:客戶端 110:資料載入模組 120:語種判斷模組 130:頁面剖析模組 150:字串取代模組 160:頁面顯示模組 170:資料傳輸模組 200:伺服端 210:網路服務模組 220:資料處理模組 230:字串產生模組 240:資料編輯模組 250:資源更新模組 步驟310:載入網頁頁面 步驟320:判斷網頁頁面之頁面語種與目標語種不同時載入語言資源檔 步驟330:剖析網頁頁面之原始碼,並取得網頁頁面所包含之特定網頁元素中之第一字串 步驟331:剖析網頁頁面 步驟333:取得網頁元素 步驟335:判斷網頁元素之屬性是否滿足替換條件 步驟337:由網頁元素中取得元素內容作為第一字串 步驟339:是否還有未判斷標籤 步驟350:由語言資源檔中取得與第一字串對應且為目標語種之第二字串 步驟351:判斷語言資源檔中是否包含第一字串 步驟355:由語言資源檔中取得與第一字串對應且為目標語種之第二字串 步驟360:於網頁頁面中以第二字串取代第一字串 步驟370:顯示字串取代後之網頁頁面 步驟381:儲存第一字串 步驟383:取得與第一字串對應之第二字串 步驟385:將第一字串及第二字串加入語言資源檔 步驟390:依據頁面語種或頁面語種與目標語種由資源整合檔中取出語言資料以產生語言資源檔 100: client 110: Data loading module 120:Language judgment module 130:Page analysis module 150: String Replacement Module 160: Page display module 170:Data transmission module 200: server side 210:Network service module 220: Data processing module 230: String generation module 240: Data editing module 250: Resource update module Step 310: load the web page Step 320: Load the language resource file when judging that the page language of the web page is different from the target language Step 330: Analyze the source code of the web page, and obtain the first character string in the specific web element included in the web page Step 331: analyze the web page Step 333: Obtain web page elements Step 335: determine whether the attribute of the web page element satisfies the replacement condition Step 337: Obtain the element content from the webpage element as the first character string Step 339: Whether there are undetermined labels Step 350: Obtain the second character string corresponding to the first character string and being the target language from the language resource file Step 351: determine whether the first character string is included in the language resource file Step 355: Obtain the second character string corresponding to the first character string and being the target language from the language resource file Step 360: Replace the first string with the second string in the web page Step 370: Display the web page after the string replacement Step 381: Store the first character string Step 383: Obtain the second character string corresponding to the first character string Step 385: Add the first character string and the second character string to the language resource file Step 390: Take out the language data from the resource integration file according to the page language or the page language and the target language to generate a language resource file

第1圖為本發明所提之以對應頁面語種之目標語種顯示網頁頁面之客戶端之元件示意圖。 第2圖為本發明所提之以對應頁面語種之目標語種顯示網頁頁面之伺服端之元件示意圖。 第3A圖為本發明所提之以對應頁面語種之目標語種顯示網頁頁面之方法流程圖。 第3B圖為本發明所提之產生語言資源檔之方法流程圖。 第3C圖為本發明所提之取得第一字串之方法流程圖。 第3D圖為本發明所提之取得第二字串之方法流程圖。 FIG. 1 is a schematic diagram of components of a client terminal for displaying a web page in a target language corresponding to the language of the page proposed by the present invention. FIG. 2 is a schematic diagram of the components of the server end for displaying web pages in the target language corresponding to the page language proposed by the present invention. FIG. 3A is a flowchart of a method for displaying a webpage in a target language corresponding to the page language proposed by the present invention. FIG. 3B is a flow chart of the method for generating language resource files proposed by the present invention. FIG. 3C is a flow chart of the method for obtaining the first character string proposed by the present invention. FIG. 3D is a flow chart of the method for obtaining the second character string proposed by the present invention.

步驟310:載入網頁頁面 Step 310: load the web page

步驟320:判斷網頁頁面之頁面語種與目標語種不同時載入語言資源檔 Step 320: Load the language resource file when judging that the page language of the web page is different from the target language

步驟330:剖析網頁頁面之原始碼,並取得網頁頁面所包含之特定網頁元素中之第一字串 Step 330: Analyze the source code of the web page, and obtain the first character string in the specific web element included in the web page

步驟350:由語言資源檔中取得與第一字串對應且為目標語種之第二字串 Step 350: Obtain the second character string corresponding to the first character string and being the target language from the language resource file

步驟360:於網頁頁面中以第二字串取代第一字串 Step 360: Replace the first string with the second string in the web page

步驟370:顯示字串取代後之網頁頁面 Step 370: Display the web page after the string replacement

Claims (10)

一種以對應頁面語種之目標語種顯示網頁頁面之方法,係應用於一計算設備,該方法至少包含下列步驟: 載入一網頁頁面; 判斷該網頁頁面之一頁面語種與一目標語種不同時,載入一語言資源檔; 剖析該網頁頁面之原始碼,並取得該網頁頁面所包含之一特定網頁元素中之一第一字串; 由該語言資源檔中取得與該第一字串對應且為該目標語種之一第二字串; 於該網頁頁面中以該第二字串取代該第一字串;及 顯示字串取代後之該網頁頁面。 A method for displaying a webpage in a target language corresponding to the language of the page is applied to a computing device, and the method at least includes the following steps: load a web page; When it is judged that one of the page languages of the webpage is different from a target language, load a language resource file; Analyze the source code of the webpage, and obtain a first string in a specific webpage element included in the webpage; obtaining a second character string corresponding to the first character string and being one of the target languages from the language resource file; replace the first string of characters with the second string of characters in the web page; and Display the web page after the string is replaced. 如請求項1所述之以對應頁面語種之目標語種顯示網頁頁面之方法,其中取得該網頁頁面所包含之該特定網頁元素中之該第一字串之步驟為判斷該特定網頁元素之一屬性滿足替換條件時取得該第一字串。The method for displaying a webpage in a target language corresponding to the language of the page as described in claim 1, wherein the step of obtaining the first character string in the specific webpage element contained in the webpage is to determine an attribute of the specific webpage element The first character string is obtained when the replacement condition is met. 如請求項1所述之以對應頁面語種之目標語種顯示網頁頁面之方法,其中該方法更包含判斷該語言資源檔中未包含該第一字串時,儲存該第一字串之步驟。The method for displaying a webpage in a target language corresponding to the language of the page as described in claim 1, wherein the method further includes the step of storing the first word string when it is determined that the language resource file does not contain the first word string. 如請求項3所述之以對應頁面語種之目標語種顯示網頁頁面之方法,其中該方法更包含取得與第一字串對應之該第二字串,並將該第一字串及該第二字串加入該語言資源檔中之步驟。The method for displaying a web page in the target language corresponding to the language of the page as described in claim 3, wherein the method further includes obtaining the second character string corresponding to the first character string, and combining the first character string and the second character string Steps to add strings to the language resource file. 如請求項1所述之以對應頁面語種之目標語種顯示網頁頁面之方法,其中該方法更包含由一資源整合檔中依據該頁面語種或該頁面語種與該目標語種取出包含該第一字串及該第二字串之語言資料以產生該語言資源檔之步驟。The method for displaying a webpage in a target language corresponding to the language of the page as described in claim 1, wherein the method further includes extracting the first character string from a resource integration file according to the page language or the page language and the target language and the language data of the second string to generate the language resource file. 一種以對應頁面語種之目標語種顯示網頁頁面之系統,該系統至少包含: 一資料載入模組,用以載入一網頁頁面; 一語種判斷模組,用以判斷判斷該網頁頁面之一頁面語種與一目標語種是否相同,該資料載入模組更用以於該頁面語種與該目標與種不同時,載入一語言資源檔; 一頁面剖析模組,用以剖析該網頁頁面之原始碼,並取得該網頁頁面所包含之一特定網頁元素中之一第一字串; 一字串取代模組,用以由該語言資源檔中取得與該第一字串對應且為該目標語種之一第二字串,並於該網頁頁面中以該第二字串取代該第一字串;及 一頁面顯示模組,用以顯示字串取代後之該網頁頁面。 A system for displaying web pages in a target language corresponding to the language of the page, the system at least includes: A data loading module, used to load a web page; A language judgment module, used to judge whether a page language of the web page is the same as a target language, and the data loading module is further used to load a language resource when the page language is different from the target language files; A page analysis module, used to analyze the source code of the webpage, and obtain a first character string in a specific webpage element included in the webpage; a character string replacement module, used to obtain a second character string corresponding to the first character string and a second character string of the target language from the language resource file, and replace the first character character string with the second character character string in the web page a string; and A page display module is used for displaying the web page after the character string is replaced. 如請求項6所述之以對應頁面語種之目標語種顯示網頁頁面之系統,其中該頁面剖析模組是判斷該特定網頁元素之一屬性滿足替換條件時取得該第一字串。The system for displaying web pages in a target language corresponding to the page language as described in claim 6, wherein the page analysis module obtains the first character string when it judges that an attribute of the specific web page element satisfies the replacement condition. 如請求項6所述之以對應頁面語種之目標語種顯示網頁頁面之系統,其中該系統更包含一資料傳輸模組,用以於該字串取代模組判斷該語言資源檔中未包含該第一字串時,傳送該第一字串至一伺服端,使該伺服端儲存該第一字串。The system for displaying webpages in the target language corresponding to the language of the page as described in claim 6, wherein the system further includes a data transmission module, which is used to determine that the language resource file does not include the first word in the string replacement module When a character string is used, the first character string is sent to a server, so that the server stores the first character string. 如請求項8所述之以對應頁面語種之目標語種顯示網頁頁面之系統,其中該伺服端更用以取得與第一字串對應之該第二字串,並將該第一字串及該第二字串加入該語言資源檔中。The system for displaying web pages in the target language corresponding to the language of the page as described in claim 8, wherein the server is further used to obtain the second character string corresponding to the first character string, and combine the first character string and the The second string is added to the language resource file. 如請求項6所述之以對應頁面語種之目標語種顯示網頁頁面之系統,其中該語言資源檔是依據該頁面語種或該頁面語種與該目標語種由一資源整合檔中取出包含該第一字串及該第二字串之語言資料產生。The system for displaying web pages in the target language corresponding to the page language as described in claim 6, wherein the language resource file is extracted from a resource integration file according to the page language or the page language and the target language and contains the first word The language data of the string and the second string are generated.
TW110146124A 2021-12-09 2021-12-09 System for using target language corresponding to page language to displaying webpage and method thereof TW202324140A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW110146124A TW202324140A (en) 2021-12-09 2021-12-09 System for using target language corresponding to page language to displaying webpage and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW110146124A TW202324140A (en) 2021-12-09 2021-12-09 System for using target language corresponding to page language to displaying webpage and method thereof

Publications (1)

Publication Number Publication Date
TW202324140A true TW202324140A (en) 2023-06-16

Family

ID=87803590

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110146124A TW202324140A (en) 2021-12-09 2021-12-09 System for using target language corresponding to page language to displaying webpage and method thereof

Country Status (1)

Country Link
TW (1) TW202324140A (en)

Similar Documents

Publication Publication Date Title
US10628152B2 (en) Automatic generation of microservices based on technical description of legacy code
US20210406033A1 (en) Method for running applets, and electronic device
EP2808790B1 (en) Migration assessment for cloud computing platforms
US8713530B2 (en) Test framework of visual components in a multitenant database environment
US8347287B2 (en) System and method for localizing a server application using a client-side translator
US8423978B2 (en) Configurable java server pages processing framework
CN104375808B (en) interface display method and device
JP4023803B2 (en) Web application development support apparatus, data processing method, and program
US7865481B2 (en) Changing documents to include changes made to schemas
US11741002B2 (en) Test automation systems and methods using logical identifiers
CN115599386A (en) Code generation method, device, equipment and storage medium
CN114995859A (en) Page hot updating method, device, equipment and storage medium
US8607201B2 (en) Augmenting visualization of a call stack
TW202324140A (en) System for using target language corresponding to page language to displaying webpage and method thereof
CN115640279A (en) Method and device for constructing data blood relationship
CN110599112A (en) Method and device for developing and maintaining network page
CN107077484B (en) Generating a web browser view of an application
US20220300404A1 (en) Qualifying impacts of third-party code changes on dependent software
US20190095538A1 (en) Method and system for generating content from search results rendered by a search engine
US10599740B1 (en) Program code streaming
Sharma et al. Mat: A migration assessment toolkit for paas clouds
CN116186436A (en) System and method for displaying web pages in target languages corresponding to page languages
CN116775030B (en) Method and device for creating security baseline
US11960560B1 (en) Methods for analyzing recurring accessibility issues with dynamic web site behavior and devices thereof
CN113515326B (en) Data conversion method, device, electronic equipment and storage medium