CN110795192A - Language switching method and device and terminal equipment - Google Patents

Language switching method and device and terminal equipment Download PDF

Info

Publication number
CN110795192A
CN110795192A CN201911035690.3A CN201911035690A CN110795192A CN 110795192 A CN110795192 A CN 110795192A CN 201911035690 A CN201911035690 A CN 201911035690A CN 110795192 A CN110795192 A CN 110795192A
Authority
CN
China
Prior art keywords
language
page
module
package
target
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.)
Granted
Application number
CN201911035690.3A
Other languages
Chinese (zh)
Other versions
CN110795192B (en
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.)
Vidaa Netherlands International Holdings BV
Original Assignee
Qingdao Hisense Media Network 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 Qingdao Hisense Media Network Technology Co Ltd filed Critical Qingdao Hisense Media Network Technology Co Ltd
Priority to CN201911035690.3A priority Critical patent/CN110795192B/en
Publication of CN110795192A publication Critical patent/CN110795192A/en
Application granted granted Critical
Publication of CN110795192B publication Critical patent/CN110795192B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/485End-user interface for client configuration
    • H04N21/4856End-user interface for client configuration for language selection, e.g. for the menu or subtitles
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The embodiment of the invention provides a language switching method, a language switching device and terminal equipment, wherein the method comprises the following steps: when a language switching instruction is received, a target language type in the language switching instruction is obtained, if the target language type is not the language type used by the current display page, a target system level language package corresponding to the target language type is obtained, the target system level language package is loaded, a first module level language package corresponding to a first page module to which the current display page belongs is obtained, and the first module level language package is loaded, so that the language type used by the current display page is switched to the target language type.

Description

