CN115373783A - Page language switching method and device - Google Patents
Page language switching method and device Download PDFInfo
- Publication number
- CN115373783A CN115373783A CN202210957572.3A CN202210957572A CN115373783A CN 115373783 A CN115373783 A CN 115373783A CN 202210957572 A CN202210957572 A CN 202210957572A CN 115373783 A CN115373783 A CN 115373783A
- Authority
- CN
- China
- Prior art keywords
- language
- page
- package
- custom
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
- G06F9/454—Multi-language systems; Localisation; Internationalisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0481—Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
- G06F3/0482—Interaction with lists of selectable items, e.g. menus
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Machine Translation (AREA)
Abstract
本发明公开了一种页面语言切换方法和装置,涉及数据可视化技术领域。该方法的一具体实施方式包括:接收用户对页面的访问操作,加载与所述页面对应的多语言包,响应于加载所述多语言包成功,执行绑定语言切换事件操作;响应于收到用户对目标语言标志的选择操作,基于所述语言切换事件,将与所述目标语言标志对应的目标语言设置为当前语言;从所述多语言包中确定与所述目标语言标志对应的目标语言包,使用所述目标语言包将所述页面中显示的内容切换为所述目标语言的内容。该实施方式支持应用页面的多语言切换,提供资源预加载机制,可根据用户选择的语言标志切换界面显示语言,以提升应用页面的开发效率。
The invention discloses a page language switching method and device, and relates to the technical field of data visualization. A specific implementation of the method includes: receiving a user's access operation to a page, loading a multilingual package corresponding to the page, and executing a binding language switching event operation in response to the successful loading of the multilingual package; The user selects the target language flag, based on the language switching event, sets the target language corresponding to the target language flag as the current language; determines the target language corresponding to the target language flag from the multilingual package package, using the target language package to switch the content displayed on the page to content in the target language. This embodiment supports multi-language switching of the application page, provides a resource preloading mechanism, and can switch the interface display language according to the language flag selected by the user, so as to improve the development efficiency of the application page.
Description
技术领域technical field
本发明涉及大数据领域中的数据可视化技术领域,尤其涉及一种页面语言切换方法和装置。The invention relates to the technical field of data visualization in the field of big data, in particular to a page language switching method and device.
背景技术Background technique
随着全球经济的发展,前端应用逐渐增多,各行业前端应用产品和业务也逐渐多样化。针对不同国家的客户,前端应用需要快速切换不同的语言显示页面,因而开发人员需要开发多套界面,开发效率低,无法及时满足繁重的产品需求,导致渠道运营产品更新不及时,影响业务发展。With the development of the global economy, front-end applications are gradually increasing, and front-end application products and services in various industries are also gradually diversifying. For customers in different countries, the front-end application needs to quickly switch between different language display pages, so developers need to develop multiple sets of interfaces, the development efficiency is low, and the heavy product demand cannot be met in time, resulting in untimely update of channel operation products and affecting business development.
为解决上述问题,现有虽提供统一的前端页面应用多语言布局方法,但该方式缺乏缓存多语言包机制以及缺乏多语言动态切换功能,用户不能自主选择页面显示的语言,导致页面渲染速度过慢影响体验。In order to solve the above problems, although a unified front-end page application multilingual layout method is currently provided, this method lacks the mechanism of caching multilingual packs and lacks the function of multilingual dynamic switching. Users cannot independently choose the language displayed on the page, resulting in excessive page rendering speed. Slowly affect the experience.
发明内容Contents of the invention
有鉴于此,本发明实施例提供一种页面语言切换方法和装置,至少能够解决现有技术中缺乏缓存多语言包机制以及缺乏多语言动态切换功能,用户不能自主选择页面显示的语言的现象。In view of this, the embodiments of the present invention provide a page language switching method and device, which can at least solve the phenomenon that users cannot independently select the language displayed on the page due to the lack of caching multi-language package mechanism and lack of multi-language dynamic switching function in the prior art.
为实现上述目的,根据本发明实施例的一个方面,提供了一种页面语言切换方法,包括:To achieve the above purpose, according to an aspect of the embodiments of the present invention, a page language switching method is provided, including:
接收用户对页面的访问操作,加载与所述页面对应的多语言包,响应于加载所述多语言包成功,执行绑定语言切换事件操作;Receive the user's access operation to the page, load the multilingual package corresponding to the page, and execute the binding language switching event operation in response to the successful loading of the multilingual package;
响应于收到用户对目标语言标志的选择操作,基于所述语言切换事件,将与所述目标语言标志对应的目标语言设置为当前语言;以及In response to receiving the user's selection operation on the target language flag, based on the language switching event, setting the target language corresponding to the target language flag as the current language; and
从所述多语言包中确定与所述目标语言标志对应的目标语言包,使用所述目标语言包将所述页面中显示的内容切换为所述目标语言的内容。A target language package corresponding to the target language flag is determined from the multilingual packages, and the content displayed on the page is switched to content in the target language by using the target language package.
可选的,所述加载与所述页面对应的多语言包,包括:Optionally, the loading the multilingual package corresponding to the page includes:
从所述页面的配置文件中查询所述多语言包的路径信息;Querying the path information of the multilingual package from the configuration file of the page;
响应于在本地缓存中查找存在所述多语言包,确定本次非首次访问所述页面,从本地缓存中加载所述多语言包;或In response to finding the multilingual package in the local cache, it is determined that the page is not accessed for the first time, and the multilingual package is loaded from the local cache; or
响应于在本地缓存中查找不存在所述多语言包,确定本次为首次访问所述页面,从服务器下载所述多语言包并存入本地缓存中。In response to finding that the multilingual package does not exist in the local cache, it is determined that this is the first visit to the page, and the multilingual package is downloaded from the server and stored in the local cache.
可选的,所述多语言包包括公共多语言包、与所述页面对应的自定义多语言包,所述路径信息包括与所述公共多语言包对应的路径信息、与所述自定义多语言包对应的路径信息。Optionally, the multilingual package includes a public multilingual package, a custom multilingual package corresponding to the page, and the path information includes path information corresponding to the public multilingual package, a The path information corresponding to the language pack.
可选的,公共多语言包包括公共组件语言包和公共文字语言包,自定义多语言包包括自定义组件语言包和自定义文字语言包;Optionally, the public multilingual package includes a public component language package and a common text language package, and the custom multilingual package includes a custom component language package and a custom text language package;
所述使用所述语言包将所述页面中显示的内容切换为所述目标语言的内容,包括:The use of the language pack to switch the content displayed on the page to the content of the target language includes:
使用所述公共文字语言包和所述自定义文字语言包,将所述页面中显示的公共文字和自定义文字使用所述目标语言进行显示;以及using the common text language pack and the custom text language pack to display the public text and custom text displayed on the page in the target language; and
使用所述公共组件语言包和所述自定义组件语言包,将所述页面中显示的公共组件和自定义组件使用所述目标语言进行显示。Using the public component language pack and the custom component language pack, the public components and custom components displayed on the page are displayed in the target language.
可选的,所述公共多语言包还包括公共方法语言包,所述方法还包括:Optionally, the public multilingual package also includes a public method language package, and the method also includes:
使用所述公共方法语言包,将所述页面中公共方法的调用结果切换为所述目标语言表示,以在收到对公共方法的调用请求时,显示使用所述目标语言表示的调用结果。Using the public method language package, switching the call result of the public method in the page to the target language expression, so that when a call request for the public method is received, the call result expressed in the target language is displayed.
可选的,所述自定义多语言包还包括自定义方法语言包,所述方法还包括:Optionally, the custom multilingual package also includes a custom method language package, and the method also includes:
使用所述自定义方法语言包,将所述页面中自定义方法的调用结果切换为所述目标语言表示,以在收到对自定义方法的调用请求时,显示使用所述目标语言表示的调用结果。Use the custom method language pack to switch the call result of the custom method on the page to the target language, so that when a call request for the custom method is received, display the call in the target language result.
可选的,在所述接收用户对页面的访问操作之后,还包括:查询对所述页面设置的基础语言标志,将与所述基础语言标志对应的基础语言设置为当前语言;Optionally, after receiving the user's access operation to the page, the method further includes: querying the basic language flag set for the page, and setting the basic language corresponding to the basic language flag as the current language;
所述使用所述目标语言包将所述页面中显示的内容切换为所述目标语言的内容,包括:使用所述目标语言包,将所述页面中显示的所述基础语言的内容切换为所述目标语言的内容。The using the target language pack to switch the content displayed on the page to the target language content includes: using the target language pack to switch the content displayed on the page to the base language content Describe the content in the target language.
可选的,所述接收用户对页面的访问操作,查询对所述页面设置的基础语言标志,包括:Optionally, the receiving user's access operation to the page, and querying the basic language flag set on the page include:
接收用户对线下机构页面的访问操作,确定所述线下机构所属机构集群,查询对所述机构集群配置的基础语言标志;或Receive the user's access operation to the page of the offline institution, determine the institution cluster to which the offline institution belongs, and query the basic language flag configured for the institution cluster; or
接收用户对线上应用页面的访问操作,定位用户当前所处位置,确定所述位置所处区域,查询预先对所述区域配置的基础语言标志。Receive the user's access operation on the online application page, locate the current location of the user, determine the area where the location is located, and query the basic language flag configured in advance for the area.
为实现上述目的,根据本发明实施例的另一方面,提供了一种页面语言切换装置,包括:To achieve the above purpose, according to another aspect of the embodiments of the present invention, a page language switching device is provided, including:
加载绑定模块,用于接收用户对页面的访问操作,加载与所述页面对应的多语言包,响应于加载所述多语言包成功,执行绑定语言切换事件操作;Loading a binding module for receiving a user's access operation to a page, loading a multilingual package corresponding to the page, and executing a binding language switching event operation in response to the successful loading of the multilingual package;
设置语言模块,用于响应于收到用户对目标语言标志的选择操作,基于所述语言切换事件,将与所述目标语言标志对应的目标语言设置为当前语言;以及A language setting module, configured to set the target language corresponding to the target language flag as the current language based on the language switching event in response to receiving a user's selection operation on the target language flag; and
语言切换模块,用于从所述多语言包中确定与所述目标语言标志对应的目标语言包,使用所述目标语言包将所述页面中显示的内容切换为所述目标语言的内容。A language switching module, configured to determine a target language package corresponding to the target language flag from the multi-language packages, and use the target language package to switch the content displayed on the page to the content in the target language.
可选的,所述加载绑定模块,用于:Optionally, the loading binding module is used for:
从所述页面的配置文件中查询所述多语言包的路径信息;Querying the path information of the multilingual package from the configuration file of the page;
响应于在本地缓存中查找存在所述多语言包,确定本次非首次访问所述页面,从本地缓存中加载所述多语言包;或In response to finding the multilingual package in the local cache, it is determined that this is not the first visit to the page, and the multilingual package is loaded from the local cache; or
响应于在本地缓存中查找不存在所述多语言包,确定本次为首次访问所述页面,从服务器下载所述多语言包并存入本地缓存中。In response to finding that the multilingual package does not exist in the local cache, it is determined that this is the first visit to the page, and the multilingual package is downloaded from the server and stored in the local cache.
可选的,所述多语言包包括公共多语言包、与所述页面对应的自定义多语言包,所述路径信息包括与所述公共多语言包对应的路径信息、与所述自定义多语言包对应的路径信息。Optionally, the multilingual package includes a public multilingual package, a custom multilingual package corresponding to the page, and the path information includes path information corresponding to the public multilingual package, a The path information corresponding to the language pack.
可选的,公共多语言包包括公共组件语言包和公共文字语言包,自定义多语言包包括自定义组件语言包和自定义文字语言包;Optionally, the public multilingual package includes a public component language package and a common text language package, and the custom multilingual package includes a custom component language package and a custom text language package;
所述语言切换模块,用于:The language switching module is used for:
使用所述公共文字语言包和所述自定义文字语言包,将所述页面中显示的公共文字和自定义文字使用所述目标语言进行显示;以及using the common text language pack and the custom text language pack to display the public text and custom text displayed on the page in the target language; and
使用所述公共组件语言包和所述自定义组件语言包,将所述页面中显示的公共组件和自定义组件使用所述目标语言进行显示。Using the public component language pack and the custom component language pack, the public components and custom components displayed on the page are displayed in the target language.
可选的,所述公共多语言包还包括公共方法语言包,所述语言切换模块,还用于:Optionally, the public multilingual package also includes a public method language package, and the language switching module is also used for:
使用所述公共方法语言包,将所述页面中公共装置的调用结果切换为所述目标语言表示,以在收到对公共装置的调用请求时,显示使用所述目标语言表示的调用结果。Using the public method language package, switching the invocation result of the public device in the page to the target language expression, so that when a call request for the public device is received, the invocation result expressed in the target language is displayed.
可选的,所述自定义多语言包还包括自定义方法语言包,所述语言切换模块,还用于:Optionally, the custom multilingual package also includes a custom method language package, and the language switching module is also used for:
使用所述自定义方法语言包,将所述页面中自定义装置的调用结果切换为所述目标语言表示,以在收到对自定义装置的调用请求时,显示使用所述目标语言表示的调用结果。Use the custom method language package to switch the call result of the custom device in the page to the target language, so that when a call request to the custom device is received, display the call in the target language result.
可选的,所述加载绑定模块,还用于:查询对所述页面设置的基础语言标志,将与所述基础语言标志对应的基础语言设置为当前语言;Optionally, the loading and binding module is further configured to: query the basic language flag set on the page, and set the basic language corresponding to the basic language flag as the current language;
所述语言切换模块,用于:使用所述目标语言包,将所述页面中显示的所述基础语言的内容切换为所述目标语言的内容。The language switching module is configured to: use the target language package to switch the content in the basic language displayed on the page to the content in the target language.
可选的,所述加载绑定模块,还用于:Optionally, the loading binding module is also used for:
接收用户对线下机构页面的访问操作,确定所述线下机构所属机构集群,查询对所述机构集群配置的基础语言标志;或Receive the user's access operation to the page of the offline institution, determine the institution cluster to which the offline institution belongs, and query the basic language flag configured for the institution cluster; or
接收用户对线上应用页面的访问操作,定位用户当前所处位置,确定所述位置所处区域,查询预先对所述区域配置的基础语言标志。Receive the user's access operation on the online application page, locate the current location of the user, determine the area where the location is located, and query the basic language flag configured in advance for the area.
为实现上述目的,根据本发明实施例的再一方面,提供了一种页面语言切换电子设备。To achieve the above object, according to still another aspect of the embodiments of the present invention, an electronic device for switching page language is provided.
本发明实施例的电子设备包括:一个或多个处理器;存储装置,用于存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现上述任一所述的页面语言切换方法。The electronic equipment in the embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, so that the One or more processors implement any of the above page language switching methods.
为实现上述目的,根据本发明实施例的再一方面,提供了一种计算机可读介质,其上存储有计算机程序,所述程序被处理器执行时实现上述任一所述的页面语言切换方法。In order to achieve the above object, according to yet another aspect of the embodiments of the present invention, a computer readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, any of the above-mentioned page language switching methods is implemented .
为实现上述目的,根据本发明实施例的又一个方面,提供了一种计算程序产品。本发明实施例的一种计算程序产品,包括计算机程序,所述程序被处理器执行时实现本发明实施例提供的页面语言切换方法。To achieve the above purpose, according to still another aspect of the embodiments of the present invention, a computing program product is provided. A computing program product according to an embodiment of the present invention includes a computer program, and when the program is executed by a processor, the method for switching a page language provided by an embodiment of the present invention is implemented.
根据本发明所述提供的方案,上述发明中的一个实施例具有如下优点或有益效果:将前端应用页面的多语言部分抽离出来形成多语言包,可支持跨页面使用,设置资源缓存和预加载机制,在用户切换语言后可以直接从本地缓存中加载相应多语言包,每种语言的语言包包括文字语言包、组件语言包和方法语言包,以对页面中的文字、组件、调用方法后的调用结果进行全面语言切换,整体操作简单易上手,提升了应用页面的开发效率。According to the solution provided by the present invention, one embodiment of the above invention has the following advantages or beneficial effects: the multilingual part of the front-end application page is extracted to form a multilingual package, which can support cross-page use, set resource cache and pre-set Loading mechanism, after the user switches the language, the corresponding multi-language pack can be loaded directly from the local cache. The language pack for each language includes text language pack, component language pack and method language pack, so that the text, components, and calling methods in the page The final call result is fully switched between languages, the overall operation is simple and easy to use, and the development efficiency of the application page is improved.
上述的非惯用的可选方式所具有的进一步效果将在下文中结合具体实施方式加以说明。The further effects of the above-mentioned non-conventional alternatives will be described below in conjunction with specific embodiments.
附图说明Description of drawings
附图用于更好地理解本发明,不构成对本发明的不当限定。其中:The accompanying drawings are used to better understand the present invention, and do not constitute improper limitations to the present invention. in:
图1是根据本发明实施例的一种页面语言切换方法的主要流程示意图;FIG. 1 is a schematic flow diagram of a main flow of a page language switching method according to an embodiment of the present invention;
图2是根据本发明实施例的获取公共多语言包和与页面对应的多语言包的示意图;Fig. 2 is a schematic diagram of obtaining a public multilingual package and a multilingual package corresponding to a page according to an embodiment of the present invention;
图3是选择目标语言标志的示意图;Fig. 3 is a schematic diagram of selecting a target language flag;
图4是使用目标语言包对页面进行布局的流程示意图;Fig. 4 is a schematic flow diagram of using the target language pack to lay out the page;
图5是根据本发明实施例的一具体地页面语言切换方法的流程示意图;Fig. 5 is a schematic flow chart of a specific page language switching method according to an embodiment of the present invention;
图6是根据本发明实施例的一种页面语言切换装置的主要模块示意图;6 is a schematic diagram of main modules of a page language switching device according to an embodiment of the present invention;
图7是本发明实施例可以应用于其中的示例性系统架构图;Fig. 7 is an exemplary system architecture diagram to which the embodiment of the present invention can be applied;
图8是适于用来实现本发明实施例的移动设备或服务器的计算机系统的结构示意图。FIG. 8 is a structural diagram of a computer system suitable for implementing a mobile device or a server according to an embodiment of the present invention.
具体实施方式Detailed ways
以下结合附图对本发明的示范性实施例做出说明,其中包括本发明实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本发明的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present invention are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present invention to facilitate understanding, and they should be regarded as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
需要指出的是,在不冲突的情况下,本发明中的实施例以及实施例中的特征可以互相组合。本申请技术方案中对数据(如用户个人信息)的获取、存储、使用、处理等均符合国家法律法规的相关规定,且不违背公序良俗。It should be noted that, in the case of no conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other. The acquisition, storage, use, and processing of data (such as user personal information) in the technical solution of this application comply with the relevant provisions of national laws and regulations, and do not violate public order and good customs.
参见图1,示出的是本发明实施例提供的一种页面语言切换方法的主要流程图,包括如下步骤:Referring to FIG. 1 , it shows a main flowchart of a page language switching method provided by an embodiment of the present invention, including the following steps:
S101:接收用户对页面的访问操作,加载与所述页面对应的多语言包,响应于加载所述多语言包成功,执行绑定语言切换事件操作;S101: Receive the user's access operation to the page, load the multilingual package corresponding to the page, and execute the binding language switching event operation in response to the successful loading of the multilingual package;
S102:响应于收到用户对目标语言标志的选择操作,基于所述语言切换事件,将与所述目标语言标志对应的目标语言设置为当前语言;S102: In response to receiving the user's selection operation on the target language flag, based on the language switching event, set the target language corresponding to the target language flag as the current language;
S103:从所述多语言包中确定与所述目标语言标志对应的语言包,使用所述语言包将所述页面中显示的内容切换为所述目标语言的内容。S103: Determine a language package corresponding to the target language flag from the multilingual package, and use the language package to switch content displayed on the page to content in the target language.
上述实施方式中,随着网络设备的快速发展,前端业务需求越来越多,针对不同国家的客户需要设置不同语言页面,使得传统开发已不能满足更新频繁的前端业务需求。本方案主要针对前端应用的页面语言切换场景,如将中文切换为英文。In the above embodiments, with the rapid development of network equipment, there are more and more front-end business needs, and different language pages are set up for customers in different countries, so that traditional development cannot meet the frequently updated front-end business needs. This solution is mainly aimed at the page language switching scenario of the front-end application, such as switching Chinese to English.
对于步骤S101,本方案可适用于线下场景和线上场景,对于线下场景,例如用户前往线下机构网点,使用线下机构网点的设备访问页面,此时需要确定该线下机构所属机构集群,预先针对不同机构集群设置不同的基础语言标志(即默认语言标志),如机构集群1-基础语言标志zh(代表中文),机构集群2-基础语言标志en(代表英文)。For step S101, this solution is applicable to both offline and online scenarios. For offline scenarios, for example, a user goes to an offline institution’s outlet and uses the device of the offline institution’s outlet to access the page. At this time, it is necessary to determine the institution to which the offline institution belongs. For clusters, different basic language flags (i.e. default language flags) are set in advance for different institutional clusters, such as institutional cluster 1-basic language flag zh (represents Chinese), and institutional cluster 2-basic language flag en (represents English).
对于线上场景,例如用户使用电脑、手机等终端登陆线上应用,如电子银行,根据终端IP(Internet Protocol,网际互连协议)地址或自带GPS(Global PositioningSystem,全球定位系统)确定用户当前所处位置,如位置a,为简化后续计算量,可以先确定该位置所处区域,如位置a-地区A,同样可以预先针对不同地区设置不同的基础语言标志,如地区A-基础语言标志zh,地区B-基础语言标志en。For online scenarios, for example, users use computers, mobile phones and other terminals to log in to online applications, such as e-banking, and determine the user's current The location, such as location a, in order to simplify subsequent calculations, you can first determine the area where the location is located, such as location a-region A, and you can also set different basic language flags for different regions in advance, such as region A-basic language flag zh, region B-base language flag en.
设备响应于用户访问页面操作,首先查找该页面的基础语言标志,将与该基础语言标志对应的语言设置为当前语言,如在查找到基础语言标志zh后,将中文设置为当前语言,即默认语言。In response to the operation of the user accessing the page, the device first searches for the basic language flag of the page, and sets the language corresponding to the basic language flag as the current language. For example, after finding the basic language flag zh, set Chinese as the current language, which is the default language.
应用中可能设置多个页面,这些页面存在公共之处和不同之处,因此多语言开发人员需要针对该应用的页面设置公共多语言包,并针对每个页面设置自定义多语言包,并将公共多语言包的存储路径信息和自定义多语言包的存储路径信息,分别存入每个页面的配置文件中。例如,页面X的配置文件中包括公共多语言包的存储路径信息Y和其自定义多语言包的存储路径信息Z。多语言包是不同语言翻译后的文本文件,如将同一段话翻译为汉语、英语、韩语、泰语、日语、德语、法语等语种的文本文件。Multiple pages may be set in an application, and these pages have common and different features, so multilingual developers need to set a common multilingual package for the pages of the application, and set a custom multilingual package for each page, and set The storage path information of the public multilingual package and the storage path information of the custom multilingual package are respectively stored in the configuration file of each page. For example, the configuration file of page X includes storage path information Y of the public multilingual package and storage path information Z of its custom multilingual package. Multilingual packs are text files translated into different languages, such as translating the same paragraph into text files in Chinese, English, Korean, Thai, Japanese, German, French, etc.
在监测到用户对该页面具有访问操作后,需要从页面的配置文件中查找公共多语言包的存储路径信息和自定义多语言包的存储路径信息,之后先在应用本地缓存中查找是否存在相应多语言包,参见图2所示:After detecting that the user has access to the page, it is necessary to find the storage path information of the public multilingual package and the storage path information of the custom multilingual package from the configuration file of the page, and then check whether there is a corresponding one in the local cache of the application. Multilingual package, see Figure 2:
1)应用首次使用,因而本地缓存中既不存在公共多语言包,也不存在与该页面对应的自定义多语言包,需要从服务器分别下载公共多语言包和与该页面对应的自定义多语言包,之后写入本地缓存中便于后续访问直接使用。1) The application is used for the first time, so neither the public multilingual package nor the custom multilingual package corresponding to the page exists in the local cache, and the public multilingual package and the custom multilingual package corresponding to the page need to be downloaded separately from the server. The language pack is then written into the local cache for direct use in subsequent visits.
2)应用非首次使用,但该页面为首次访问,因而本地缓存中存在公共多语言包(暂不考虑清理情况),但不存在该页面对应的自定义多语言包,需要从服务器下载与该页面对应的自定义多语言包,之后写入本地缓存中便于后续访问直接使用。因而此种情况是从本地缓存获取公共多语言包,从服务器获取与该页面对应的自定义多语言包。2) The application is not used for the first time, but this page is accessed for the first time, so there is a public multilingual package in the local cache (not considering the cleaning situation), but there is no custom multilingual package corresponding to this page, which needs to be downloaded from the server. The custom multilingual package corresponding to the page is then written into the local cache for direct use in subsequent visits. Therefore, in this case, the public multilingual package is obtained from the local cache, and the custom multilingual package corresponding to the page is obtained from the server.
3)应用非首次使用,该页面非首次访问,因而本地缓存中既存在公共多语言包,也存在与该页面对应的自定义多语言包,直接从本地缓存中获取这两个多语言包即可。3) The application is not used for the first time, and this page is not accessed for the first time, so there are both public multilingual packages and custom multilingual packages corresponding to this page in the local cache, and these two multilingual packages are obtained directly from the local cache. Can.
需要说明的是,公共多语言包中的语言种类通常大于自定义多语言包中的语言种类。例如,电子银行的页面中可以布局汉语、英语、韩语、泰语、日语、德语、法语等语种,因而公共多语言包中包括汉语、英语、韩语、泰语、日语、德语、法语等语种的语言包。由于不同语种地区页面使用习惯及监管要求等,电子银行的部分功能会对某些地区不开放,因而有些页面无需设置这些地区的语种,例如,页面1仅显示汉语、英语、韩语、泰语、日语,因而其自定义多语言包中仅包括汉语、英语、韩语、泰语、日语的语言包。假设用户访问的是页面1,最终获取的是:包括汉语、英语、韩语、泰语、日语、德语、法语等语种的公共语言包,以及包括汉语、英语、韩语、泰语、日语的自定义语言包,用户仅可以切换汉语、英语、韩语、泰语、日语这几种语言。It should be noted that the language types in the public multilingual package are usually larger than those in the custom multilingual package. For example, Chinese, English, Korean, Thai, Japanese, German, French and other languages can be laid out on the e-banking page, so the public multilingual package includes language packages of Chinese, English, Korean, Thai, Japanese, German, French and other languages . Due to the usage habits and regulatory requirements of pages in different language regions, some functions of electronic banking are not available in some regions, so some pages do not need to be set in the languages of these regions. For example, page 1 only displays Chinese, English, Korean, Thai, and Japanese , so its custom multi-language pack only includes Chinese, English, Korean, Thai, and Japanese language packs. Assuming that the user visits page 1, what is finally obtained is: public language packs including Chinese, English, Korean, Thai, Japanese, German, French, etc., and custom language packs including Chinese, English, Korean, Thai, and Japanese , the user can only switch between Chinese, English, Korean, Thai, and Japanese.
通过上述方式,可以缓存公共多语言包、页面首次访问时从服务器下载的和自定义多语言包,后续访问时无需再从服务器获取,直接请求本地缓存即可获得,减少网络请求带来的负担,以此在用户切换语言后加快页面语言切换速度。Through the above method, you can cache the public multilingual package, downloaded from the server when the page is accessed for the first time, and the custom multilingual package. You do not need to obtain it from the server for subsequent visits, and you can directly request the local cache to obtain it, reducing the burden caused by network requests. , so as to speed up the page language switching speed after the user switches languages.
对于步骤S102和S103,只有在成功加载公共多语言包和与页面对应的自定义多语言包后,才执行绑定语言切换事件操作。页面可支持的语言可以以列表形式进行展示,参见图3所示,用户点击语言标志栏,下拉显示该页面可支持的所有语言标志。如上述汉语、英语、韩语、泰语、日语,用户可选择非基础语言标志外的任一语言标志为待切换的目标语言标志,如基础语言标志为zh,用户选择en为目标语言标志,语言切换事件首先将英文设置为当前语言。For steps S102 and S103, only after the public multilingual package and the custom multilingual package corresponding to the page are successfully loaded, the language switching event operation is executed. The languages supported by the page can be displayed in the form of a list, as shown in Figure 3, the user clicks on the language flag bar, and all the language flags supported by the page are displayed in the drop-down list. For example, Chinese, English, Korean, Thai, and Japanese mentioned above, the user can select any language flag other than the basic language flag as the target language flag to be switched, such as the basic language flag is zh, the user selects en as the target language flag, and the language is switched The event first sets English as the current language.
语言标志是查找语言包的关键,只有在监测到当前语言切换完成后,语言切换事件才从前述获取到的公共多语言包和自定义多语言包中,确定与目标语言标志对应的语言包,如确定与英文对应的公共语言包和自定义语言包,以基于确定的公共语言包和自定义语言包对该页面进行布局。The language flag is the key to finding the language pack. Only after the current language switch is detected, the language switch event will determine the language pack corresponding to the target language flag from the public multi-language pack and custom multi-language pack obtained above. For example, the public language pack and custom language pack corresponding to English are determined, and the page is laid out based on the determined public language pack and custom language pack.
本方案中的多语言包主要分两类:文字多语言包、组件多语言包,公共语言包还可以设置公共方法多语言包,自定义语言包也可以设置自定义方法多语言包,但通常主要使用公共方法多语言包。假设基础语言标志为zh,目标语言标志为en,此处对页面布局进行具体解释,具体参见图4所示:The multilingual packs in this solution are mainly divided into two categories: text multilingual packs, component multilingual packs, public language packs can also set public method multilingual packs, custom language packs can also set custom method multilingual packs, but usually Mainly use the public method multilingual package. Assuming that the basic language flag is zh and the target language flag is en, here is a detailed explanation of the page layout, as shown in Figure 4:
1、使用与英文对应的公共文字语言包,将页面由中文显示的公共文字内容,切换为由英文显示的公共文字内容,例如,将“XX银行”切换为“XX bank”。1. Use the public text language package corresponding to English to switch the public text content displayed on the page from Chinese to English. For example, switch "XX bank" to "XX bank".
使用与英文对应的公共组件语言包,将页面中由中文显示的公共组件,切换为由英文显示的公共组件,此处的组件主要是UI(User Interface,用户界面)组件,例如,将“姓名+输入框”切换为“Name+输入框”。Use the public component language pack corresponding to English to switch the public components displayed in Chinese on the page to the public components displayed in English. The components here are mainly UI (User Interface, user interface) components. For example, the "Name +Input Box" is switched to "Name+Input Box".
2、使用与英文对应的自定义文字语言包,将页面中由中文显示的自定义文字内容,切换为由英文显示的自定义文字内容,例如,将“今天天气很好”切换为“It's a niceday”。2. Use the custom text language package corresponding to English to switch the custom text content displayed in Chinese on the page to the custom text content displayed in English. For example, switch "The weather is good today" to "It's a niceday".
使用与英文对应的自定义组件语言包,将页面中由中文显示的自定义组件,切换为由英文显示的自定义组件,此处的组件同样主要是UI组件,例如,将“注册组件”中显示的“注册”切换为“register”。Use the custom component language pack corresponding to English to switch the custom component displayed in Chinese on the page to the custom component displayed in English. The components here are also mainly UI components. For example, the "register component" in The displayed "registration" switches to "register".
3、另外还支持对公共方法的调用,例如用户发起公共交易以请求后端数据时,页面会弹出提示框“加载中”,使用与英文对应的公共方法语言包,将“加载中”切换为“loading”。对于请求结果,如失败提示,会切换为“error”,如成功提示,则会切换为“success”。但若出现异常,则会由“警告”切换为“warning”。3. It also supports calls to public methods. For example, when a user initiates a public transaction to request back-end data, a prompt box "Loading" will pop up on the page. Use the language pack of the public method corresponding to English, and switch "Loading" to "loading". For the request result, if it fails, it will switch to "error", and if it succeeds, it will switch to "success". However, if an exception occurs, it will be switched from "warning" to "warning".
4、目前较常用的是公共方法,这针对与应用中的页面普遍适用,但若某一页面的功能较多时,其附加有公共方法所不能覆盖的功能时,需要自定义方法,例如将“确认退出”切换为“Are you sure to quit?”。4. At present, the public method is more commonly used, which is generally applicable to the pages in the application. However, if a certain page has many functions and has additional functions that cannot be covered by the public method, a custom method is required. For example, " Confirm to quit" switches to "Are you sure to quit?".
上述实施例提供的方法相对于现有技术,至少存在如下有益效果:Compared with the prior art, the methods provided by the above embodiments have at least the following beneficial effects:
1、将前端应用页面的多语言部分抽离出来,形成多语言包,包括公共部分和自定义部分,且公共部分可跨页面使用,省去了开发人员针对页面使用不同语言开发的工作量,避免重复开发情况,缩短了应用产品和服务的开发时间,以此提升开发效率。1. Extract the multilingual part of the front-end application page to form a multilingual package, including the public part and the custom part, and the public part can be used across pages, which saves developers the workload of using different languages for the page development. Avoid repeated development, shorten the development time of application products and services, and improve development efficiency.
2、设置资源缓存和预加载机制,应用和页面初次访问时会下载多语言包并缓存到本地,后续访问时直接使用本地缓存中的多语言包,减少网络请求带来的负担,在用户切换语言后,也能加快页面渲染速度和响应速度,给用户带来更好的体验。2. Set up resource caching and preloading mechanisms. When applications and pages are accessed for the first time, multilingual packages will be downloaded and cached locally. Subsequent visits will directly use the multilingual packages in the local cache, reducing the burden of network requests. After language, it can also speed up the page rendering speed and response speed, and bring a better experience to users.
3、支持动态切换显示的语言,每种语言的语言包包括文字语言包、组件语言包和方法语言包,以对页面中的文字、组件、调用方法后的调用结果进行全面语言切换。3. Supports dynamic switching of displayed languages. Language packs for each language include text language packs, component language packs, and method language packs, so as to perform comprehensive language switching for text, components, and call results after calling methods on the page.
参见图5,示出了根据本发明实施例的一具体地页面语言切换方法流程示意图,包括如下步骤:Referring to FIG. 5 , it shows a schematic flow chart of a specific page language switching method according to an embodiment of the present invention, including the following steps:
S501:接收用户对页面的访问操作,查询对所述页面设置的基础语言标志,将与所述基础语言标志对应的基础语言设置为当前语言;S501: Receive the user's access operation to the page, query the basic language flag set on the page, and set the basic language corresponding to the basic language flag as the current language;
S502:从所述页面的配置文件中查询多语言包的路径信息;S502: Query the path information of the multilingual package from the configuration file of the page;
S503:响应于在本地缓存中查找存在所述多语言包,确定本次非首次访问所述页面,从本地缓存中加载所述多语言包;S503: In response to finding the multilingual package in the local cache, it is determined that the page is not accessed for the first time this time, and the multilingual package is loaded from the local cache;
S504:响应于在本地缓存中查找不存在所述多语言包,确定本次为首次访问所述页面,从服务器下载所述多语言包并存入本地缓存中;S504: In response to finding that the multilingual package does not exist in the local cache, determine that this is the first visit to the page, download the multilingual package from the server and store it in the local cache;
S505:响应于加载所述多语言包成功,执行绑定语言切换事件操作;S505: In response to the successful loading of the multi-language package, perform an event binding language switching operation;
S506:响应于收到用户对目标语言标志的选择操作,基于所述语言切换事件,将与所述目标语言标志对应的目标语言设置为当前语言;S506: In response to receiving the user's selection operation on the target language flag, based on the language switching event, set the target language corresponding to the target language flag as the current language;
S507:从所述多语言包中确定与所述目标语言标志对应的目标语言包,使用所述目标语言包,将所述页面中显示的所述基础语言的内容切换为所述目标语言的内容。S507: Determine a target language package corresponding to the target language flag from the multilingual package, and use the target language package to switch the content in the basic language displayed on the page to the content in the target language .
本方案可以基于vue-i18n框架、多语言npm库等实现。vue-i18n,i18n是“国际化”的简称,对程序来说,是指在不修改内部代码的情况下,能根据不同语言及地区显示相应的界面,在全球化的时代国际化尤为重要,因为产品的潜在用户可能来自世界的各个角落,vue-i18n是Vue.js使用的国际化插件库,支持在Vue.js里使用多语言。通过在应用、页面初始化时将其多语言包加载到本地,与框架本身的组件、交易(如公共方法)等多语言包合并,并根据用户选择的目标语言标志设置当前语言,最终经过vue-i18n编译后页面显示对应语言的界面。This solution can be implemented based on the vue-i18n framework, multilingual npm library, etc. vue-i18n, i18n is the abbreviation of "internationalization". For programs, it means that the corresponding interface can be displayed according to different languages and regions without modifying the internal code. Internationalization is especially important in the era of globalization. Because the potential users of the product may come from all corners of the world, vue-i18n is an international plugin library used by Vue.js, which supports the use of multiple languages in Vue.js. By loading its multilingual package locally when the application and page are initialized, merging with the framework's own components, transactions (such as public methods) and other multilingual packages, and setting the current language according to the target language flag selected by the user, and finally through vue- After i18n compilation, the page displays the corresponding language interface.
参见图6,示出了本发明实施例提供的一种页面语言切换装置600的主要模块示意图,包括:Referring to FIG. 6 , it shows a schematic diagram of main modules of a page
加载绑定模块601,用于接收用户对页面的访问操作,加载与所述页面对应的多语言包,响应于加载所述多语言包成功,执行绑定语言切换事件操作;The loading and
具体地:specifically:
从所述页面的配置文件中查询所述多语言包的路径信息;Querying the path information of the multilingual package from the configuration file of the page;
响应于在本地缓存中查找存在所述多语言包,确定本次非首次访问所述页面,从本地缓存中加载所述多语言包;或In response to finding the multilingual package in the local cache, it is determined that the page is not accessed for the first time, and the multilingual package is loaded from the local cache; or
响应于在本地缓存中查找不存在所述多语言包,确定本次为首次访问所述页面,从服务器下载所述多语言包并存入本地缓存中。In response to finding that the multilingual package does not exist in the local cache, it is determined that this is the first visit to the page, and the multilingual package is downloaded from the server and stored in the local cache.
设置语言模块602,用于响应于收到用户对目标语言标志的选择操作,基于所述语言切换事件,将与所述目标语言标志对应的目标语言设置为当前语言;以及The
语言切换模块603,用于从所述多语言包中确定与所述目标语言标志对应的目标语言包,使用所述目标语言包将所述页面中显示的内容切换为所述目标语言的内容。The
本发明实施装置中,所述多语言包包括公共多语言包、与所述页面对应的自定义多语言包,所述路径信息包括与所述公共多语言包对应的路径信息、与所述自定义多语言包对应的路径信息。In the implementation device of the present invention, the multilingual package includes a public multilingual package, a custom multilingual package corresponding to the page, and the path information includes the path information corresponding to the public multilingual package, and the self-defined Define the path information corresponding to the multilingual package.
本发明实施装置中,公共多语言包包括公共组件语言包和公共文字语言包,自定义多语言包包括自定义组件语言包和自定义文字语言包;In the implementation device of the present invention, the public multilingual package includes a public component language package and a common text language package, and the self-defined multilingual package includes a self-defined component language package and a self-defined text language package;
所述语言切换模块603,用于:The
使用所述公共文字语言包和所述自定义文字语言包,将所述页面中显示的公共文字和自定义文字使用所述目标语言进行显示;以及using the common text language pack and the custom text language pack to display the public text and custom text displayed on the page in the target language; and
使用所述公共组件语言包和所述自定义组件语言包,将所述页面中显示的公共组件和自定义组件使用所述目标语言进行显示。Using the public component language pack and the custom component language pack, the public components and custom components displayed on the page are displayed in the target language.
本发明实施装置中,所述公共多语言包还包括公共方法语言包,所述语言切换模块603,还用于:In the implementation device of the present invention, the public multilingual package also includes a public method language package, and the
使用所述公共方法语言包,将所述页面中公共装置的调用结果切换为所述目标语言表示,以在收到对公共装置的调用请求时,显示使用所述目标语言表示的调用结果。Using the public method language package, switching the invocation result of the public device in the page to the target language expression, so that when a call request for the public device is received, the invocation result expressed in the target language is displayed.
本发明实施装置中,所述自定义多语言包还包括自定义方法语言包,所述语言切换模块603,还用于:In the implementation device of the present invention, the self-defined multilingual package also includes a self-defined method language package, and the
使用所述自定义方法语言包,将所述页面中自定义装置的调用结果切换为所述目标语言表示,以在收到对自定义装置的调用请求时,显示使用所述目标语言表示的调用结果。Use the custom method language package to switch the call result of the custom device in the page to the target language, so that when a call request to the custom device is received, display the call in the target language result.
本发明实施装置中,所述加载绑定模块601,还用于:查询对所述页面设置的基础语言标志,将与所述基础语言标志对应的基础语言设置为当前语言;In the implementation device of the present invention, the loading and
所述语言切换模块,用于603:使用所述目标语言包,将所述页面中显示的所述基础语言的内容切换为所述目标语言的内容。The language switching module is configured to 603: use the target language package to switch the content in the basic language displayed on the page to the content in the target language.
本发明实施装置中,所述加载绑定模块601,还用于:In the implementation device of the present invention, the loading and
接收用户对线下机构页面的访问操作,确定所述线下机构所属机构集群,查询对所述机构集群配置的基础语言标志;或Receive the user's access operation to the page of the offline institution, determine the institution cluster to which the offline institution belongs, and query the basic language flag configured for the institution cluster; or
接收用户对线上应用页面的访问操作,定位用户当前所处位置,确定所述位置所处区域,查询预先对所述区域配置的基础语言标志。Receive the user's access operation on the online application page, locate the current location of the user, determine the area where the location is located, and query the basic language flag configured in advance for the area.
另外,在本发明实施例中所述装置的具体实施内容,在上面所述方法中已经详细说明了,故在此重复内容不再说明。In addition, the specific implementation content of the device in the embodiment of the present invention has been described in detail in the above method, so the repeated content will not be described here.
图7示出了可以应用本发明实施例的示例性系统架构700,包括终端设备701、702、703,网络704和服务器705(仅仅是示例)。Fig. 7 shows an
终端设备701、702、703可以是具有显示屏并且支持网页浏览的各种电子设备,安装有各种通讯客户端应用,用户可以使用终端设备701、702、703通过网络704与服务器705交互,以接收或发送消息等。The
网络704用以在终端设备701、702、703和服务器705之间提供通信链路的介质。网络704可以包括各种连接类型。The
服务器705可以是提供各种服务的服务器,需要说明的是,本发明实施例所提供的方法一般由服务器705执行,相应地,装置一般设置于服务器705中。The
应该理解,图7中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the numbers of terminal devices, networks and servers in FIG. 7 are only illustrative. According to the implementation needs, there can be any number of terminal devices, networks and servers.
下面参考图8,其示出了适于用来实现本发明实施例的终端设备的计算机系统800的结构示意图。图8示出的终端设备仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。Referring now to FIG. 8 , it shows a schematic structural diagram of a
如图8所示,计算机系统800包括中央处理单元(CPU)801,其可以根据存储在只读存储器(ROM)802中的程序或者从存储部分808加载到随机访问存储器(RAM)803中的程序而执行各种适当的动作和处理。在RAM 803中,还存储有系统800操作所需的各种程序和数据。CPU 801、ROM 802以及RAM 803通过总线804彼此相连。输入/输出(I/O)接口805也连接至总线804。As shown in FIG. 8 , a
以下部件连接至I/O接口805:包括键盘、鼠标等的输入部分806;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分807;包括硬盘等的存储部分808;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分809。通信部分809经由诸如因特网的网络执行通信处理。驱动器810也根据需要连接至I/O接口805。可拆卸介质811,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器810上,以便于从其上读出的计算机程序根据需要被安装入存储部分808。The following components are connected to the I/O interface 805: an
特别地,根据本发明公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本发明公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分809从网络上被下载和安装,和/或从可拆卸介质811被安装。在该计算机程序被中央处理单元(CPU)801执行时,执行本发明的系统中限定的上述功能。In particular, according to the disclosed embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the disclosed embodiments of the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via
需要说明的是,本发明所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本发明中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本发明中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. A computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, in which computer-readable program codes are carried. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. . Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
附图中的流程图和框图,图示了按照本发明各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that includes one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block in the block diagrams or flowchart illustrations, and combinations of blocks in the block diagrams or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a A combination of dedicated hardware and computer instructions.
描述于本发明实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的模块也可以设置在处理器中,例如,可以描述为:一种处理器包括加载绑定模块、设置语言模块、语言切换模块。其中,这些模块的名称在某种情况下并不构成对该模块本身的限定,例如,设置语言模块还可以被描述为“设置当前语言模块”。The modules involved in the embodiments described in the present invention may be realized by software or by hardware. The described modules can also be set in the processor, for example, it can be described as: a processor includes a loading and binding module, a language setting module, and a language switching module. Wherein, the names of these modules do not constitute a limitation on the module itself under certain circumstances, for example, setting the language module may also be described as "setting the current language module".
作为另一方面,本发明还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的设备中所包含的;也可以是单独存在,而未装配入该设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个该设备执行时,使得该设备执行上述任一所述的页面语言切换方法。As another aspect, the present invention also provides a computer-readable medium. The computer-readable medium may be contained in the device described in the above embodiments, or it may exist independently without being assembled into the device. The above-mentioned computer-readable medium carries one or more programs, and when the one or more programs are executed by one device, the device is made to execute any one of the above-mentioned page language switching methods.
本发明的计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现本发明实施例中的页面语言切换方法。The computer program product of the present invention includes a computer program, and when the computer program is executed by a processor, the page language switching method in the embodiment of the present invention is implemented.
上述具体实施方式,并不构成对本发明保护范围的限制。本领域技术人员应该明白的是,取决于设计要求和其他因素,可以发生各种各样的修改、组合、子组合和替代。任何在本发明的精神和原则之内所作的修改、等同替换和改进等,均应包含在本发明保护范围之内。The above specific implementation methods do not constitute a limitation to the protection scope of the present invention. It should be apparent to those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims (19)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210957572.3A CN115373783A (en) | 2022-08-10 | 2022-08-10 | Page language switching method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210957572.3A CN115373783A (en) | 2022-08-10 | 2022-08-10 | Page language switching method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115373783A true CN115373783A (en) | 2022-11-22 |
Family
ID=84066281
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210957572.3A Pending CN115373783A (en) | 2022-08-10 | 2022-08-10 | Page language switching method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115373783A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115858985A (en) * | 2023-01-29 | 2023-03-28 | 北京易思汇商务服务有限公司 | Method for establishing multi-language environment and switching languages on same website |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105867920A (en) * | 2016-03-29 | 2016-08-17 | 海尔优家智能科技(北京)有限公司 | APP multi-language switching method and system |
CN105956485A (en) * | 2016-04-26 | 2016-09-21 | 深圳Tcl数字技术有限公司 | Internationalized language management method and system |
CN110457085A (en) * | 2019-07-10 | 2019-11-15 | 北京奇艺世纪科技有限公司 | Document handling method, device, terminal device and computer-readable medium |
CN111857903A (en) * | 2020-04-22 | 2020-10-30 | 北京嘀嘀无限科技发展有限公司 | Display page processing method, device, equipment and storage medium |
-
2022
- 2022-08-10 CN CN202210957572.3A patent/CN115373783A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105867920A (en) * | 2016-03-29 | 2016-08-17 | 海尔优家智能科技(北京)有限公司 | APP multi-language switching method and system |
CN105956485A (en) * | 2016-04-26 | 2016-09-21 | 深圳Tcl数字技术有限公司 | Internationalized language management method and system |
CN110457085A (en) * | 2019-07-10 | 2019-11-15 | 北京奇艺世纪科技有限公司 | Document handling method, device, terminal device and computer-readable medium |
CN111857903A (en) * | 2020-04-22 | 2020-10-30 | 北京嘀嘀无限科技发展有限公司 | Display page processing method, device, equipment and storage medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115858985A (en) * | 2023-01-29 | 2023-03-28 | 北京易思汇商务服务有限公司 | Method for establishing multi-language environment and switching languages on same website |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11461111B2 (en) | Method for running applets, and electronic device | |
US12282762B2 (en) | System and methods for integration of an application runtime environment into a user computing environment | |
US10810563B1 (en) | Payments portal | |
US10152660B2 (en) | Smart card read/write method and apparatus | |
US9448977B2 (en) | Website blueprint generation and display algorithms to reduce perceived web-page loading time | |
US20140365861A1 (en) | Prefetching binary data for use by a browser plugin | |
US20130031512A1 (en) | Method and system for providing web content on a mobile device | |
CN105138313A (en) | Client application and web page integration | |
CN111767053A (en) | A kind of front-end page data acquisition method and device | |
CN112507259A (en) | Webpage loading method and device, electronic equipment and storage medium | |
CN115373783A (en) | Page language switching method and device | |
CN116561013B (en) | Test methods, devices, electronic equipment and media based on the target service framework | |
CN112835671A (en) | Application page scene switching method, device and device | |
CN102184112B (en) | Method and device for upgrading widget | |
CN113761415B (en) | Page display method and device | |
KR20080027293A (en) | Management of multiple languages in the data language | |
CN108268298A (en) | Desktop icon generation method and device, storage medium and electronic equipment | |
EP2685390A1 (en) | A method for sending user data via a cellular digital telecommunication network and terminal | |
US10558487B2 (en) | Dynamic customization of client behavior | |
CN108255918B (en) | Method for acquiring pre-reading keyword set, webpage access equipment and electronic equipment | |
CN118535824A (en) | Web page switching method, device, electronic device and readable storage medium | |
WO2018201365A1 (en) | Web page access method, and terminal device | |
CN119741139A (en) | Business function interaction method, device, equipment and product of financial and taxation system | |
CN118689534A (en) | A cross-platform migration method for application software, storage medium and electronic device | |
HK1246885A1 (en) | Page component dynamic layout method and apparatus, and client |
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 |