Method, device, storage medium and electronic device for changing language in page

By using the MVVM architecture to obtain and translate language change instructions in the intelligent cloud management console, the problem of displaying multi-language environments of the intelligent cloud management console is solved, flexible language adaptation and personalized display are achieved, and user experience is improved.

CN111966433BActive Publication Date: 2024-11-08BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010614351.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-30
Publication Date
2024-11-08
Estimated Expiration
2040-06-30

AI Technical Summary

Technical Problem

In the application scenario of the intelligent cloud management console, when the browser and console locale are inconsistent, the language display of page content is inflexible, making it difficult to meet the personalized needs of multi-language environments.

Method used

Adaptive changes to the page language of the intelligent cloud management console are implemented by obtaining language change instructions, loading target language packs and translating markup corpus, and supporting the processing of custom language packs and international markup corpus.

Benefits of technology

It realizes flexible changes in the page language of the intelligent cloud management console, adapts to multiple language environments, meets personalized display needs, and improves the efficiency and user experience of language switching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111966433B_ABST
    Figure CN111966433B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, storage medium and electronic device for changing the language in a page, and relates to the fields of intelligent cloud technology and software development technology. The specific implementation scheme is: obtaining a language change instruction, wherein the language change instruction includes a target language; obtaining a markup corpus in the 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 package corresponding to the target language, and displaying the translated page through the view corresponding to the view model, so that the page language change of the intelligent cloud management console is more flexible, can effectively adapt to a variety of different languages, and the language change can meet the personalized needs of page display.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, specifically to the field of intelligent cloud technology and software development technology, and in particular to a method, device, storage medium and electronic device for changing the language in a web page. Background Art

[0002] In the application scenario of the intelligent cloud management console, when the language environment of the browser and the intelligent cloud management console are different, or when the intelligent cloud management console is switched to another language environment, the content on the page of the intelligent cloud management console usually needs to be displayed in the corresponding environment language. For example, if the language environment of the browser is English, the component content on the intelligent cloud management console should also be displayed in English. Summary of the invention

[0003] A method, device, storage medium, electronic device and computer program product for changing the language in a page are provided, so that the page language of an intelligent cloud management console can be changed more flexibly and can be effectively adapted to a variety of different languages, so that the language change can meet the personalized needs of page display.

[0004] According to a first aspect, a method for changing the language of a page is provided, comprising: obtaining a language change instruction, wherein the language change instruction includes a target language; obtaining a markup corpus in the page; loading a 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 the translated page through a view corresponding to the view model.

[0005] According to a second aspect, a device for changing the language in a page is provided, comprising: a first acquisition module, used to acquire a language change instruction, wherein the language change instruction includes a target language; a second acquisition module, used to acquire a markup corpus in the page; a loading module, used to load a language package corresponding to the target language into a model corresponding to a view model; and a translation module, used to translate the markup corpus through the language package corresponding to the target language, and display the translated page through a view corresponding to the view model.

[0006] According to a third aspect, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for changing the language in a page of an embodiment of the present application.

[0007] According to a fourth aspect, a non-transitory computer-readable storage medium storing computer instructions is proposed, wherein the computer instructions are used to enable the computer to execute the method for changing the language of a page disclosed in an embodiment of the present application.

[0008] According to a fifth aspect, a computer program product is proposed, including a computer program, which, when executed by a processor, implements the method for changing the language in a page disclosed in an embodiment of the present application.

[0009] According to the technology of the present application, the page language of the intelligent cloud management console can be changed more flexibly and can be effectively adapted to a variety of different languages, so that the language change can meet the personalized needs of page display.

[0010] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.

[0012] Figure 1 is a schematic diagram according to the first embodiment of the present application;

[0013] Figure 2 is a schematic diagram according to a second embodiment of the present application;

[0014] Figure 3 This is a schematic diagram of a page in an embodiment of the present application;

[0015] Figure 4 This is another page schematic diagram in the embodiment of the present application;

[0016] Figure 5 is a schematic diagram according to a third embodiment of the present application;