Language switching method and device and terminal equipment
Technical Field
The embodiment of the invention relates to the technical field of terminals, in particular to a language switching method and device and terminal equipment.
Background
With the development of economy and technology, the popularity of the smart television is higher and higher, and the provided functions are richer and richer. In order to facilitate the use of users using different languages, the smart television needs to support multi-language display, that is, the language used by the television interface can be switched from one language to another language.
In the prior art, when switching languages, a user generally acquires a new language type used by a television interface, and then acquires and loads all language resource files corresponding to the new language type, and after the loading is completed, the language type used by the television interface is switched to the new language type.
However, the inventors found that at least the following problems exist in the prior art: when the language is switched, the language type used by the television interface can be switched to the new language type after all the language resource files corresponding to the new language type are loaded, and the total volume of all the language resource files corresponding to the language type is large, so that the time required for switching the language is long, and correspondingly, a user needs to experience a long switching waiting time, and the user experience is reduced.
Disclosure of Invention
The embodiment of the invention provides a language switching method, a language switching device and terminal equipment, which are used for reducing the time required by language switching.
In a first aspect, an embodiment of the present invention provides a language switching method, including:
when a language switching instruction is received, acquiring a target language type in the language switching instruction;
if the target language type is not the language type used by the current display page, acquiring a target system level language package corresponding to the target language type, and loading the target system level language package;
and acquiring a first module level language package corresponding to a first page module to which the current display page belongs, and loading the first module level language package to switch the language type used by the current display page to the target language type.
In one possible design, after the loading the first module level language package, the method further comprises:
when the current display page is switched to a first page, judging whether a page module to which the first page belongs is the first page module;
if the first page module is not the target language type, acquiring a second module level language package corresponding to the page module to which the first page belongs, and loading the second module level language package to switch the language type used by the first page to the target language type.
In a possible design, the determining whether the page module to which the first page belongs is the first page module includes:
judging whether the language type used by the current display page is changed;
and if the language type used by the current display page is determined to be changed, judging whether the page module to which the first page belongs is the first page module.
In one possible design, the target system-level language package includes a target first system-level language package and a target second system-level language package.
In one possible design, before the obtaining, when the language switching instruction is received, the target language type in the language switching instruction, the method further includes:
when a starting-up instruction is received, starting-up initialization processing is carried out;
in the process of starting up initialization, acquiring a first system level language package corresponding to an initial language type, and loading the first system level language package;
when an initial display page is entered, acquiring an initial module level language package corresponding to a page module to which the initial page belongs, and loading the initial module level language package to enable the language type used by the initial page to be the initial language type;
and after the startup initialization is finished, acquiring a second system level language package corresponding to the initial language type, and loading the second system level language package.
In one possible design, before the obtaining, when the language switching instruction is received, the target language type in the language switching instruction, the method further includes:
acquiring a language package corresponding to each usable language type, wherein the language package comprises a plurality of language resource files;
and classifying the language resource files included in the language package aiming at each language package to obtain a system level language package corresponding to the language type and a module level language package corresponding to each preset page module.
In a second aspect, an embodiment of the present invention provides a language switching apparatus, including:
the instruction receiving module is used for acquiring a target language type in a language switching instruction when the language switching instruction is received;
the system level language package loading module is used for acquiring a target system level language package corresponding to the target language type and loading the target system level language package if the target language type is not the language type used by the current display page;
and the module level language package loading module is used for acquiring a first module level language package corresponding to a first page module to which the current display page belongs, and loading the first module level language package so as to switch the language type used by the current display page to the target language type.
In one possible design, the apparatus further includes a page switch module;
the page switching module is used for judging whether a page module to which the first page belongs is the first page module or not when the current display page is switched to the first page after the first module-level language package is loaded;
if the first page module is not the target language type, acquiring a second module level language package corresponding to the page module to which the first page belongs, and loading the second module level language package to switch the language type used by the first page to the target language type.
In one possible design, the page switching module is specifically configured to:
judging whether the language type used by the current display page is changed;
and if the language type used by the current display page is determined to be changed, judging whether the page module to which the first page belongs is the first page module.
In one possible design, the target system-level language package includes a target first system-level language package and a target second system-level language package.
In one possible design, the instruction receiving module is further configured to: when receiving a language switching instruction, performing starting initialization processing before acquiring a target language type in the language switching instruction and when receiving a starting instruction;
in the process of starting up initialization, acquiring a first system level language package corresponding to an initial language type, and loading the first system level language package;
when an initial display page is entered, acquiring an initial module level language package corresponding to a page module to which the initial page belongs, and loading the initial module level language package to enable the language type used by the initial page to be the initial language type;
and after the startup initialization is finished, acquiring a second system level language package corresponding to the initial language type, and loading the second system level language package.
In one possible design, the instruction receiving module is further configured to: when a language switching instruction is received, before a target language type in the language switching instruction is acquired, acquiring a language package corresponding to each usable language type, wherein the language package comprises a plurality of language resource files;
and classifying the language resource files included in the language package aiming at each language package to obtain a system level language package corresponding to the language type and a module level language package corresponding to each preset page module.
In a third aspect, an embodiment of the present invention provides a terminal device, including: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the memory-stored computer-executable instructions causes the at least one processor to perform the language switching method of any of the first aspects.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer-executable instruction is stored, and when a processor executes the computer-executable instruction, the language switching method according to any one of the first aspect is implemented.
The embodiment of the invention provides a language switching method, a device and terminal equipment, wherein the method comprises the steps of determining whether a target language type in a language switching instruction is the language type used by a current display page of a terminal when the language switching instruction is received, namely determining whether the language type used by the terminal needs to be switched into the target language type, if the language type used by the terminal needs to be switched into the target language type, loading a target system level language package corresponding to the target language type firstly so that a user can browse and operate the terminal normally, then only loading a first module level language package corresponding to a first page module to which the current display page belongs, and switching the language type used by the current display page into the target language type, namely only loading the system level language package and a part of the module level language package when the language is switched, the method has the advantages that all language resource files do not need to be loaded, the size of the files needing to be loaded is small, and therefore the file loading time is short, the time for switching languages is short, a user is prevented from experiencing long switching waiting time, and the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic diagram of a language switching system according to an embodiment of the present invention;
fig. 2 is a first flowchart of a language switching method according to an embodiment of the present invention;
FIG. 3 is a diagram of a language pack provided by an embodiment of the present invention;
fig. 4 is a second flowchart of a language switching method according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a language switching apparatus according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a hardware structure of a terminal device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a schematic structural diagram of a language switching system according to an embodiment of the present invention. As shown in fig. 1, the system includes a remote controller 100A, a mobile terminal 100B and a terminal 200, where a user may control the terminal 200 to perform some operations through a remote control device such as the remote controller 100A or the mobile terminal 100B, for example, an initial language used for controlling a page of the terminal is a language a, and a language familiar to the user is a language B, so that for the convenience of the user, the user may send a language switching instruction to the terminal through the remote control device to control the terminal to switch the language used for the page from the language a to the language B, thereby implementing the language switching.
In the prior art, when a terminal performs language switching, a new language type used by a user's desired television page is generally obtained first, then all language resource files corresponding to the new language type are obtained and loaded, and after the loading is completed, the language type used by the television page is switched to the new language type. The language type used by the television interface can be switched to the new language type only after all the language resource files corresponding to the new language type need to be loaded, and the total volume of all the language resource files corresponding to the language type is large, so that the time required for switching the languages is long, correspondingly, a user needs to experience a long switching waiting time, and the user experience is reduced.
Aiming at the problems in the prior art, the application provides a language switching method, a device and a terminal device, wherein the method comprises the steps of determining whether a target language type in a language switching instruction is the language type used by a current display page of the terminal when the language switching instruction is received, namely determining whether the language type used by the terminal needs to be switched to the target language type, if the language type used by the terminal needs to be switched to the target language type, loading a target system level language package corresponding to the target language type first so that a user can browse and operate the terminal normally, then only loading a first module level language package corresponding to a first page module to which the current display page belongs, namely when the language is switched, only the system level language package and part of the module level language packages are needed to be loaded, all language resource files are not needed to be loaded, and the file loading time is short, so that the time for switching languages is short, a user is prevented from experiencing a long switching waiting time, and the user experience is improved.
The page module is actually a service module, which is composed of pages for realizing a certain service function, and in the development stage, the page module is divided according to the attributes of the pages to obtain different page modules.
In practical applications, the terminal 200 may be a terminal including a display screen, or may not include a display screen, and herein, the terminal 200 is not limited.
The technical solution of the present invention will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 2 is a first flowchart of a language switching method according to an embodiment of the present invention, where an execution main body of the embodiment may be the terminal in the embodiment shown in fig. 1, and the embodiment is not limited herein. As shown in fig. 2, the method of this embodiment may include:
s201: and when the language switching instruction is received, acquiring a target language type in the language switching instruction.
In this embodiment, when the user needs to switch the language type, the user can select the desired language type, i.e., the target language type, through a remote control device such as a remote controller, and then send a language switching instruction to the terminal through the remote control device, where the language switching instruction includes the target language type, i.e., the language type that the user wants to use by the terminal. And after receiving the language switching instruction, the terminal acquires the target language type in the language switching instruction.
Here, the language type actually means a language, for example, english, korean, and the like.
After the terminal is started, the terminal needs to be started up and initialized first, and during the process of starting up and initializing, the language generally needs to be initialized, that is, the terminal used by the terminal is initialized to an initial language type, and the specific process is as follows: and when a starting-up instruction is received, starting-up initialization processing is carried out. In the process of starting up initialization, a first system level language package corresponding to the initial language type is obtained, and the first system level language package is loaded. And when the initial display page is entered, acquiring an initial module level language package corresponding to a page module to which the initial page belongs, and loading the initial module level language package to enable the language type used by the initial page to be the initial language type. And after the startup initialization is finished, acquiring a second system level language package corresponding to the initial language type, and loading the second system level language package.
In this embodiment, after receiving a power-on command sent by a user through a remote control device, the power-on initialization processing is started. And in the process of starting up initialization processing, a first system level language package corresponding to the initial language type is obtained first, the first system level language package is loaded, the first system level language package needs to be loaded in the process of starting up initialization processing, after the first system level language package is loaded, the initial module level language package corresponding to the page module to which the initial page belongs is started to be loaded, so that the language type used by the initial page is the initial language type, after the starting up initialization is finished, a second system level language package corresponding to the initial language type is loaded, and after the second system level language package is loaded, a user can browse and operate the terminal normally.
In the process of starting initialization, only a first system level language package corresponding to an initial language type and an initial module level language package corresponding to an initial page are loaded, the volume of the split system level language package and the split module level language package is small, the time required by loading the language packages is short, the initial module level language package is loaded before a second system level language package corresponding to the initial language type is loaded, the terminal can display the initial page in a short time, the process that a user faces a non-picture initialization for a long time is not needed, and the user experience is improved.
When the language package after splitting is used for language switching, the language package including all resource files realizing a certain language type needs to be split firstly, a module level language package and a system level language package corresponding to the language package are obtained, a user can normally browse and operate a terminal after the system level language package is loaded, after the certain module level language package is loaded, the language type used by a page in a page module corresponding to the module level language package can be the language type, wherein the specific process of unpacking the language package comprises the following steps: and acquiring a language package corresponding to each usable language type, wherein the language package comprises a plurality of language resource files. And classifying the language resource files included in the language package aiming at each language package to obtain a system level language package corresponding to the language type and a module level language package corresponding to each preset page module.
Wherein the system level language package comprises a first system level language package and a second system level language package. The first system level language package is generally loaded in the process of starting up initialization, and the second system level language package is generally loaded after the starting up initialization is finished. After the first system level language package and the second system level language package are loaded, the user can browse and operate the terminal normally, and correspondingly, the target system level language package comprises a target first system level language package and a target second system level language package.
Optionally, when the language resource files included in the language package are classified, the language resource files may be classified according to file identifiers of the language resource files, and the specific process includes: the method comprises the steps of obtaining file identifications of all language resource files included in a first language package, obtaining all first language resource files with the file identifications being first system level file identifications, forming the first system level language package, searching all second language resource files with the file identifications being second system level file identifications, and forming the second system level language package. And aiming at each preset page module, searching a third language resource file with a file identifier belonging to the file identifier included in the preset page module, and forming a module-level language package corresponding to the preset page module by all the searched third language resource files.
Wherein, the first language package is any one of the language packages.
In this embodiment, a first system level file identifier, a second system level file identifier, and file identifiers included in each page module may be determined from a preset file table, language resource files included in a language package are classified according to the file identifiers, so as to realize classification of the language package, and as shown in fig. 3, the language package language _ js is split to obtain a first system level language package language _ system _1.js, a second system level language package language _ system _2.js, a module level language package language _ home.js, and a module level language package language _ tv.js.
In this embodiment, before the user uses the terminal, all the language types that can be used by the terminal and the language packages corresponding to the language types can be obtained, and for each language package, classifying the language resource files included in the language package, determining a system level language package and each preset page module corresponding to the language type, namely the module level language package corresponding to the available page module of the terminal, realizes the splitting of the language package, compared with the language package containing all language resource files, the file volume of the system level or module level language package only comprising part of the language resource files is smaller, when the system level or module level language package needs to be loaded, the required file loading time is shorter, therefore, the language type corresponding to the language package can be used by the terminal display page in a short time, and a user does not need to wait for a long language type loading process.
S202: and if the target language type is not the language type used by the current display page, acquiring a target system level language package corresponding to the target language type, and loading the target system level language package.
In this embodiment, when it is determined that the target language type is not the language type used by the current display page, indicating that the language type used by the current display page needs to be switched, the target system level language package corresponding to the target language type is obtained, and the target system level language package is loaded. If the target language type is the language type used by the current display page, language switching is not needed.
Because the switching of the language type is generally performed in the process of using the terminal by the user for convenience, when the language type used by the current display page needs to be switched, all the target system level language packages can be directly loaded without separately loading the target first system level language package and the target second system level language package at any time.
S203: and acquiring a first module level language package corresponding to a first page module to which the current display page belongs, and loading the first module level language package to switch the language type used by the current display page to the target language type.
In this embodiment, a first module level language package corresponding to a first page module to which a current display page belongs is obtained, the first page module level language package is loaded, and after the first page module level language package is recorded, a language type used by the current display page can be switched to a target language type, that is, a language type of content displayed by the current display page is switched to the target language type.
The first module level language package is actually the module level language package of the target language type corresponding to the first page module.
It can be known from the above description that, when a language switching instruction is received, it is determined whether a target language type in the language switching instruction is a language type used by a current display page of the terminal, that is, it is determined whether the language type used by the terminal needs to be switched to the target language type, if it is determined that the language type used by the terminal needs to be switched to the target language type, a target system level language package corresponding to the target language type is loaded first, so that a user can browse and operate the terminal normally, and then only a first module level language package corresponding to a first page module to which the current display page belongs needs to be loaded, so that the language type used by the current display page can be switched to the target language type, that is, when the language switching is performed, only a system level language package and a part of module level language packages need to be loaded, and all language resource files need not to be loaded, the time for loading the file is short, so that the time for switching the languages is short, the user is prevented from experiencing a long switching waiting time, and the user experience is improved.
When switching from the currently displayed page to another page, the language type used by the other page needs to be switched to the target language type, and the process of switching the language type used by the other page to the target language type is described in detail below with reference to a specific embodiment.
Fig. 4 is a second flowchart of the language switching method provided in the embodiment of the present invention, as shown in fig. 4, and on the basis of the foregoing embodiment, a detailed description is made on a specific implementation process for switching a language type used by another page to a target language type, as shown in fig. 4, the method includes:
s401: and when the language switching instruction is received, acquiring a target language type in the language switching instruction.
S402: and if the target language type is not the language type used by the current display page, acquiring a target system level language package corresponding to the target language type, and loading the target system level language package.
S403: and acquiring a first module level language package corresponding to a first page module to which the current display page belongs, and loading the first module level language package to switch the language type used by the current display page to the target language type.
S401 to S403 are similar to S201 to S203 in the embodiment of fig. 2, and are not described herein again.
S404: when the current display page is switched to the first page, whether a page module to which the first page belongs is a first page module is judged.
In this embodiment, when a page is switched, for example, when a currently displayed page is switched to a first page, it is determined whether a page module to which the first page belongs is a first page module, if the page module of the first page is the first page module, the currently displayed page and the first page belong to the same first page module, because a first module-level language package corresponding to the first page module is already loaded, when the first page is switched, the first module-level language package does not need to be repeatedly loaded, and when a terminal displays the first page, a language type used by the first page is a target language type, that is, a language type of content displayed by the first page is a target language type.
When judging whether the page module to which the first page belongs is the first page module, determining the page module to which the first page belongs according to the attribute information of the first page, so as to judge whether the page module is the first page module, wherein the specific process is as follows: the method comprises the steps of obtaining attribute information of a first page, wherein the attribute information comprises a module identification, the module identification is an identification of a page module to which the first page belongs, judging whether the module identification of the first page is the same as the identification of the first page module, if the module identification of the first page is the same as the identification of the first page module, determining that the page module to which the first page belongs is the first page module, and if the module identification of the first page is different from the identification of the first page module, determining that the page module to which the first page belongs is not the first page module.
To avoid switching languages by mistake, when switching from the current display page to the first page, it may be determined whether the language type used by the current display page changes, and the specific process is as follows: and judging whether the language type used by the current display page is changed. And if the language type used by the current display page is determined to be changed, judging whether the page module to which the first page belongs is the first page module.
In this embodiment, it is determined whether the language type used by the currently displayed page changes, that is, whether one language type is switched to another language type, and when it is determined that the language type used by the currently displayed page changes, that is, when it is determined that the language type used by the currently displayed page is switched, it indicates that the language type used by the first page needs to be switched, it is determined whether the page module to which the first page belongs is the first page module. When the language type used by the current display page is determined not to be changed, namely the language type used by the current display page is determined not to be switched, the language type used by the first page does not need to be switched, and therefore whether the page module to which the first page belongs is the first page module or not does not need to be judged.
S405: if the first page module is not the first page module, acquiring a second module level language package corresponding to the page module to which the first page belongs, and loading the second module level language package to switch the language type used by the first page to the target language type.
In this embodiment, when it is determined that the page module to which the first page belongs is not the first page module, it indicates that the first page is a page in another page module, when the currently displayed page is switched to the first page module, the second module-level language package corresponding to the page module to which the first page belongs needs to be loaded, and after the second module-level language package is loaded, the language type of the content displayed by the first page is the target language type.
The second module level language package corresponding to the page module to which the first page belongs is actually the second module level language package of the target language type corresponding to the page module to which the first page belongs.
The second module level language package corresponding to the first page is obtained last time when the page module to which the first page belongs is determined not to be the first page module, the first page switching can be carried out by a user after the terminal is started, when the page switching is not carried out for the first time, in order to avoid repeated loading of the module level language package, the identification of the loaded page module to which the module level language package corresponding to the target language type is loaded can be recorded, when the page module to which the first page belongs is determined not to be the first page module, whether the page module to which the first page belongs is in the identification of the loaded page module is judged, if the page module to which the first page belongs is loaded before is indicated in the identification of the loaded page module, repeated loading is not needed, extra waste of resources is avoided, and time required by page switching is reduced, the user experience is improved.
Optionally, in order to avoid repeated loading of the module-level language package, when the currently displayed page is switched to the first page, whether the page identifier of the page module to which the first page belongs is in the identifier of the loaded page module may be directly determined, so as to determine whether the module-level language package corresponding to the page module to which the first page belongs is loaded, and thus determine whether to load the second module-level language package corresponding to the page module to which the first page belongs.
In this embodiment, when a currently displayed page is switched to a first page, it is first determined whether a module level language package corresponding to a page module to which the first page belongs is loaded, if the module level language package is not loaded, the module level language package is loaded, after the loading is completed, a language type used by the first page is switched to a target language type, so that the page is switched, and if the module level language package is loaded, the module level language package does not need to be repeatedly loaded, the first page is directly displayed, so that the page is switched, so that the repeated loading of the language package is avoided, and because the file volume of the module level language package is small, compared with the loading of all language resource files corresponding to a certain language type, the time required for page switching can be greatly reduced by only loading one module level language package, and the user experience is improved.
Fig. 5 is a schematic structural diagram of a language switching apparatus according to an embodiment of the present invention, and as shown in fig. 5, the language switching apparatus 500 according to the embodiment may include: an instruction receiving module 501, a system level language package loading module 502 and a module level language package loading module 503.
The instruction receiving module is used for acquiring the target language type in the language switching instruction when the language switching instruction is received.
And the system level language package loading module is used for acquiring a target system level language package corresponding to the target language type and loading the target system level language package if the target language type is not the language type used by the current display page.
And the module level language package loading module is used for acquiring a first module level language package corresponding to a first page module to which the current display page belongs, and loading the first module level language package so as to switch the language type used by the current display page to the target language type.
In one possible design, the apparatus further includes a page switch module.
And the page switching module is used for judging whether the page module to which the first page belongs is the first page module or not when the current display page is switched to the first page after the first module-level language package is loaded.
If the first page module is not the first page module, acquiring a second module level language package corresponding to the page module to which the first page belongs, and loading the second module level language package to switch the language type used by the first page to the target language type.
In one possible design, the page switching module is specifically configured to:
and judging whether the language type used by the current display page is changed.
And if the language type used by the current display page is determined to be changed, judging whether the page module to which the first page belongs is the first page module.
In one possible design, the target system-level language package includes a target first system-level language package and a target second system-level language package.
In one possible design, the instruction receiving module is further configured to: and when receiving the language switching instruction, performing starting initialization processing before acquiring the target language type in the language switching instruction and when receiving the starting instruction.
In the process of starting up initialization, a first system level language package corresponding to the initial language type is obtained, and the first system level language package is loaded.
And when the initial display page is entered, acquiring an initial module level language package corresponding to a page module to which the initial page belongs, and loading the initial module level language package to enable the language type used by the initial page to be the initial language type.
And after the startup initialization is finished, acquiring a second system level language package corresponding to the initial language type, and loading the second system level language package.
In one possible design, the instruction receiving module is further configured to: when a language switching instruction is received, before a target language type in the language switching instruction is acquired, a language package corresponding to each usable language type is acquired, wherein the language package comprises a plurality of language resource files.
And classifying the language resource files included in the language package aiming at each language package to obtain a system level language package corresponding to the language type and a module level language package corresponding to each preset page module.
The tumor image segmentation device provided by the embodiment of the invention can realize the method of the embodiment, and the realization principle and the technical effect are similar, and are not described again here.
Fig. 6 is a schematic diagram of a hardware structure of a terminal device according to an embodiment of the present invention. As shown in fig. 6, the terminal device 600 provided in the present embodiment includes: at least one processor 601 and memory 602. The processor 601 and the memory 602 are connected by a bus 603.
In a specific implementation, the at least one processor 601 executes computer-executable instructions stored by the memory 602, so that the at least one processor 601 performs the language switching method in the above-described method embodiments.
For a specific implementation process of the processor 601, reference may be made to the above method embodiments, which implement the principle and the technical effect similarly, and details of this embodiment are not described herein again.
In the embodiment shown in fig. 6, it should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor, or in a combination of the hardware and software modules within the processor.
The memory may comprise high speed RAM memory and may also include non-volatile storage NVM, such as at least one disk memory.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer execution instruction is stored in the computer-readable storage medium, and when a processor executes the computer execution instruction, the language switching method of the above method embodiment is implemented.
The computer-readable storage medium may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. Readable storage media can be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. Of course, the readable storage medium may also be an integral part of the processor. The processor and the readable storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium may also reside as discrete components in the apparatus.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for switching languages, comprising:
when a language switching instruction is received, acquiring a target language type in the language switching instruction;
if the target language type is not the language type used by the current display page, acquiring a target system level language package corresponding to the target language type, and loading the target system level language package;
and acquiring a first module level language package corresponding to a first page module to which the current display page belongs, and loading the first module level language package to switch the language type used by the current display page to the target language type.
2. The method of claim 1, further comprising, after said loading said first module level language package:
when the current display page is switched to a first page, judging whether a page module to which the first page belongs is the first page module;
if the first page module is not the target language type, acquiring a second module level language package corresponding to the page module to which the first page belongs, and loading the second module level language package to switch the language type used by the first page to the target language type.
3. The method of claim 2, wherein the determining whether the page module to which the first page belongs is the first page module comprises:
judging whether the language type used by the current display page is changed;
and if the language type used by the current display page is determined to be changed, judging whether the page module to which the first page belongs is the first page module.
4. The method of claim 1, wherein the target system-level language package comprises a target first system-level language package and a target second system-level language package.
5. The method according to claim 1, before said obtaining the target language type in the language switching instruction when receiving the language switching instruction, further comprising:
when a starting-up instruction is received, starting-up initialization processing is carried out;
in the process of starting up initialization, acquiring a first system level language package corresponding to an initial language type, and loading the first system level language package;
when an initial display page is entered, acquiring an initial module level language package corresponding to a page module to which the initial page belongs, and loading the initial module level language package to enable the language type used by the initial page to be the initial language type;
and after the startup initialization is finished, acquiring a second system level language package corresponding to the initial language type, and loading the second system level language package.
6. The method according to claim 1, before said obtaining the target language type in the language switching instruction when receiving the language switching instruction, further comprising:
acquiring a language package corresponding to each usable language type, wherein the language package comprises a plurality of language resource files;
and classifying the language resource files included in the language package aiming at each language package to obtain a system level language package corresponding to the language type and a module level language package corresponding to each preset page module.
7. A language switching device, comprising:
the instruction receiving module is used for acquiring a target language type in a language switching instruction when the language switching instruction is received;
the system level language package loading module is used for acquiring a target system level language package corresponding to the target language type and loading the target system level language package if the target language type is not the language type used by the current display page;
and the module level language package loading module is used for acquiring a first module level language package corresponding to a first page module to which the current display page belongs, and loading the first module level language package so as to switch the language type used by the current display page to the target language type.
8. The apparatus of claim 7, further comprising a page switch module;
the page switching module is used for judging whether a page module to which the first page belongs is the first page module or not when the current display page is switched to the first page after the first module-level language package is loaded;
if the first page module is not the target language type, acquiring a second module level language package corresponding to the page module to which the first page belongs, and loading the second module level language package to switch the language type used by the first page to the target language type.
9. A terminal device, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the memory-stored computer-executable instructions cause the at least one processor to perform the language switching method of any of claims 1 to 6.
10. A computer-readable storage medium having stored thereon computer-executable instructions which, when executed by a processor, implement the language switching method of any one of claims 1 to 6.
CN201911035690.3A 2019-10-29 2019-10-29 Language switching method and device and terminal equipment Active CN110795192B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911035690.3A CN110795192B (en) 2019-10-29 2019-10-29 Language switching method and device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911035690.3A CN110795192B (en) 2019-10-29 2019-10-29 Language switching method and device and terminal equipment

Publications (2)

Publication Number Publication Date
CN110795192A true CN110795192A (en) 2020-02-14
CN110795192B CN110795192B (en) 2023-08-25

Family

ID=69441729

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911035690.3A Active CN110795192B (en) 2019-10-29 2019-10-29 Language switching method and device and terminal equipment

Country Status (1)

Country Link
CN (1) CN110795192B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111399728A (en) * 2020-03-04 2020-07-10 维沃移动通信有限公司 Setting method, electronic device, and storage medium
CN111767104A (en) * 2020-05-07 2020-10-13 北京奇艺世纪科技有限公司 Language type switching method and device, computer equipment and storage medium
CN112165654A (en) * 2020-08-05 2021-01-01 深圳市华曦达科技股份有限公司 Channel language switching method and device, computer equipment and storage medium
CN112667938A (en) * 2020-12-31 2021-04-16 银盛通信有限公司 Method for realizing multi-language switching of page based on PHP
CN113360061A (en) * 2021-05-25 2021-09-07 苏州众言网络科技股份有限公司 Language switching method and device

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070265828A1 (en) * 2006-05-09 2007-11-15 Research In Motion Limited Handheld electronic device including automatic selection of input language, and associated method
CN102624875A (en) * 2012-02-22 2012-08-01 深圳市共进电子股份有限公司 Method for replacing or updating language packs of terminal equipment
CN104462074A (en) * 2014-12-26 2015-03-25 北京奇虎科技有限公司 Method and device for conducting webpage data translation and browser client side
CN104714982A (en) * 2013-12-17 2015-06-17 阿里巴巴集团控股有限公司 Method and system for loading webpage
CN104951364A (en) * 2014-03-31 2015-09-30 Tcl集团股份有限公司 Android platform based language switching method and system
CN105094905A (en) * 2015-07-21 2015-11-25 北京金山安全软件有限公司 Method and device for dynamically loading language resources
CN108021423A (en) * 2017-12-15 2018-05-11 语联网(武汉)信息技术有限公司 A kind of Multilingual website generating method, system and computer-readable recording medium
CN108984260A (en) * 2018-07-11 2018-12-11 北京字节跳动网络技术有限公司 Method and apparatus for handling information
CN109446796A (en) * 2018-09-19 2019-03-08 北京达佳互联信息技术有限公司 Application control method and device, mobile terminal and storage medium
CN109901886A (en) * 2019-01-23 2019-06-18 北京达佳互联信息技术有限公司 Page language switching method, system, device and computer readable storage medium
CN110362370A (en) * 2019-06-14 2019-10-22 平安科技(深圳)有限公司 A kind of switching method of homepages language, device and terminal device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070265828A1 (en) * 2006-05-09 2007-11-15 Research In Motion Limited Handheld electronic device including automatic selection of input language, and associated method
CN102624875A (en) * 2012-02-22 2012-08-01 深圳市共进电子股份有限公司 Method for replacing or updating language packs of terminal equipment
CN104714982A (en) * 2013-12-17 2015-06-17 阿里巴巴集团控股有限公司 Method and system for loading webpage
CN104951364A (en) * 2014-03-31 2015-09-30 Tcl集团股份有限公司 Android platform based language switching method and system
CN104462074A (en) * 2014-12-26 2015-03-25 北京奇虎科技有限公司 Method and device for conducting webpage data translation and browser client side
CN105094905A (en) * 2015-07-21 2015-11-25 北京金山安全软件有限公司 Method and device for dynamically loading language resources
CN108021423A (en) * 2017-12-15 2018-05-11 语联网(武汉)信息技术有限公司 A kind of Multilingual website generating method, system and computer-readable recording medium
CN108984260A (en) * 2018-07-11 2018-12-11 北京字节跳动网络技术有限公司 Method and apparatus for handling information
CN109446796A (en) * 2018-09-19 2019-03-08 北京达佳互联信息技术有限公司 Application control method and device, mobile terminal and storage medium
CN109901886A (en) * 2019-01-23 2019-06-18 北京达佳互联信息技术有限公司 Page language switching method, system, device and computer readable storage medium
CN110362370A (en) * 2019-06-14 2019-10-22 平安科技(深圳)有限公司 A kind of switching method of homepages language, device and terminal device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111399728A (en) * 2020-03-04 2020-07-10 维沃移动通信有限公司 Setting method, electronic device, and storage medium
CN111767104A (en) * 2020-05-07 2020-10-13 北京奇艺世纪科技有限公司 Language type switching method and device, computer equipment and storage medium
CN111767104B (en) * 2020-05-07 2023-09-01 北京奇艺世纪科技有限公司 Language type switching method and device, computer equipment and storage medium
CN112165654A (en) * 2020-08-05 2021-01-01 深圳市华曦达科技股份有限公司 Channel language switching method and device, computer equipment and storage medium
CN112667938A (en) * 2020-12-31 2021-04-16 银盛通信有限公司 Method for realizing multi-language switching of page based on PHP
CN113360061A (en) * 2021-05-25 2021-09-07 苏州众言网络科技股份有限公司 Language switching method and device

Also Published As

Publication number Publication date
CN110795192B (en) 2023-08-25

Similar Documents

Publication Publication Date Title
CN110795192B (en) Language switching method and device and terminal equipment
US11868785B2 (en) Application program page processing method and device
CN107832100B (en) APK plug-in loading method and terminal thereof
CN102238265B (en) Mobile phone and method for realizing double-system mobile phone
US20170308369A1 (en) Data processing method and device of preset application after upgrading
CN110018858B (en) Application management method and device based on voice control
CN109587252A (en) Loading method, device, electronic equipment and the storage medium of operator parameter
CN109905770B (en) Terminal starting method and device and terminal
CN108174255B (en) Smart television starting method, smart television and computer readable storage medium
CN106648685B (en) Intelligent terminal system application processing method and device and intelligent terminal
CN108228293B (en) Interface skin switching method and device
CN107577472B (en) Software installation method and device and computer readable storage medium
CN105335178B (en) Starting control method and device
CN112181554B (en) Interactive interface display method, device, electronic device and storage medium
CN109408355B (en) Test case obtaining method and device
CN103778211A (en) Method and device for switching language of mobile terminal game software
CN111694585A (en) Method, system, terminal and storage medium for replacing system partition file
CN111708548A (en) Software installation method, device, equipment and storage medium
CN107885543B (en) Function management method and device of application program and intelligent terminal
CN106470351B (en) Page display method and page display device
CN111881393A (en) Page rendering method, device, medium and electronic equipment
CN111061414A (en) Skin replacement method and device, electronic equipment and readable storage medium
CN108111905B (en) Channel list display method, smart television and computer readable storage medium
CN112182446A (en) Page display method and device, terminal equipment and computer readable storage medium
US11050621B2 (en) Client, server and differential upgrade method

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20221019

Address after: 83 Intekte Street, Devon, Netherlands

Applicant after: VIDAA (Netherlands) International Holdings Ltd.

Address before: 266061 room 131, 248 Hong Kong East Road, Laoshan District, Qingdao City, Shandong Province

Applicant before: QINGDAO HISENSE MEDIA NETWORKS Ltd.

GR01 Patent grant
GR01 Patent grant