CN114385303A - Multi-language switching method, system and medium for intelligent television front-end web system - Google Patents

Multi-language switching method, system and medium for intelligent television front-end web system Download PDF

Info

Publication number
CN114385303A
CN114385303A CN202210076536.6A CN202210076536A CN114385303A CN 114385303 A CN114385303 A CN 114385303A CN 202210076536 A CN202210076536 A CN 202210076536A CN 114385303 A CN114385303 A CN 114385303A
Authority
CN
China
Prior art keywords
language
entry
web
switching
translation
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
CN202210076536.6A
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.)
Beijing Zhixiang Information Technology Co ltd
Original Assignee
Beijing Zhixiang Information Technology Co ltd
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 Beijing Zhixiang Information Technology Co ltd filed Critical Beijing Zhixiang Information Technology Co ltd
Priority to CN202210076536.6A priority Critical patent/CN114385303A/en
Publication of CN114385303A publication Critical patent/CN114385303A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • G06F9/454Multi-language systems; Localisation; Internationalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/42Data-driven translation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Artificial Intelligence (AREA)
  • Computer Security & Cryptography (AREA)
  • Machine Translation (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a multilingual switching method, a system and a medium for a front-end web system of an intelligent television, wherein the method comprises the following steps: extracting a language difference part in a page, arranging according to entry id, translating each entry by adopting different languages to obtain translation results corresponding to different languages, and generating a translation list; generating a plurality of language packages according to the translation list contents through a self-defined software program, wherein each language package is a language style sheet of the css; copying all generated language packages of the css style sheets to a system web project file system, writing a vocabulary entry id into a class attribute of a label when a multi-language vocabulary entry is used in a web front-end development system UI interface, and introducing a corresponding language style sheet into a head label of a web html entry file by using a link label; when the user switches the language, the web program dynamically switches and introduces the corresponding language style sheet to complete the switching of the language. The technical scheme provided by the invention can effectively solve the problem that the language switching and updating of the existing delivery equipment are not smooth.

Description

Multi-language switching method, system and medium for intelligent television front-end web system
Technical Field
The invention relates to the technical field of intelligent televisions, in particular to a multi-language switching method, a multi-language switching system and a multi-language switching medium for a front-end web system of an intelligent television.
Background
With the increasing pace of economic globalization and foreign development in China, various devices are sold to different countries, and television manufacturers need to consider the difference of languages of each country when producing, and carry out differential design on language characters of product interfaces, more than 40 TV system languages are common, and when wanting to display different languages, the switching of languages needs to be realized through software, but if different languages are integrated into one software, the memory overhead of the device is undoubtedly increased, the performance of the device is reduced, and the later updating and maintenance are complicated, so that the better way is to extract a language difference part for independent maintenance, the writing and maintenance work of software codes can be reduced to a certain extent, but the processing and switching of the language difference part are usually realized by means of additional plug-in (such as javascript plug-in), and the phenomenon of blocking is easy to occur in the actual operation process, particularly, for some televisions with lower hardware configuration, the adoption of the language switching mode has the advantages of obvious pause phenomenon, poorer overall performance and low user experience.
Disclosure of Invention
The invention aims to provide a multi-language switching method, a multi-language switching system and a multi-language switching medium for a front-end web system of an intelligent television, and solves the problem that the language switching and updating of the existing shipment equipment are not smooth.
In a first aspect, the invention provides a multilingual switching method for a front-end web system of an intelligent television, which comprises the following steps:
step S10, extracting language difference parts in the page, arranging according to entry id, translating each entry by adopting different languages to obtain translation results corresponding to different languages, and generating a translation list;
step S20, generating a plurality of language packages according to the translation list contents through a user-defined software program, wherein each language package is a language style sheet of css;
step S30, copying the generated language packages of all css style sheets to a system web project file system, writing a vocabulary entry id into the class attribute of a label when a multi-language vocabulary entry is used in a web front-end development system UI interface, and introducing a corresponding language style sheet into a head label of a web html entry file by using a link label;
and step S40, when the user switches the language, the web program dynamically switches and introduces the corresponding language style sheet to complete the switching of the language.
Furthermore, the first column of the translation list is an entry id, the first columns of other columns are language three-character codes corresponding to the columns, and the other columns of other rows correspond to translation contents in different languages under the entries of the rows.
Furthermore, if the existing language pack in the television needs to be modified or added, the system language of the corresponding television is updated by OTA differentiated upgrade.
In a second aspect, the present invention provides a multi-language switching system for a smart tv front-end web system, where the system includes:
the translation list module is used for extracting the language difference parts in the page, arranging the language difference parts according to the entry id, translating each entry by adopting different languages to obtain translation results corresponding to the different languages, and generating a translation list;
the language package packaging module is used for generating a plurality of language packages according to the translation list contents through a user-defined software program, and each language package is a language style sheet of the css;
the system comprises a reference module, a system web project file system, a web front-end development system UI interface and a web html entry file, wherein the reference module is used for copying all generated language packages of the css style sheets to the system web project file system, writing a vocabulary entry id into a class attribute of a label when a multi-language vocabulary entry is used in the web front-end development system UI interface, and introducing a corresponding language style sheet in a head label of the web html entry file by using a link label; and
and the language switching module is used for dynamically switching and introducing the corresponding language style sheet by the web program when the user switches the language to complete the language switching.
Furthermore, the first column of the translation list is an entry id, the first columns of other columns are language three-character codes corresponding to the columns, and the other columns of other rows correspond to translation contents in different languages under the entries of the rows.
Furthermore, if the existing language pack in the television needs to be modified or added, the system language of the corresponding television is updated by OTA differentiated upgrade.
In a third aspect, the invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method of the first aspect.
One or more technical schemes provided by the invention at least have the following technical effects or advantages:
the invention can realize the switching of the interface language without using a special plug-in, can realize a smooth language switching process even for the shipment equipment with lower hardware configuration, and improves the user experience.
Drawings
The invention will be further described with reference to the following examples with reference to the accompanying drawings.
Fig. 1 is a flowchart of a multi-language switching method of a smart tv front-end web system according to the present invention.
Fig. 2 is a system block diagram of a multi-language switching system of a smart tv front-end web system according to the present invention.
Fig. 3 is a schematic structural diagram of a medium according to a third embodiment of the present invention.
FIG. 4 is a diagram illustrating a translation list structure according to an embodiment of the present invention.
FIG. 5 is a diagram illustrating a structure of a language pack according to an embodiment of the present invention.
FIG. 6 is a diagram illustrating a design portion of a code page in a language pack import page according to an embodiment of the present invention.
Detailed Description
The embodiment of the application provides a multi-language switching method, a multi-language switching system and a multi-language switching medium for a front-end web system of an intelligent television, which are used for solving the problem that the configuration heights of existing shipment equipment are different, and some equipment are seriously jammed in the language switching process, so that the customer experience is influenced. According to the invention, a set of multi-language switching mechanism is arranged, the original development process is optimized, the language packages are independently packaged, and the language style sheet is introduced by means of the label attribute, so that the rapid language switching is realized, the fluency of the switching process is improved, the user experience is improved, and meanwhile, the early development workload and the later maintenance work of developers are reduced.
For better understanding of the above technical solutions, the following detailed descriptions will be provided in conjunction with the drawings and the detailed description of the embodiments.
Example one
As shown in fig. 1, the present invention provides a multilingual switching method for a smart tv front-end web system, where the method includes:
step S10, extracting language difference parts in the page, arranging according to entry id, translating each entry by adopting different languages to obtain translation results corresponding to different languages, and generating a translation list;
step S20, generating a plurality of language packages according to the translation list contents through a user-defined software program, wherein each language package is a language style sheet of css;
step S30, copying the generated language packages of all css style sheets to a system web project file system, writing a vocabulary entry id into the class attribute of a label when a multi-language vocabulary entry is used in a web front-end development system UI interface, and introducing a corresponding language style sheet into a head label of a web html entry file by using a link label;
and step S40, when the user switches the language, the web program dynamically switches and introduces the corresponding language style sheet to complete the switching of the language.
Preferably, the first column of the translation list is an entry id, the first row of the other columns is a language three-character code corresponding to the column, and the other rows correspond to translation contents in different languages under the row entry.
Preferably, if the existing language pack in the television needs to be modified or added, the system language of the corresponding television is updated by using OTA differentiated upgrade.
Taking switching between English and Spanish as an example, firstly, the language difference parts in the display page are extracted and arranged according to entry id, for example, the entry id is sorted according to lang1 and lang2, each entry adopts different language translation, for example, English corresponding to entry lang1 is translated into "hello", Spanish is translated into "Hola! "etc. to obtain a translation list as shown in fig. 4, and then the translation list is split and encapsulated according to the language by the program to obtain entry translation tables in different languages, that is, each language package of cs named by language three-character codes, including eng. Then, copy the generated css language package to the system web project file system, when the multi-language vocabulary entry is used in the web front end development system UI interface, write the vocabulary entry id into the label attribute in the way of class, introduce the default language style table of the system in the web entry index.html head label, and if the default language is English, then introduce eng.css in the code, as shown in FIG. 6, when needing to switch to other languages in the system, only need click the switch language button on the user interface to select Spanish language, only need to change eng.css to spa.css in the corresponding code, these language packages are stored in the same path, and can be directly quoted, the invention can ensure that any multi-language is switched to the TV system user operation interface realized at the web front end, and the switch fluency performance is good, only one language package is loaded in the memory, and if there is a need to modify the vocabulary entry in the translation list, then compile and generate the corresponding language package, and then OTA differential upgrading is carried out to realize system language correction of the shipment equipment.
Based on the same inventive concept, the application also provides a device corresponding to the method in the first embodiment, which is detailed in the second embodiment.
Example two
As shown in fig. 2, this embodiment provides a multi-language switching system for a front-end web system of an intelligent television, where the system includes:
the translation list module is used for extracting the language difference parts in the page, arranging the language difference parts according to the entry id, translating each entry by adopting different languages to obtain translation results corresponding to the different languages, and generating a translation list;
the language package packaging module is used for generating a plurality of language packages according to the translation list contents through a user-defined software program, and each language package is a language style sheet of the css;
the system comprises a reference module, a system web project file system, a web front-end development system UI interface and a web html entry file, wherein the reference module is used for copying all generated language packages of the css style sheets to the system web project file system, writing a vocabulary entry id into a class attribute of a label when a multi-language vocabulary entry is used in the web front-end development system UI interface, and introducing a corresponding language style sheet in a head label of the web html entry file by using a link label; and
and the language switching module is used for dynamically switching and introducing the corresponding language style sheet by the web program when the user switches the language to complete the language switching.
Preferably, the first column of the translation list is an entry id, the first row of the other columns is a language three-character code corresponding to the column, and the other rows correspond to translation contents in different languages under the row entry.
Preferably, if the existing language pack in the television needs to be modified or added, the system language of the corresponding television is updated by using OTA differentiated upgrade.
Taking switching between English and Spanish as an example, firstly, the language difference parts in the display page are extracted and arranged according to entry id, for example, the entry id is sorted according to lang1 and lang2, each entry adopts different language translation, for example, English corresponding to entry lang1 is translated into "hello", Spanish is translated into "Hola! "etc. to obtain a translation list as shown in fig. 4, and then the translation list is split and encapsulated according to the language by the program to obtain entry translation tables in different languages, that is, each language package of cs named by language three-character codes, including eng. Then, copy the generated css language package to the system web project file system, when the multi-language vocabulary entry is used in the web front end development system UI interface, write the vocabulary entry id into the label attribute in the way of class, introduce the default language style table of the system in the web entry index.html head label, and if the default language is English, then introduce eng.css in the code, as shown in FIG. 6, when needing to switch to other languages in the system, only need click the switch language button on the user interface to select Spanish language, only need to change eng.css to spa.css in the corresponding code, these language packages are stored in the same path, and can be directly quoted, the invention can ensure that any multi-language is switched to the TV system user operation interface realized at the web front end, and the switch fluency performance is good, only one language package is loaded in the memory, and if there is a need to modify the vocabulary entry in the translation list, then compile and generate the corresponding language package, and then OTA differential upgrading is carried out to realize system language correction of the shipment equipment.
Based on the same inventive concept, the application provides a storage medium corresponding to the third embodiment.
EXAMPLE III
The present embodiment provides a computer-readable storage medium, as shown in fig. 3, on which a computer program is stored, and when the computer program is executed by a processor, any one of the embodiments can be implemented.
One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages: the translation list is packaged into css style sheets corresponding to different languages according to the different languages, each style sheet records the translation content of each entry of the language package, then only the link label needs to be changed, language switching does not need to be completed by means of a javascript plug-in i18n, the overall performance is improved, the pause phenomenon in the switching process is effectively avoided, even for lower-configuration delivery equipment, smooth switching of the languages can be achieved, user experience is improved, when the language package needs to be updated and modified, the language package is copied to a file corresponding to the system through differential upgrading after being packaged in the packaging mode, code workload is reduced, and development and maintenance efficiency is improved.
Although specific embodiments of the invention have been described above, it will be understood by those skilled in the art that the specific embodiments described are illustrative only and are not limiting upon the scope of the invention, and that equivalent modifications and variations can be made by those skilled in the art without departing from the spirit of the invention, which is to be limited only by the appended claims.

Claims (7)

1. A multi-language switching method for a front-end web system of an intelligent television is characterized by comprising the following steps: the method comprises the following steps:
step S10, extracting language difference parts in the page, arranging according to entry id, translating each entry by adopting different languages to obtain translation results corresponding to different languages, and generating a translation list;
step S20, generating a plurality of language packages according to the translation list contents through a user-defined software program, wherein each language package is a language style sheet of css;
step S30, copying the generated language packages of all css style sheets to a system web project file system, writing a vocabulary entry id into the class attribute of a label when a multi-language vocabulary entry is used in a web front-end development system UI interface, and introducing a corresponding language style sheet into a head label of a web html entry file by using a link label;
and step S40, when the user switches the language, the web program dynamically switches and introduces the corresponding language style sheet to complete the switching of the language.
2. The multi-language switching method for the smart television front-end web system according to claim 1, wherein: the first column of the translation list is an entry id, the first row of other columns is a language three-character code corresponding to the column, and the other rows correspond to translation contents of different languages under the entry.
3. The multi-language switching method for the smart television front-end web system according to claim 1, wherein: and if the existing language pack in the television needs to be modified or added, updating the system language of the corresponding television by adopting OTA differential upgrading.
4. A multi-language switching system of a front-end web system of an intelligent television is characterized in that: the system comprises:
the translation list module is used for extracting the language difference parts in the page, arranging the language difference parts according to the entry id, translating each entry by adopting different languages to obtain translation results corresponding to the different languages, and generating a translation list;
the language package packaging module is used for generating a plurality of language packages according to the translation list contents through a user-defined software program, and each language package is a language style sheet of the css;
the system comprises a reference module, a system web project file system, a web front-end development system UI interface and a web html entry file, wherein the reference module is used for copying all generated language packages of the css style sheets to the system web project file system, writing a vocabulary entry id into a class attribute of a label when a multi-language vocabulary entry is used in the web front-end development system UI interface, and introducing a corresponding language style sheet in a head label of the web html entry file by using a link label; and
and the language switching module is used for dynamically switching and introducing the corresponding language style sheet by the web program when the user switches the language to complete the language switching.
5. The intelligent television front-end web system multilingual switching system of claim 4, wherein: the first column of the translation list is an entry id, the first row of other columns is a language three-character code corresponding to the column, and the other rows correspond to translation contents of different languages under the entry.
6. The intelligent television front-end web system multilingual switching system of claim 4, wherein: and if the existing language pack in the television needs to be modified or added, updating the system language of the corresponding television by adopting OTA differential upgrading.
7. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 3.
CN202210076536.6A 2022-01-24 2022-01-24 Multi-language switching method, system and medium for intelligent television front-end web system Pending CN114385303A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210076536.6A CN114385303A (en) 2022-01-24 2022-01-24 Multi-language switching method, system and medium for intelligent television front-end web system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210076536.6A CN114385303A (en) 2022-01-24 2022-01-24 Multi-language switching method, system and medium for intelligent television front-end web system

Publications (1)

Publication Number Publication Date
CN114385303A true CN114385303A (en) 2022-04-22

Family

ID=81204356

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210076536.6A Pending CN114385303A (en) 2022-01-24 2022-01-24 Multi-language switching method, system and medium for intelligent television front-end web system

Country Status (1)

Country Link
CN (1) CN114385303A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5836014A (en) * 1991-02-27 1998-11-10 Digital Equipment Corporation Method of constructing a constant-folding mechanism in a multilanguage optimizing compiler
CN112181550A (en) * 2020-08-31 2021-01-05 福州智象信息技术有限公司 UI multi-language conversion method and system for smart television operating system
CN113515338A (en) * 2021-07-01 2021-10-19 深圳创维-Rgb电子有限公司 Layout method of UI (user interface), display terminal and storage medium
CN113805874A (en) * 2021-09-10 2021-12-17 上海得帆信息技术有限公司 Front-end code fragment dynamic rendering method and system suitable for multi-frame language

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5836014A (en) * 1991-02-27 1998-11-10 Digital Equipment Corporation Method of constructing a constant-folding mechanism in a multilanguage optimizing compiler
CN112181550A (en) * 2020-08-31 2021-01-05 福州智象信息技术有限公司 UI multi-language conversion method and system for smart television operating system
CN113515338A (en) * 2021-07-01 2021-10-19 深圳创维-Rgb电子有限公司 Layout method of UI (user interface), display terminal and storage medium
CN113805874A (en) * 2021-09-10 2021-12-17 上海得帆信息技术有限公司 Front-end code fragment dynamic rendering method and system suitable for multi-frame language

Similar Documents

Publication Publication Date Title
US9430583B1 (en) Extracting a portion of a document, such as a web page
JP4256891B2 (en) Technology to improve machine translation accuracy
US5251130A (en) Method and apparatus for facilitating contextual language translation within an interactive software application
US5752058A (en) System and method for inter-token whitespace representation and textual editing behavior in a program editor
Welsh et al. A design rationale for a language‐based editor
US20070150500A1 (en) Device for reporting software problem information
US20070008331A1 (en) Bi-directional Display
KR20000011298A (en) Touchscreen keyboard support for multi-byte character languages
CA2428821C (en) Accessing a platform independent input method editor from an underlying operating system
NO332643B1 (en) Programming interface for a computer platform
Wood Z-the 95% program editor
CN111831384B (en) Language switching method, device, equipment and storage medium
CN102202242A (en) Realization method of JavaScript interpreter based on set-top box browser
CN111523065B (en) Rich text data processing method and device, electronic equipment and computer storage medium
CN114385303A (en) Multi-language switching method, system and medium for intelligent television front-end web system
JP2004220616A (en) Machine translation system for simultaneously displaying and editing three or more parallel translation screens
CN113641433A (en) Multi-language page conversion method and unit of front-end internationalized multi-language file based on i18n technology
CN112130952A (en) Multi-language display method, device, equipment and product
CN103034481A (en) Financial self-service terminal and interface realizing method thereof
CN112711435B (en) Version updating method, version updating device, electronic equipment and storage medium
CN112181550A (en) UI multi-language conversion method and system for smart television operating system
JP2007279795A (en) System for deciding whether or not screen to be displayed by program satisfy specification
CN112099770A (en) Template-based webpage generation method, system, equipment and storage medium
CN116048516B (en) Theme color variable using method based on Vue frame
JP2019087233A (en) Information processing device, information processing method, and information processing program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination