CN111966433A - Method and device for changing languages in page, storage medium and electronic equipment - Google Patents

Method and device for changing languages in page, storage medium and electronic equipment Download PDF

Info

Publication number
CN111966433A
CN111966433A CN202010614351.7A CN202010614351A CN111966433A CN 111966433 A CN111966433 A CN 111966433A CN 202010614351 A CN202010614351 A CN 202010614351A CN 111966433 A CN111966433 A CN 111966433A
Authority
CN
China
Prior art keywords
language
page
changing
change instruction
obtaining
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
CN202010614351.7A
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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202010614351.7A priority Critical patent/CN111966433A/en
Publication of CN111966433A publication Critical patent/CN111966433A/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
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/58Use of machine translation, e.g. for multi-lingual retrieval, for server-side translation for client devices or for real-time translation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Machine Translation (AREA)
  • Stored Programmes (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application discloses a method and a device for changing languages in a page, a storage medium and electronic equipment, and relates to the technical field of intelligent cloud and the technical field of software development. The specific implementation scheme is as follows: acquiring a language change instruction, wherein the language change instruction comprises a target language; acquiring a marked corpus in a page; loading a language package corresponding to the target language into a model corresponding to the view model; and translating the markup corpus through the language packet corresponding to the target language, and displaying the translated page through the view corresponding to the view model, so that the change of the page language of the intelligent cloud management console is more flexible, and the intelligent cloud management console can be effectively adapted to various different languages, and the change of the language can meet the personalized requirement of page display.

Description

Method and device for changing languages in page, storage medium and electronic equipment
Technical Field
The application relates to the technical field of internet, in particular to the technical field of intelligent cloud and software development, and particularly relates to a method and device for changing languages in a page, a storage medium and electronic equipment.
Background
In an application scenario of the smart cloud management console, when the language environments of the browser and the smart cloud management console are different, or the smart cloud management console is switched to other language environments, generally, the content on the page of the smart cloud management console needs to be displayed as a corresponding environment language. For example, if the language environment of the browser is english, the content of the component on the smart cloud management console should be presented in english as well.
Disclosure of Invention
The method and the device for changing the language in the page, the storage medium and the electronic equipment are provided, so that the change of the page language of the intelligent cloud management console is more flexible, the intelligent cloud management console can be effectively adapted to various different languages, and the change of the language can meet the personalized requirement of page display.
According to a first aspect, there is provided a method for changing a language among pages, comprising: acquiring a language change instruction, wherein the language change instruction comprises a target language; acquiring a marked corpus in the page; loading the language package corresponding to the target language into a model corresponding to a view model; and translating the markup corpus through the language package corresponding to the target language, and displaying a translated page through a view corresponding to the view model.
According to a second aspect, there is provided an apparatus for changing a language among pages, comprising: the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a language change instruction, and the language change instruction comprises a target language; the second obtaining module is used for obtaining the markup corpus in the page; the loading module is used for loading the language package corresponding to the target language into the model corresponding to the view model; and the translation module is used for translating the marked corpus through the language packet corresponding to the target language and displaying a translated page through a view corresponding to the view model.
According to a third aspect, there is provided an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor to perform a method of changing a language among pages of an embodiment of the present application.
According to a fourth aspect, a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform a method of changing a language among pages disclosed in embodiments of the present application is presented.
According to the technology of the application, the change of the page language of the intelligent cloud management console is more flexible, and the intelligent cloud management console can be effectively adapted to various different languages, so that the change of the language can meet the personalized requirements of page display.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present application, nor do they limit the scope of the present application. Other features of the present application will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is a schematic diagram according to a first embodiment of the present application;
FIG. 2 is a schematic diagram according to a second embodiment of the present application;
FIG. 3 is a schematic view of a page in the embodiment of the present application;
FIG. 4 is a schematic view of another page in the embodiment of the present application;
FIG. 5 is a schematic illustration according to a third embodiment of the present application;
FIG. 6 is a schematic diagram of an embodiment of the present application illustrating international labeling;
FIG. 7 is a diagram of a language pack in accordance with an embodiment of the present application;
FIG. 8 is a schematic diagram of another language pack in an embodiment of the present application;
FIG. 9 is a schematic diagram of an application scenario in an embodiment of the present application;
FIG. 10 is a schematic illustration according to a fourth embodiment of the present application;
FIG. 11 is a schematic illustration according to a fifth embodiment of the present application;
fig. 12 is a block diagram of an electronic device for implementing a method for changing a language among pages according to an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram according to a first embodiment of the present application. It should be noted that the main execution body of the method for changing the language in the page in the embodiment is a device for changing the language in the page, the device may be implemented in a software and/or hardware manner, the device may be configured in an electronic device, and the electronic device may include, but is not limited to, a terminal, a server, and the like.
The embodiment of the application relates to the technical field of intelligent cloud and the technical field of software development, wherein in the embodiment of the application, the change of languages in a page is realized through an MVVM (Model-View Model, Model-View Model architecture) based on the technical field of software development, so that the faster language change efficiency can be obtained, the switching of a page language environment is more continuous, and the influence on the page display of a View level is avoided.
In addition, the page in the application may be, for example, a page of a browser corresponding to the smart cloud product, and the page may specifically be, for example, a page of a browser of a smart cloud management console, where the smart cloud management console is an entry where a user manages and uses a corresponding cloud product through a network, and the smart cloud management console may assist the user in purchasing, viewing, using, and the like the cloud product and the service managed by the user.
Therefore, when the embodiment of the application relates to the technical field of intelligent cloud, the language in the browser page of the intelligent cloud product can be changed in a self-adaptive mode, and the application function of the intelligent cloud product can be enriched.
As shown in fig. 1, the method for changing the language in the page may include:
s101: a language change instruction is obtained, wherein the language change instruction comprises a target language.
When the main execution body of the method for changing the language in a page of the present embodiment is a device for changing the language in a page, a software architecture of the device for changing the language in a page may be, for example, an MVVM architecture.
The language change instruction is used for changing the language of the page of the intelligent cloud management console, and the language change instruction may be specifically triggered by a user, or may be obtained according to the current requirement for changing the language of the page when the language change device in the page actively recognizes that the current requirement for changing the language of the page exists, without limitation.
In the embodiment of the application, after the language change instruction is obtained, wherein the language change instruction comprises a target language, whether the language supported by the language environment of the current page is the same as the target language or not can be detected, if the language supported by the language environment of the current page is not the same as the target language, a step of subsequently changing the language is triggered, and if the language supported by the language environment of the current page is the same as the target language, a user can be reminded that the current language is the target language, so that the consumption of operation resources required for changing the language can be effectively saved.
S102: and acquiring the markup corpus in the page.
The markup language material is part of or all of the language material in the page, the language material may be understood as text content in the page, and the markup language material may be, for example, text content in the page that needs to be displayed in a target language.
That is to say, in the embodiment of the present application, the language of a part of markup corpus in a page is supported to be changed, so that a diversified language change function is provided, and a language change mode is more flexible.
S103: and loading the language package corresponding to the target language into the model corresponding to the view model.
The language change instruction is obtained, where the language change instruction includes a target language, and after the markup corpus in the page is obtained, the language package corresponding to the target language is loaded into the model corresponding to the view model.
That is to say, the method for changing the language in the page in the embodiment of the present application supports changing the language in the page according to the customized language package, and it is because it supports changing the language in the page according to the customized language package, the change of the language can meet the personalized requirement of page display.
S104: and translating the marked linguistic data through a language packet corresponding to the target language, and displaying the translated page through a view corresponding to the view model.
The above translating the markup corpus through the language package corresponding to the target language, and displaying the translated page through the view corresponding to the view model may specifically be displaying the translated page through the view corresponding to the view model after the translation, or may also set a display time point at which the translated page is displayed through the view corresponding to the view model, which is not limited.
In this embodiment, a language change instruction is obtained, where the language change instruction includes a target language, a markup corpus in a page is obtained, a language package corresponding to the target language is loaded into a model corresponding to a view model, the markup corpus is translated through the language package corresponding to the target language, and the translated page is displayed through a view corresponding to the view model, so that the change of the page language of the intelligent cloud management console is more flexible, and can be effectively adapted to multiple different languages, and the change of the language can meet the personalized requirement of page display.
Fig. 2 is a schematic diagram according to a second embodiment of the present application.
In this embodiment, an execution subject of the method for changing the language in the page is taken as an example of the view model, which is not limited to this.
As shown in fig. 2, the method for changing the language in the page may include:
s201: the view model obtains a language change instruction, wherein the language change instruction includes a target language.
When the main execution body of the method for changing the language in a page of the present embodiment is a device for changing the language in a page, a software architecture of the device for changing the language in a page may be, for example, an MVVM architecture.
Therefore, when the method for changing the language in the page is executed, the view model can specifically acquire the language changing instruction, wherein the language changing instruction comprises the target language.
The language change instruction is used for changing the language of the page of the intelligent cloud management console, and the language change instruction may be specifically triggered by a user, or may be obtained according to the current requirement for changing the language of the page when the view model actively recognizes that the current requirement for changing the language of the page exists, without limitation.
In the embodiment of the application, the view model acquires the language change instruction, and the view model acquires the language change instruction according to the changed language setting state when the language setting state of the page changes; or the view model receives the language change instruction input by the user, so that the embodiment of the application provides a plurality of entries for inputting the language change instruction, can adapt to the language change requirements under various application scenes, and has multi-directional flexibility.
As an example, referring to fig. 3, fig. 3 is a schematic diagram of a page in the embodiment of the present application, and assuming that a language environment selection button 31 [ chinese ] is included in a page 30, when [ chinese ] is triggered, a change in language setting state of the page may be monitored, at this time, it may be determined that there is a need to switch the language of the page to chinese, and when other language environment selection buttons in the page 30 are triggered, the same processing logic may be executed.
In some other embodiments, the api may be further configured to monitor whether a language setting status of the page changes, or whether other setting events occur in the page, where the setting events are associated with the language setting status changes, and when the setting events are monitored, the language setting status of the page may also be changed, or whether a url of the page includes a setting path flag, and when the url of the page includes the setting path flag, it indicates that the user currently has a need to manually modify the page language environment.
Referring to fig. 4, fig. 4 is another schematic diagram of a page in the embodiment of the present application, in which a url of the page includes a set path flag { locale }41, which indicates that a user currently has a need to manually modify a page language environment.
The view model obtains a language change instruction, where the language change instruction includes a target language, the target language is a language to which a language environment of the page needs to be modified currently, and if the current language is english, the target language may be, for example, chinese, french, japanese, or the like, which is not limited thereto.
In the embodiment of the application, after the view model acquires the language change instruction, wherein the language change instruction comprises a target language, the view model can also detect whether the language supported by the language environment of the current page is the same as the target language, if the language supported by the language environment of the current page is not the same as the target language, the step of executing subsequent language change is triggered, and if the language supported by the language environment of the current page is the same as the target language, a user can be reminded that the current language is the target language, so that the consumption of computing resources required by language change can be effectively saved.
S202: the view model obtains markup corpora in the page.
The markup language material is part of or all of the language material in the page, the language material may be understood as text content in the page, and the markup language material may be, for example, text content in the page that needs to be displayed in a target language.
That is to say, in the embodiment of the present application, the language of a part of markup corpus in a page is supported to be changed, so that a diversified language change function is provided, and a language change mode is more flexible.
The marked linguistic data can be marked by a developer through a decorator or a filter in advance, so that a flexible linguistic data marking mode is provided, the realization is simple and convenient, a diversified linguistic change function is provided, the linguistic change mode is more flexible, and meanwhile, the learning threshold of linguistic change is reduced.
As an example, the program code of the developer marking the corpus through the decorator may be illustrated as follows:
Figure BDA0002563239970000071
as another example, the program code that a developer marks corpora through a filter may be illustrated as follows:
as another example, the program code for a developer to mark corpora through the i18n library may be illustrated as follows:
import i18n from'../../locale';
@i18n('table')
export default class Table extends BaseInput{
template=`<div>{{i18n.t('tablbe.total',{index:1,total:10})}}</div>`;}。
of course, other possible methods may also be adopted to mark the corpus of the page that needs to change the language, so as to obtain the marked corpus.
The markup corpus is obtained by a developer through a decorator or a filter, so that in the embodiment of the application, the view model acquires the markup corpus in the page, and can directly identify the markup corpus in the page so as to support subsequent translation of the markup corpus, or can acquire the markup corpus in the page by calling some application programming interfaces which are pre-configured.
In the embodiment of the present application, referring to fig. 5, fig. 5 is a schematic diagram according to a third embodiment of the present application, and referring to fig. 5, a view model obtains markup corpuses in a page, including:
s501: page content among the pages is obtained.
S502: a plurality of corpora among the page content are extracted.
S503: obtaining marks of a plurality of corpora.
S504: and if the linguistic data in the plurality of linguistic data are marked as internationalized marks, taking the linguistic data as marked linguistic data.
Fig. 6 shows the international mark, and fig. 6 is a schematic view of the international mark according to the embodiment of the present application.
If the corpus of the plurality of corpora is marked as the internationalized token, the corpus is used as the marked corpus, and at this time, the analysis path table.total corresponding to the internationalized token can be analyzed, and the analysis path table.total is used for positioning the language content for translating the marked corpus in the language package corresponding to the target language.
That is to say, in the embodiment of the present application, by acquiring the page content in the page, extracting the plurality of corpora in the page content, and acquiring the tags of the plurality of corpora, and if the tags of the corpora in the plurality of corpora are international tags, using the corpora as the tagged corpora, a method for quickly acquiring the tagged corpora in the page is provided, which improves the efficiency of changing the page language, makes the switching of the page language environment more coherent, and avoids the influence of switching the morton the cloud experience of the user.
S203: and the view model loads the language package corresponding to the target language into the model corresponding to the view model.
The language change instruction is obtained by the view model, where the language change instruction includes a target language, and after the view model obtains the markup corpus in the page, the view model may load the language package corresponding to the target language into the model corresponding to the view model.
That is to say, the method for changing a language in a page in the embodiment of the present application supports changing a language in a page according to a customized language package, where a language package corresponding to a target language may be as shown in fig. 7, fig. 7 is a schematic diagram of a language package in the embodiment of the present application, fig. 7 shows a corresponding language package when the target language is chinese, refer to fig. 8, fig. 8 is a schematic diagram of another language package in the embodiment of the present application, and fig. 8 shows a corresponding language package when the target language is english, which is not limited thereto.
The embodiment of the application supports the change of the language in the page according to the customized language package, so that the change of the language can meet the personalized requirement of page display.
S204: the view model translates the markup corpus through a language package corresponding to the target language, and displays a translated page through a view corresponding to the view model.
The above-mentioned translating the markup corpus by the view model through the language package corresponding to the target language, and displaying the translated page through the view corresponding to the view model may specifically be displaying the translated page through the view corresponding to the view model after the translation, or may also set a display time point at which the translated page is displayed through the view corresponding to the view model.
In the embodiment of the application, when the browser updates the page, the translated page can be displayed through the view corresponding to the view model, so that the consistency of refreshing of the browser and switching of the page language environment is effectively guaranteed, the sensory experience degree of the service provided by the browser is prevented from being influenced, and the use experience degree of a user is improved.
As an example, referring to fig. 9, fig. 9 is a schematic diagram of an application scenario in the embodiment of the present application, which includes a plurality of language packs 91 configured in advance, for example, a custom language pack, a chinese language pack, and an english language pack, and then identifies a target language included in a language change instruction, and matches the language pack corresponding to the target language, and a developer marks the language pack through a decorator or a filter or an i18n library to obtain a labeled corpus, and also illustrates a scenario 92 marked with a decorator, a scenario 93 marked with a filter, and a scenario 94 marked with an i18n library in fig. 9, that is, after obtaining the language pack of the target language, the developer may determine whether the language pack is an internationalized token based on the scenario 92 marked with a decorator, the scenario 93 marked with a filter, and the scenario 94 marked with an i18n library, that is, the label 95 outlined in fig. 9, if the corpus in the plurality of corpora is marked as the internationalization mark, the corpus is used as the marked corpus, so as to perform corresponding translation for the marked corpus.
In the embodiment, a view model is adopted to obtain a language change instruction, wherein the language change instruction comprises a target language; the view model acquires a markup corpus in a page; the view model loads the language package corresponding to the target language into the model corresponding to the view model; the view model translates the markup corpus through the language package corresponding to the target language, and displays the translated page through the view corresponding to the view model, so that the change of the page language of the intelligent cloud management console is more flexible, the intelligent cloud management console can be effectively adapted to various different languages, and the change of the language can meet the personalized requirement of page display.
Fig. 10 is a schematic diagram according to a fourth embodiment of the present application.
As shown in fig. 10, the apparatus 1000 for changing the language in the page includes:
a first obtaining module 1001, configured to obtain a language change instruction, where the language change instruction includes a target language;
a second obtaining module 1002, configured to obtain a markup corpus in a page;
a loading module 1003, configured to load a language package corresponding to the target language into a model corresponding to the view model;
the translation module 1004 is configured to translate the markup corpus through a language package corresponding to the target language, and display a translated page through a view corresponding to the view model.
In an embodiment of the present application, the first obtaining module 1001 is specifically configured to:
when the language setting state of the page changes, the view model acquires a language change instruction according to the changed language setting state; or
The view model receives a language change instruction input by a user.
In an embodiment of the present application, referring to fig. 11, fig. 11 is a schematic diagram according to a fifth embodiment of the present application, and the second obtaining module 1002 includes:
a first obtaining sub-module 10021, configured to obtain page content in a page;
the extracting submodule 10022 is configured to extract a plurality of corpora in the page content;
a second obtaining submodule 10023, configured to obtain tags of multiple corpora; and if the linguistic data in the plurality of linguistic data are marked as internationalized marks, taking the linguistic data as marked linguistic data.
In one embodiment of the present application, the marking is done by the developer through a decorator or filter.
In an embodiment of the present application, the translation module 1004 is further configured to:
and when the browser updates the page, displaying the page after translation through the view corresponding to the view model.
It should be noted that the explanation of the method for changing the language in the page is also applicable to the apparatus for changing the language in the page of the present embodiment, and is not repeated herein.
In this embodiment, a language change instruction is obtained, where the language change instruction includes a target language, a markup corpus in a page is obtained, a language package corresponding to the target language is loaded into a model corresponding to a view model, the markup corpus is translated through the language package corresponding to the target language, and the translated page is displayed through a view corresponding to the view model, so that the change of the page language of the intelligent cloud management console is more flexible, and can be effectively adapted to multiple different languages, and the change of the language can meet the personalized requirement of page display.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
Fig. 12 is a block diagram of an electronic device according to a method for changing a language among pages according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 12, the electronic apparatus includes: one or more processors 1201, memory 1202, and interfaces for connecting the various components, including a high speed interface and a low speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). Fig. 12 illustrates an example of one processor 1201.
Memory 1202 is a non-transitory computer readable storage medium as provided herein. The memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method for changing languages among pages provided by the present application. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform a method of changing a language among pages provided by the present application.
The memory 1202, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the method of changing a language among pages in the embodiments of the present application (for example, the first obtaining module 1001, the second obtaining module 1002, the loading module 1003, and the translation module 1004 shown in fig. 10). The processor 1201 executes various functional applications of the server and data processing, i.e., implementing a method of changing a language among pages in the above-described method embodiments, by executing non-transitory software programs, instructions, and modules stored in the memory 1202.
The memory 1202 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of an electronic device that performs a method of changing a language among pages, and the like. Further, the memory 1202 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 1202 may optionally include memory located remotely from the processor 1201, which may be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device may further include: an input device 1203 and an output device 1204. The processor 1201, the memory 1202, the input device 1203, and the output device 1204 may be connected by a bus or other means, and the bus connection is exemplified in fig. 12.
The input device 1203 may receive input numeric or character information and generate key signal inputs related to user settings and function controls of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or other input devices. The output devices 1204 may include a display device, auxiliary lighting devices (e.g., LEDs), tactile feedback devices (e.g., vibrating motors), and the like. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (12)

1. A method of changing language among pages, comprising:
acquiring a language change instruction, wherein the language change instruction comprises a target language;
acquiring a marked corpus in the page;
loading the language package corresponding to the target language into a model corresponding to a view model; and
and translating the markup corpus through the language package corresponding to the target language, and displaying a translated page through a view corresponding to the view model.
2. The method for changing languages among pages according to claim 1, wherein said obtaining a language change instruction comprises:
when the language setting state of the page changes, acquiring the language change instruction according to the changed language setting state; or
A language change instruction input by a user is received.
3. The method for changing languages in a page according to claim 1, wherein said obtaining markup corpus in said page comprises:
acquiring page content in the page;
extracting a plurality of corpora in the page content;
obtaining marks of the plurality of linguistic data; and
and if the linguistic data in the plurality of linguistic data are marked as internationalized marks, taking the linguistic data as the marked linguistic data.
4. The method of changing language among pages of claim 3 wherein said markup is marked by a developer through a decorator or filter.
5. The method for changing language among pages as claimed in claim 1, wherein when the browser updates said page, the translated page is presented through the view corresponding to said view model.
6. An apparatus for changing a language among pages, comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a language change instruction, and the language change instruction comprises a target language;
the second obtaining module is used for obtaining the markup corpus in the page;
the loading module is used for loading the language package corresponding to the target language into the model corresponding to the view model;
and the translation module is used for translating the marked corpus through the language packet corresponding to the target language and displaying a translated page through a view corresponding to the view model.
7. The apparatus for changing languages among pages of claim 6, wherein the first obtaining module is specifically configured to:
when the language setting state of the page changes, acquiring the language change instruction according to the changed language setting state; or
A language change instruction input by a user is received.
8. The apparatus for changing languages among pages of claim 6, wherein said second obtaining module comprises:
the first obtaining sub-module is used for obtaining page contents in the page;
the extraction submodule is used for extracting a plurality of linguistic data in the page content;
the second obtaining submodule is used for obtaining the marks of the plurality of linguistic data; and if the linguistic data in the plurality of linguistic data are marked as internationalized marks, taking the linguistic data as the marked linguistic data.
9. The apparatus for changing language among pages of claim 8, wherein said mark-up is made by a developer through a decorator or a filter.
10. The apparatus for changing languages among pages of claim 6, wherein said translation module is further configured to:
and when the browser updates the page, displaying the page after translation through the view corresponding to the view model.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-5.
CN202010614351.7A 2020-06-30 2020-06-30 Method and device for changing languages in page, storage medium and electronic equipment Pending CN111966433A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010614351.7A CN111966433A (en) 2020-06-30 2020-06-30 Method and device for changing languages in page, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010614351.7A CN111966433A (en) 2020-06-30 2020-06-30 Method and device for changing languages in page, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN111966433A true CN111966433A (en) 2020-11-20

Family

ID=73361100

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010614351.7A Pending CN111966433A (en) 2020-06-30 2020-06-30 Method and device for changing languages in page, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111966433A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113076164A (en) * 2021-04-16 2021-07-06 北京沃东天骏信息技术有限公司 Webpage language management method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110172987A1 (en) * 2010-01-12 2011-07-14 Kent Paul R Automatic technical language extension engine
US8843360B1 (en) * 2011-03-04 2014-09-23 Amazon Technologies, Inc. Client-side localization of network pages
US20150039287A1 (en) * 2013-07-31 2015-02-05 International Business Machines Corporation Translating textual information of an application
CN104899010A (en) * 2014-03-04 2015-09-09 北京金山云网络技术有限公司 Multilingualization method and system of source code
US20180189033A1 (en) * 2016-12-29 2018-07-05 TechRev, LLC Graphical software meta-development tool
CN111061533A (en) * 2019-12-18 2020-04-24 深圳前海环融联易信息科技服务有限公司 Page multi-language display method and device, electronic equipment and computer storage medium
CN111104108A (en) * 2018-10-29 2020-05-05 大唐移动通信设备有限公司 Display interface WPF generation method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110172987A1 (en) * 2010-01-12 2011-07-14 Kent Paul R Automatic technical language extension engine
US8843360B1 (en) * 2011-03-04 2014-09-23 Amazon Technologies, Inc. Client-side localization of network pages
US20150039287A1 (en) * 2013-07-31 2015-02-05 International Business Machines Corporation Translating textual information of an application
CN104899010A (en) * 2014-03-04 2015-09-09 北京金山云网络技术有限公司 Multilingualization method and system of source code
US20180189033A1 (en) * 2016-12-29 2018-07-05 TechRev, LLC Graphical software meta-development tool
CN111104108A (en) * 2018-10-29 2020-05-05 大唐移动通信设备有限公司 Display interface WPF generation method and device
CN111061533A (en) * 2019-12-18 2020-04-24 深圳前海环融联易信息科技服务有限公司 Page multi-language display method and device, electronic equipment and computer storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113076164A (en) * 2021-04-16 2021-07-06 北京沃东天骏信息技术有限公司 Webpage language management method and device
CN113076164B (en) * 2021-04-16 2024-04-16 北京沃东天骏信息技术有限公司 Webpage language management method and device

Similar Documents

Publication Publication Date Title
KR102249054B1 (en) Quick tasks for on-screen keyboards
CN112099790A (en) Method, device and equipment for determining page theme and storage medium
CN107679113B (en) Light application acquisition method and device and electronic device
CN107122172B (en) Light application processing method, light application running method, light application equipment and light application equipment
CN111897619A (en) Browser page display method and device, electronic equipment and storage medium
CN112099645A (en) Input image generation method and device, electronic equipment and storage medium
CN111610972B (en) Page generation method, device, equipment and storage medium
CN112346612A (en) Page display method and device
CN111597027A (en) Application program starting method, device, equipment and storage medium
CN111966433A (en) Method and device for changing languages in page, storage medium and electronic equipment
CN112163143B (en) Page switching method, device, equipment and storage medium
CN113626441A (en) Text management method, device and equipment based on scanning equipment and storage medium
CN111338714B (en) Method and device for processing small program material, electronic equipment and medium
CN111931524A (en) Method, apparatus, device and storage medium for outputting information
CN112528608A (en) Page editing method and device, electronic equipment and storage medium
CN111400431A (en) Event argument extraction method and device and electronic equipment
CN111352685A (en) Input method keyboard display method, device, equipment and storage medium
CN111651229A (en) Font changing method, device and equipment
CN113190365A (en) Information processing method and device and electronic equipment
US20160147741A1 (en) Techniques for providing a user interface incorporating sign language
CN112181429A (en) Information processing method and device and electronic equipment
CN112966201A (en) Object processing method, device, electronic equipment and storage medium
CN113672315A (en) Interface generation method and device, electronic equipment and storage medium
CN113723120B (en) Display method and device of reference information and electronic equipment
CN112099791B (en) Method, device, equipment and storage medium for setting page style in browser

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