[0017] Figure 6 This is a schematic diagram of the internationalization mark of an embodiment of the present application;

[0018] Figure 7 This is a schematic diagram of a language package in an embodiment of the present application;

[0019] Figure 8 This is another schematic diagram of a language package in an embodiment of the present application;

[0020] Fig. 9 A schematic diagram of an application scenario in an embodiment of the present application;

[0021] Fig.10 is a schematic diagram according to a fourth embodiment of the present application;

[0022] Fig.11 is a schematic diagram according to a fifth embodiment of the present application;

[0023] Fig.12 It is a block diagram of an electronic device used to implement the method for changing the language in a page of an embodiment of the present application. DETAILED DESCRIPTION

[0024] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0025] Figure 1 It is a schematic diagram according to the first embodiment of the present application. It should be noted that the execution subject of the method for changing the language in a page of the present embodiment is a device for changing the language in a page, which can be implemented by software and / or hardware, and can be configured in an electronic device, which can include but is not limited to a terminal, a server, etc.

[0026] The embodiments of the present application relate to the fields of intelligent cloud technology and software development technology. In the embodiments of the present application, the language change in the page is achieved through the MVVM architecture (Model-View-ViewModel) based on the field of software development technology, so as to obtain faster language change efficiency, make the switching of the page language environment more coherent, and avoid affecting the page display at the view level.

[0027] In addition, the page in the present application may be, for example, a page of a browser corresponding to a smart cloud product, and the page may specifically be, for example, a page of a browser of a smart cloud management console, wherein the smart cloud management console is the entry point for users to manage and use corresponding cloud products through the network. The smart cloud management console can assist users in purchasing, viewing, and using the cloud products and services it manages.

[0028] Therefore, when the embodiment of the present application relates to the field of intelligent cloud technology, it is possible to adaptively change the language in the browser page of the intelligent cloud product, thereby enriching the application functions of the intelligent cloud product.

[0029] like Figure 1 As shown, the method for changing the language on this page may include:

[0030] S101: Acquire a language change instruction, wherein the language change instruction includes a target language.

[0031] When the execution subject of the method for changing the language in a page of this embodiment is a device for changing the language in a page, the software architecture of the device for changing the language in the page may specifically be, for example, an MVVM architecture.

[0032] Among them, the language change instruction is used to change the language of the page of the intelligent cloud management console. The language change instruction can be specifically triggered by the user, or it can be obtained according to the current need to change the language of the page when the language change device in the page actively recognizes that there is a need to change the language of the page. There is no limitation on this.

[0033] In an embodiment of the present application, when a language change instruction is obtained, wherein the language change instruction includes a target language, it is also possible to 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 different from the target language, the subsequent steps of changing the language are triggered. If the language supported by the language environment of the current page is the same as the target language, the user can be reminded that the current language is already the target language, which can effectively save the computing resources required to change the language.

[0034] S102: Obtaining the marked corpus in the page.

[0035] The marked corpus may be part of the corpus or the entire corpus in the page. The corpus may be understood as the text content in the page. The marked corpus may be, for example, the text content in the page that needs to be displayed in the target language.

[0036] That is to say, the embodiment of the present application supports changing the language of part of the markup corpus in the page, thereby providing a variety of language change functions, making the language change method more flexible.

[0037] S103: Loading the language package corresponding to the target language into the model corresponding to the view model.

[0038] The above-mentioned acquisition of the language change instruction, wherein the language change instruction includes the target language, and after acquiring the markup corpus in the page, the language package corresponding to the target language is also loaded into the model corresponding to the view model.

[0039] 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 a customized language package. Because it supports changing the language in the page according to a customized language package, the language change can meet the personalized needs of page display.

[0040] S104: Translate the marked corpus using a language package corresponding to the target language, and display the translated page using a view corresponding to the view model.

[0041] The above-mentioned translation of the marked corpus through the language package corresponding to the target language and displaying the translated page through the view corresponding to the view model can specifically be to display the translated page after the translation, that is, through the view corresponding to the view model, or, a display time point can be set, and at the display time point, the translated page is displayed through the view corresponding to the view model, and there is no limitation to this.

[0042] In this embodiment, by obtaining a language change instruction, wherein the language change instruction includes a target language, and obtaining the markup corpus in the page, loading the language package corresponding to the target language into the model corresponding to the view model, and 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, the page language change of the intelligent cloud management console is made more flexible, can effectively adapt to a variety of different languages, and the language change can meet the personalized needs of page display.

[0043] Figure 2 It is a schematic diagram according to the second embodiment of the present application.

[0044] In this embodiment, the execution subject of the method for changing the language in the page is taken as the view model for example, and no limitation is imposed on this.

[0045] like Figure 2 As shown, the method for changing the language on this page may include:

[0046] S201: The view model obtains a language change instruction, wherein the language change instruction includes a target language.

[0047] When the execution subject of the method for changing the language in a page of this embodiment is a device for changing the language in a page, the software architecture of the device for changing the language in the page may specifically be, for example, an MVVM architecture.

[0048] Therefore, when executing the method for changing the language in the page, the view model may specifically obtain the language change instruction, wherein the language change instruction includes the target language.

[0049] Among them, the language change instruction is used to change the language of the page of the intelligent cloud management console. The language change instruction can be specifically triggered by the user, or it can be obtained according to the current need to change the language of the page when the view model actively recognizes that there is a need to change the language of the page. There is no limitation on this.

[0050] In the embodiment of the present application, the view model obtains the language change instruction. When the language setting state of the page changes, the view model obtains the language change instruction according to the changed language setting state; or the view model receives the language change instruction input by the user. Therefore, the embodiment of the present application provides multiple input language change instruction entries, which can adapt to the language change requirements in various application scenarios and has multi-faceted flexibility.

[0051] As an example, see Figure 3 , Figure 3 This is a page diagram in an embodiment of the present application. Assume that page 30 includes a language environment selection button 31 [Chinese]. When [Chinese] is triggered, the change in the language setting state of the page can be monitored. At this time, it can be determined that there is a need to switch the language of the page to Chinese. When other language environment selection buttons in page 30 are triggered, the same processing logic can be executed.

[0052] In some other embodiments, an application programming interface can also be configured to monitor whether the language setting state of the page changes, or to monitor whether other setting events are generated on the page, and these setting events are associated with changes in the language setting state. When monitoring the generation of these setting events, the language setting state of the page can also be associated with changes. Alternatively, it is also possible to monitor whether the uniform resource locator of the page contains a setting path tag. When the uniform resource locator of the page contains a setting path tag, it indicates that the user currently has a need to manually modify the page language environment.

[0053] See also Figure 4 , Figure 4 This is another page schematic diagram in the embodiment of the present application. The uniform resource locator of the page includes a setting path tag {locale} 41, which indicates that the user currently has a need to manually modify the page language environment.

[0054] In the above, when the view model obtains the language change instruction, the language change instruction includes the target language, which is the language to which the language environment of the page currently needs to be modified. Assuming that the current language is English, the target language can be, for example, Chinese, French, Japanese, etc., without limitation.

[0055] In an embodiment of the present application, when the view model obtains a language change instruction, wherein the language change instruction includes 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 different from the target language, the subsequent steps of changing the language are triggered. If the language supported by the language environment of the current page is the same as the target language, the user can be reminded that the current language is already the target language, which can effectively save the computing resources required to change the language.

[0056] S202: The view model obtains the markup corpus in the page.

[0057] The marked corpus may be part of the corpus or the entire corpus in the page. The corpus may be understood as the text content in the page. The marked corpus may be, for example, the text content in the page that needs to be displayed in the target language.

[0058] That is to say, the embodiment of the present application supports changing the language of part of the markup corpus in the page, thereby providing a variety of language change functions, making the language change method more flexible.

[0059] The above-mentioned marked corpus can be marked in advance by the developer through decorators or filters, thereby providing a flexible way to mark the corpus, which is easy to implement and provides a variety of language change functions, making the language change method more flexible while lowering the learning threshold of language change.

[0060] As an example, the program code that developers use decorators to mark corpora can be shown as follows:

[0061] import { i18n} from'decorators / i18n';

[0062] @i18n('table')

[0063] exportdefaultclass Table extends BaseInput {

[0064] template = ` {{t('total',{index: 1, total: 10})}} `;

[0065] initData() {

[0066] return {

[0067] placeholder:this.t('placeholder')

[0068] };}}.

[0069] As another example, the program code for developers to mark corpora through filters can be shown as follows:

[0070] import { i18n} from'decorators / i18n';

[0071] @i18n('table')

[0072] exportdefaultclass Table extends BaseInput {

[0073] template = ` {{t('total',{index: 1, total: 10})}} `;

[0074] initData() {

[0075] return {

[0076] placeholder:this.t('placeholder')

[0077] };}.

[0078] As another example, the program code for developers to mark corpus through the i18n library can be shown as follows:

[0079] import i18n from'.. / .. / locale';

[0080] @i18n('table')

[0081] exportdefaultclass Table extends BaseInput {

[0082] template = ` {{i18n.t('tablbe.total',{index: 1, total: 10})}} `;}.

[0083] Of course, other possible methods may also be used to mark the corpus in the page whose language needs to be changed to obtain marked corpus.

[0084] The above-mentioned marked-up corpus is obtained by the developer through marking with decorators or filters. Therefore, in the present application, in an embodiment, the view model obtains the marked-up corpus in the page, and can directly identify the marked-up corpus in the page to support the subsequent translation of the marked-up corpus, or it can also obtain the marked-up corpus in the page by calling some pre-configured application programming interfaces.

[0085] In the present application embodiment, see Figure 5 , Figure 5 is a schematic diagram according to the third embodiment of the present application, see Figure 5 , the view model obtains the markup corpus in the page, including:

[0086] S501: Obtain the page content in the page.

[0087] S502: extracting multiple corpora from the page content.

[0088] S503: Obtain tags of multiple corpora.

[0089] S504: If the tag of a corpus among the multiple corpora is an internationalization tag, use the corpus as a tagged corpus.

[0090] The internationalization markup mentioned above is for example Figure 6 As shown, Figure 6 This is a schematic diagram of the internationalization mark of an embodiment of the present application.

[0091] If the tag of a corpus among the multiple corpora is an internationalization tag, the corpus is used as a marked corpus. At this time, the analysis path table.total corresponding to the internationalization tag can be parsed. The analysis path table.total is used to locate the language content for translating the marked corpus in the language package corresponding to the target language.

[0092] That is to say, in the embodiment of the present application, by obtaining the page content in the page, extracting multiple corpora in the page content, and obtaining the tags of the multiple corpora, and if the tag of a corpus in the multiple corpora is an internationalization tag, the corpus is used as the marked corpus, thereby providing a method for quickly obtaining the marked corpus in the page, improving the efficiency of changing the page language, making the switching of the page language environment more coherent, and avoiding the impact of switching jams on the user's cloud experience.

[0093] S203: The view model loads the language package corresponding to the target language into the model corresponding to the view model.

[0094] The view model obtains the language change instruction, wherein the language change instruction includes the target language, and after the view model obtains the markup corpus in the page, the view model can also load the language package corresponding to the target language into the model corresponding to the view model.

[0095] That is, the method for changing the language in a page in the embodiment of the present application supports changing the language in the page according to a custom language package, wherein the language package corresponding to the target language can be as follows: Figure 7 As shown, Figure 7 This is a schematic diagram of a language package in an embodiment of the present application. Figure 7 The corresponding language pack is shown in when the target language is Chinese. Figure 8 , Figure 8 This is another language package schematic diagram in the embodiment of the present application. Figure 8 The language packages shown in the figure are those corresponding to English when the target language is English. There is no restriction on this.

[0096] In the embodiment of the present application, since it supports changing the language in the page according to the customized language package, the change of the language can meet the personalized needs of the page display.

[0097] S204: The view model translates the marked corpus through the language package corresponding to the target language, and displays the translated page through the view corresponding to the view model.

[0098] In the above-mentioned view model, the marked corpus is translated through the language package corresponding to the target language, and the translated page is displayed through the view corresponding to the view model. Specifically, the translated page can be displayed through the view corresponding to the view model after the translation, or a display time point can be set, and at the display time point, the translated page is displayed through the view corresponding to the view model.

[0099] In the embodiment of the present application, when the browser updates the page, the translated page can be displayed through the view corresponding to the view model, thereby effectively ensuring the consistency of the browser refresh and the page language environment switching, avoiding affecting the sensory experience of the services provided by the browser, and improving the user experience.

[0100] As an example, see Fig. 9 , Fig. 9 Schematic diagram of application scenarios in an embodiment of the present application, including multiple pre-configured language packages 91, such as a custom language package, a Chinese language package, and an English language package. Then, the target language included in the language change instruction is identified, and a language package corresponding to the target language is matched. The developer marks it through a decorator or a filter or an i18n library to obtain a marked corpus. Fig. 9 92, 93, and 94 are also shown. That is, after obtaining the language pack of the target language, the developer can determine whether the language pack is an internationalization tag based on the language packs marked by the developer in the above-mentioned scenarios 92, 93, and 94. Fig. 9 The label 95 in the middle frame indicates that if the tag of a corpus among the multiple corpora is an internationalization tag, the corpus is used as the tagged corpus, and corresponding translation is performed on the tagged corpus.

[0101] In this embodiment, a view model is used to obtain a language change instruction, wherein the language change instruction includes a target language; the view model obtains the markup corpus in the page; the view model loads the language package corresponding to the target language into the model corresponding to the view model; and 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 page language change of the intelligent cloud management console is more flexible and can effectively adapt to a variety of different languages, so that the language change can meet the personalized needs of page display.

[0102] Fig.10 It is a schematic diagram according to the fourth embodiment of the present application.

[0103] like Fig.10 As shown, the device 1000 for changing the language in the page includes:

[0104] A first acquisition module 1001 is used to acquire a language change instruction, wherein the language change instruction includes a target language;

[0105] The second acquisition module 1002 is used to acquire the markup language in the page;

[0106] A loading module 1003 is used to load the language package corresponding to the target language into the model corresponding to the view model;

[0107] The translation module 1004 is used to translate the marked corpus through the language package corresponding to the target language, and display the translated page through the view corresponding to the view model.

[0108] In one embodiment of the present application, the first acquisition module 1001 is specifically configured to:

[0109] When the language setting state of the page changes, the view model obtains the language change instruction according to the changed language setting state; or

[0110] The view model receives language change instructions from the user.

[0111] In one embodiment of the present application, see Fig.11 , Fig.11 is a schematic diagram according to the fifth embodiment of the present application, the second acquisition module 1002 includes:

[0112] The first acquisition submodule 10021 is used to acquire the page content in the page;

[0113] Extraction submodule 10022, used to extract multiple corpora from the page content;

[0114] The second acquisition submodule 10023 is used to acquire tags of multiple corpora; and if the tag of a corpus among the multiple corpora is an internationalization tag, use the corpus as a marked corpus.

[0115] In one embodiment of the present application, marking is performed by a developer through a decorator or a filter.

[0116] In one embodiment of the present application, the translation module 1004 is further used to:

[0117] When the browser updates the page, the translated page is displayed through the view corresponding to the view model.

[0118] It should be noted that the aforementioned explanation of the method for changing the language in a page is also applicable to the device for changing the language in a page of this embodiment, and will not be repeated here.

[0119] In this embodiment, a language change instruction is obtained, wherein the language change instruction includes a target language, the markup corpus in the page is obtained, a language package corresponding to the target language is loaded into a model corresponding to the view model, and the markup corpus is translated by the language package corresponding to the target language, and the translated page is displayed by the view corresponding to the view model, so that the page language change of the intelligent cloud management console is more flexible, can effectively adapt to a variety of different languages, and the language change can meet the personalized needs of page display.

[0120] According to an embodiment of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.

[0121] Fig.12 It is a block diagram of an electronic device for implementing a method for changing a language in a page of an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices can 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 merely examples, and are not intended to limit the implementation of the present application described herein and / or required.

[0122] like Fig.12 As shown, the electronic device includes: one or more processors 1201, a memory 1202, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.12 A processor 1201 is taken as an example.

[0123] The memory 1202 is a non-transient computer-readable storage medium provided by the present application. The memory stores instructions executable by at least one processor to enable at least one processor to execute the method for changing the language of a page provided by the present application. The non-transient computer-readable storage medium of the present application stores computer instructions, which are used to enable a computer to execute the method for changing the language of a page provided by the present application.

[0124] The memory 1202 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as the program instructions / modules corresponding to the method for changing the language of a page in the embodiment of the present application (for example, the attached Fig.10 The processor 1201 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 1202, that is, the method for changing the language of the page in the above method embodiment is implemented.

[0125] The memory 1202 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created by the use of an electronic device according to a method for changing the language in an execution page, etc. In addition, the memory 1202 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 1202 may optionally include a memory remotely arranged relative to the processor 1201, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0126] 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 via a bus or other means. Fig.12 The example of connecting through bus is taken in the following.

[0127] The input device 1203 can receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 1204 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. 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 embodiments, the display device may be a touch screen.

[0128] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, application specific integrated circuits (ASICs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0129] To provide interaction with a user, the systems and techniques described herein 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 the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the 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 can be received in any form (including acoustic input, voice input, or tactile input).

[0130] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet.

[0131] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0132] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.

[0133] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A method for changing the language in a page, applied to a view model, comprising: obtaining a language change instruction, wherein the language change instruction includes a target language; Acquire the marked corpus in the page, where the marked corpus is the text content in the page that needs to be displayed in the target language; Loading the language package corresponding to the target language into the model corresponding to the view model; and The marked corpus is translated by the language package corresponding to the target language, and the translated page is displayed by the view corresponding to the view model.

2. The method for changing the language of a page according to claim 1, wherein: The obtaining of the 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 Receive language change instructions from the user.

3. The method for changing the language of a page according to claim 1, wherein: The obtaining of the marked corpus in the page includes: Obtaining the page content in the page; Extracting multiple corpora from the page content; Obtaining tags of the plurality of corpora; and If the tag of a corpus among the multiple corpora is an internationalization tag, the corpus is used as the marked corpus.

4. The method for changing the language in a page as described in claim 3, wherein the marking is performed by the developer through a decorator or a filter.

5. The method for changing the language of a page according to claim 1, wherein: When the browser updates the page, the translated page is displayed through the view corresponding to the view model.

6. A device for changing the language in a page, applied to a view model, comprising: A first acquisition module, configured to acquire a language change instruction, wherein the language change instruction includes a target language; A second acquisition module is used to acquire the marked corpus in the page, where the marked corpus is the text content in the page that needs to be displayed in the target language; A loading module, used to load the language package corresponding to the target language into the model corresponding to the view model; The translation module is used to translate the marked corpus through the language package corresponding to the target language, and display the translated page through the view corresponding to the view model.

7. The device for changing the language of a page as claimed in claim 6, wherein: The first acquisition module is specifically used to: When the language setting state of the page changes, acquiring the language change instruction according to the changed language setting state; or Receive language change instructions from the user.

8. The device for changing the language of a page as claimed in claim 6, wherein: The second acquisition module includes: A first acquisition submodule is used to acquire the page content in the page; An extraction submodule, used to extract multiple corpora from the page content; The second acquisition submodule is used to acquire the tags of the multiple corpora; and if the tag of a corpus among the multiple corpora is an internationalization tag, use the corpus as the marked corpus.

9. The device for changing the language in a page as claimed in claim 8, wherein the mark is marked by a developer through a decorator or a filter.

10. The device for changing the language of a page according to claim 6, wherein: The translation module is also used for: When the browser updates the page, the translated page is displayed through the view corresponding to the view model.

11. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.

12. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 5.

13. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 5.