Movatterモバイル変換


[0]ホーム

URL:


CN105824633A - Multi-language resource switching method and device of application program - Google Patents

Multi-language resource switching method and device of application program
Download PDF

Info

Publication number
CN105824633A
CN105824633ACN201610151251.9ACN201610151251ACN105824633ACN 105824633 ACN105824633 ACN 105824633ACN 201610151251 ACN201610151251 ACN 201610151251ACN 105824633 ACN105824633 ACN 105824633A
Authority
CN
China
Prior art keywords
server
resource
language
current
content
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610151251.9A
Other languages
Chinese (zh)
Inventor
贺向阳
李伟
金帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co LtdfiledCriticalBeijing Xiaomi Mobile Software Co Ltd
Priority to CN201610151251.9ApriorityCriticalpatent/CN105824633A/en
Publication of CN105824633ApublicationCriticalpatent/CN105824633A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本公开是关于一种应用程序的多语言资源切换方法及装置,其中,应用程序的多语言资源切换方法包括:在当前应用程序启动时,检测当前移动终端采用的语言;若当前移动终端采用的语言与当前应用程序采用的默认语言不同,则向服务器请求当前移动终端采用的语言对应的资源;接收并解析服务器返回的资源;将当前应用程序的默认语言资源内容替换为解析后的资源内容。本公开实施例,不需要将语言资源整合在安装包中,减少了安装包的大小,从而降低了应用程序的下载流量,减小了应用程序的占用空间。

The present disclosure relates to a method and device for switching multilingual resources of an application program, wherein the method for switching multilingual resources of an application program includes: when the current application program starts, detecting the language used by the current mobile terminal; if the language used by the current mobile terminal If the language is different from the default language used by the current application, request the server for resources corresponding to the language used by the current mobile terminal; receive and parse the resource returned by the server; replace the default language resource content of the current application with the parsed resource content. In the embodiment of the present disclosure, it is not necessary to integrate language resources into the installation package, which reduces the size of the installation package, thereby reducing the download traffic of the application program and reducing the occupied space of the application program.

Description

Translated fromChinese
应用程序的多语言资源切换方法及装置Application program multilingual resource switching method and device

技术领域technical field

本公开涉及移动互联网技术领域,尤其涉及一种应用程序的多语言资源切换方法及装置。The present disclosure relates to the technical field of mobile Internet, and in particular to a method and device for switching multilingual resources of an application program.

背景技术Background technique

随着移动互联网的高速发展和智能终端的普及,智能终端即将成为家居生活的必需品,智能终端的个性化定制已经成为一个大趋势。跨境电商为了增加不同国籍用户的体验,很多移动应用程序都支持切换多国主题,使得不同国家的用户可以根据自己的习惯,选择适合本国的界面、图标、背景图片和字体颜色等。With the rapid development of the mobile Internet and the popularity of smart terminals, smart terminals will soon become a necessity for home life, and personalized customization of smart terminals has become a major trend. In order to increase the experience of users of different nationalities in cross-border e-commerce, many mobile applications support the switching of multi-national themes, so that users in different countries can choose the interface, icon, background picture and font color suitable for their own country according to their own habits.

目前,安卓(Android)系统智能终端可以使用单独安装包的方式实现主题切换,即每个主题是一个单独的安装包,在程序中硬编码设置每个安装包的界面元素关联图片和颜色。At present, Android (Android) system smart terminals can use a separate installation package to realize theme switching, that is, each theme is a separate installation package, and the associated pictures and colors of the interface elements of each installation package are hard-coded in the program.

但是,这种主题切换方式需要将所有的主题都放在应用程序的安装包中,增加了安装包大小,使得应用程序下载流量消耗大,占用空间多。However, this mode of theme switching requires all the themes to be placed in the installation package of the application program, which increases the size of the installation package, consumes a lot of traffic for downloading the application program, and takes up a lot of space.

发明内容Contents of the invention

为克服相关技术中存在的问题,本公开提供一种应用程序的多语言资源切换方法及装置。In order to overcome the problems existing in the related technologies, the present disclosure provides a method and device for switching multilingual resources of an application program.

根据本公开实施例的第一方面,提供一种应用程序的多语言资源切换方法,包括:According to the first aspect of the embodiments of the present disclosure, there is provided a multilingual resource switching method for an application, including:

在当前应用程序启动时,检测当前移动终端采用的语言;When the current application starts, detect the language used by the current mobile terminal;

若所述当前移动终端采用的语言与所述当前应用程序采用的默认语言不同,则向服务器请求当前移动终端采用的语言对应的资源;If the language used by the current mobile terminal is different from the default language used by the current application program, requesting resources corresponding to the language used by the current mobile terminal from the server;

接收并解析所述服务器返回的资源;receiving and parsing the resource returned by the server;

将所述当前应用程序的默认语言资源内容替换为解析后的资源内容。The default language resource content of the current application is replaced with the parsed resource content.

在一实施例中,所述方法还包括:In one embodiment, the method also includes:

在所述向服务器请求当前移动终端采用的语言对应的资源之后,若未接收到所述服务器返回的资源,则记录向服务器请求所述资源的次数;After the request to the server for resources corresponding to the language currently used by the mobile terminal, if the resource returned by the server is not received, record the number of times the resource is requested from the server;

若所述次数达到预设次数,则停止向服务器请求所述资源;If the number of times reaches a preset number of times, stop requesting the resource from the server;

若所述次数未达到所述预设次数,则重新执行向服务器请求当前移动终端采用的语言对应的资源。If the number of times does not reach the preset number of times, re-requesting resources corresponding to the language currently used by the mobile terminal from the server.

在一实施例中,所述方法还包括:In one embodiment, the method also includes:

根据所述解析后的资源内容动态引用当前移动终端的系统资源。The system resource of the current mobile terminal is dynamically referenced according to the resolved resource content.

在一实施例中,所述方法还包括:In one embodiment, the method also includes:

若获知所述服务器中存在当前语言资源的更新内容,则从所述服务器获取所述更新内容,并在下次启动时加载所述更新内容。If it is known that the update content of the current language resource exists in the server, the update content is obtained from the server, and the update content is loaded at the next startup.

在一实施例中,所述若获知所述服务器中存在当前语言资源的更新内容,则从所述服务器获取所述更新内容,包括:In one embodiment, if it is known that there is an updated content of the current language resource in the server, obtaining the updated content from the server includes:

向所述服务器发送更新检测请求,以检测所述服务器中是否存在当前语言资源的更新内容,若存在所述更新内容,则从所述服务器获取所述更新内容;和/或Send an update detection request to the server to detect whether there is an update content of the current language resource in the server, and if there is the update content, obtain the update content from the server; and/or

接收所述服务器返回的当前语言资源的更新通知,并根据所述更新通知从所述服务器获取所述当前语言资源的更新内容。receiving an update notification of the current language resource returned by the server, and acquiring update content of the current language resource from the server according to the update notification.

根据本公开实施例的第二方面,提供一种应用程序的多语言资源切换装置,包括:According to the second aspect of the embodiments of the present disclosure, there is provided an application multilingual resource switching device, including:

检测模块,被配置为在当前应用程序启动时,检测当前移动终端采用的语言;The detection module is configured to detect the language adopted by the current mobile terminal when the current application program is started;

确定请求模块,被配置为若所述检测模块检测到所述当前移动终端采用的语言与所述当前应用程序采用的默认语言不同,则向服务器请求当前移动终端采用的语言对应的资源;The determining request module is configured to, if the detection module detects that the language used by the current mobile terminal is different from the default language used by the current application program, then request resources corresponding to the language used by the current mobile terminal from the server;

接收解析模块,被配置为接收并解析所述确定请求模块请求所述服务器返回的资源;A receiving and parsing module configured to receive and parse the resources returned by the server requested by the determining request module;

替换模块,被配置为将所述当前应用程序的默认语言资源内容替换为所述接收解析模块解析后的资源内容。A replacement module configured to replace the default language resource content of the current application with the resource content parsed by the receiving and parsing module.

在一实施例中,所述装置还包括:In one embodiment, the device also includes:

记录模块,被配置为在所述确定请求模块向服务器请求当前移动终端采用的语言对应的资源之后,若未接收到所述服务器返回的资源,则记录向服务器请求所述资源的次数;The recording module is configured to record the number of times the resource is requested from the server if the resource returned by the server is not received after the determining request module requests the server for resources corresponding to the language currently used by the mobile terminal;

第一确定处理模块,被配置为若所述记录模块记录的所述次数达到预设次数,则停止向服务器请求所述资源;The first determination processing module is configured to stop requesting the resource from the server if the number of times recorded by the recording module reaches a preset number of times;

第二确定处理模块,被配置为若所述记录模块记录的所述次数未达到所述预设次数,则重新执行向服务器请求当前移动终端采用的语言对应的资源。The second determination processing module is configured to re-execute requesting resources corresponding to the language currently used by the mobile terminal from the server if the number of times recorded by the recording module does not reach the preset number of times.

在一实施例中,所述装置还包括:In one embodiment, the device also includes:

引用模块,被配置为根据所述接收解析模块解析后的资源内容动态引用当前移动终端的系统资源。The reference module is configured to dynamically reference the system resources of the current mobile terminal according to the resource content parsed by the receiving and parsing module.

在一实施例中,所述装置还包括:In one embodiment, the device also includes:

获取加载模块,被配置为若获知所述服务器中存在当前语言资源的更新内容,则从所述服务器获取所述更新内容,并在下次启动时加载所述更新内容。The obtaining and loading module is configured to obtain the updated content from the server if it is known that the updated content of the current language resource exists in the server, and load the updated content at the next startup.

在一实施例中,所述获取加载模块包括:In one embodiment, the acquisition and loading module includes:

发送获取子模块,被配置为向所述服务器发送更新检测请求,以检测所述服务器中是否存在当前语言资源的更新内容,若存在所述更新内容,则从所述服务器获取所述更新内容;和/或The sending and obtaining submodule is configured to send an update detection request to the server to detect whether there is an update content of the current language resource in the server, and if there is the update content, obtain the update content from the server; and / or

接收获取子模块,被配置为接收所述服务器返回的当前语言资源的更新通知,并根据所述更新通知从所述服务器获取所述当前语言资源的更新内容。The receiving and obtaining submodule is configured to receive the update notification of the current language resource returned by the server, and obtain the update content of the current language resource from the server according to the update notification.

根据本公开实施例的第三方面,提供一种应用程序的多语言资源切换装置,包括:According to a third aspect of the embodiments of the present disclosure, there is provided an application multilingual resource switching device, including:

处理器;processor;

用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;

其中,处理器被配置为:where the processor is configured as:

在当前应用程序启动时,检测当前移动终端采用的语言;When the current application starts, detect the language used by the current mobile terminal;

若所述当前移动终端采用的语言与所述当前应用程序采用的默认语言不同,则向服务器请求当前移动终端采用的语言对应的资源;If the language used by the current mobile terminal is different from the default language used by the current application program, requesting resources corresponding to the language used by the current mobile terminal from the server;

接收并解析所述服务器返回的资源;receiving and parsing the resource returned by the server;

将所述当前应用程序的默认语言资源内容替换为解析后的资源内容。The default language resource content of the current application is replaced with the parsed resource content.

本公开的实施例提供的技术方案可以包括以下有益效果:通过检测当前移动终端采用的语言,并在当前移动终端采用的语言与当前应用程序采用的默认语言不同时,向服务器请求当前移动终端采用的语言对应的资源,并解析接收的资源,然后将当前应用程序的默认语言资源内容替换为解析后的资源内容,从而实现了语音资源的切换,该切换方法不需要将语言资源整合在安装包中,减少了安装包的大小,从而降低了应用程序的下载流量,减小了应用程序的占用空间。The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects: by detecting the language adopted by the current mobile terminal, and when the language adopted by the current mobile terminal is different from the default language adopted by the current application program, request the server to use the language adopted by the current mobile terminal. resources corresponding to the language, and parse the received resources, and then replace the default language resource content of the current application with the parsed resource content, thereby realizing the switching of voice resources. This switching method does not need to integrate language resources in the installation package In , the size of the installation package is reduced, thereby reducing the download traffic of the application program and reducing the occupied space of the application program.

通过记录向服务器请求资源的次数,并在请请求资源的次数达到预设次数时,停止向服务器请求资源,从而避免了用户操作过程中出现卡顿现象。By recording the number of requests for resources from the server, and when the number of resource requests reaches the preset number, stop requesting resources from the server, thereby avoiding the phenomenon of jamming during user operations.

通过动态引用当前移动终端的系统资源,从而不需要在安装包中封装静态资源,进一步减小了安装包的大小,同时,不需要用户频繁升级应用程序。By dynamically referencing the system resources of the current mobile terminal, there is no need to encapsulate static resources in the installation package, which further reduces the size of the installation package, and at the same time, does not require the user to frequently upgrade the application program.

通过从服务器获取更新内容,并在下次启动时加载更新内容,既可以保证操作的流畅性和稳定性,又可以保证用户不会察觉到,同时可以实现安装包的自动升级,减少了用户手动升级安装包的操作,提高了用户体验。By obtaining the updated content from the server and loading the updated content at the next startup, it can not only ensure the smoothness and stability of the operation, but also ensure that the user will not notice it. At the same time, the automatic upgrade of the installation package can be realized, reducing the need for manual upgrades by users The operation of the installation package improves the user experience.

可以通过多种方式获知服务器中是否存在当前语言资源的更新内容,并在服务器中存在当前语言资源的更新内容时,从服务器获取更新内容,实现方式灵活、多样。Whether there is updated content of the current language resource in the server can be learned in various ways, and when the updated content of the current language resource exists in the server, the updated content is obtained from the server, and the implementation methods are flexible and diverse.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.

附图说明Description of drawings

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本发明的实施例,并与说明书一起用于解释本发明的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description serve to explain the principles of the invention.

图1是根据一示例性实施例示出的一种应用程序的多语言资源切换方法的流程图。Fig. 1 is a flowchart showing a method for switching multilingual resources of an application program according to an exemplary embodiment.

图2是根据一示例性实施例示出的另一种应用程序的多语言资源切换方法的流程图。Fig. 2 is a flow chart showing another method for switching multilingual resources of an application according to an exemplary embodiment.

图3是根据一示例性实施例示出的另一种应用程序的多语言资源切换方法的流程图。Fig. 3 is a flow chart showing another method for switching multilingual resources of an application according to an exemplary embodiment.

图4是根据一示例性实施例示出的另一种应用程序的多语言资源切换方法的流程图。Fig. 4 is a flow chart showing another method for switching multilingual resources of an application according to an exemplary embodiment.

图5是根据一示例性实施例示出的一种应用程序的多语言资源切换装置的框图。Fig. 5 is a block diagram of an apparatus for switching multilingual resources of an application according to an exemplary embodiment.

图6是根据一示例性实施例示出的另一种应用程序的多语言资源切换装置的框图。Fig. 6 is a block diagram of another device for switching multilingual resources of an application according to an exemplary embodiment.

图7是根据一示例性实施例示出的另一种应用程序的多语言资源切换装置的框图。Fig. 7 is a block diagram of another device for switching multilingual resources of an application according to an exemplary embodiment.

图8是根据一示例性实施例示出的另一种应用程序的多语言资源切换装置的框图。Fig. 8 is a block diagram of another device for switching multilingual resources of an application according to an exemplary embodiment.

图9是根据一示例性实施例示出的另一种应用程序的多语言资源切换装置的框图。Fig. 9 is a block diagram of another device for switching multilingual resources of an application according to an exemplary embodiment.

图10是根据一示例性实施例示出的一种适用于应用程序的多语言资源切换装置的框图。Fig. 10 is a block diagram showing an apparatus for switching multilingual resources suitable for applications according to an exemplary embodiment.

具体实施方式detailed description

这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本发明相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本发明的一些方面相一致的装置和方法的例子。Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with aspects of the invention as recited in the appended claims.

图1是根据一示例性实施例示出的一种应用程序的多语言资源切换方法的流程图,如图1所示,该应用程序的多语言资源切换方法可应用于移动终端上,该移动终端可以包括但不局限于手机、平板电脑(PAD)等智能终端,该多语言资源切换方法包括以下步骤S101-S104:Fig. 1 is a flowchart of a method for switching multilingual resources of an application according to an exemplary embodiment. As shown in Fig. 1, the method for switching multilingual resources of an application can be applied to a mobile terminal, and the mobile terminal Can include but not limited to mobile phones, tablet computers (PAD) and other smart terminals, the multilingual resource switching method includes the following steps S101-S104:

在步骤S101中,在当前应用程序启动时,检测当前移动终端采用的语言。In step S101, when the current application is started, the language currently used by the mobile terminal is detected.

在该实施例中,当前应用程序可以为跨境电商平台的客户端,它可以支持多种语言,而该当前应用程序预先可以使用一种语言作为默认语言,例如可以使用最广泛的英语作为默认语言,即将英语对应的资源作为默认语言资源,以保证大多数用户能够得到好的使用体验。In this embodiment, the current application program can be a client of the cross-border e-commerce platform, which can support multiple languages, and the current application program can use one language as the default language in advance, for example, the most widely used English can be used as the default language. The default language is to use the resources corresponding to English as the default language resources to ensure that most users can get a good experience.

在当前应用程序启动时,可以检测当前移动终端采用的语言,例如,检测当前手机采用的语言是中文。When the current application program is started, it may detect the language currently adopted by the mobile terminal, for example, detect that the language currently adopted by the mobile phone is Chinese.

在步骤S102中,若当前移动终端采用的语言与当前应用程序采用的默认语言不同,则向服务器请求当前移动终端采用的语言对应的资源。In step S102, if the language currently used by the mobile terminal is different from the default language used by the current application program, request resources corresponding to the language currently used by the mobile terminal from the server.

在该实施例中,如果当前移动终端例如手机采用的语言与当前应用程序采用的默认语言不同,则可以向服务器请求当前移动终端采用的语言对应的资源。例如,可以向服务器发送对应语言资源的请求,服务器接收该请求后,根据该请求中携带的语言向当前应用程序返回对应的资源。In this embodiment, if the language currently used by the mobile terminal such as the mobile phone is different from the default language used by the current application program, a resource corresponding to the language used by the current mobile terminal may be requested from the server. For example, a request for corresponding language resources may be sent to the server, and after receiving the request, the server returns corresponding resources to the current application program according to the language carried in the request.

由于中文与英文不同,因此,可以向服务器请求中文资源。Since Chinese is different from English, Chinese resources can be requested from the server.

在步骤S103中,接收并解析服务器返回的资源。In step S103, the resource returned by the server is received and parsed.

在该实施例中,当前应用程序接收服务器返回的资源后,可以对接收的资源进行解析,以获得资源内容。In this embodiment, after the current application program receives the resource returned by the server, it may parse the received resource to obtain resource content.

其中,资源内容可以包括但不局限于该图片、文字和链接等内容。Wherein, the resource content may include but not limited to the picture, text, link and other content.

继续上例进行描述,可以对接收的中文资源进行解析,以获得中文资源内容。Continuing the description of the above example, the received Chinese resource can be parsed to obtain the content of the Chinese resource.

在步骤S104中,将当前应用程序的默认语言资源内容替换为解析后的资源内容。In step S104, the default language resource content of the current application is replaced with the parsed resource content.

在该实施例中,在对资源进行解析之后,可以用解析后的资源内容动态替换当前应用程序的默认语言资源内容,并在本地存储解析后的资源内容。In this embodiment, after the resource is parsed, the resource content of the default language of the current application can be dynamically replaced with the parsed resource content, and the parsed resource content is stored locally.

继续上例进行描述,在获得中文资源内容后,可以使用中文资源内容替换英文资源内容,从而实现语言资源的切换。Continuing the description of the above example, after obtaining the Chinese resource content, you can use the Chinese resource content to replace the English resource content, so as to realize the switching of language resources.

上述应用程序的多语言资源切换方法实施例,通过检测当前移动终端采用的语言,并在当前移动终端采用的语言与当前应用程序采用的默认语言不同时,向服务器请求当前移动终端采用的语言对应的资源,并解析接收的资源,然后将当前应用程序的默认语言资源内容替换为解析后的资源内容,从而实现了语音资源的切换,该切换方法不需要将语言资源整合在安装包中,减少了安装包的大小,从而降低了应用程序的下载流量,减小了应用程序的占用空间。In the embodiment of the multilingual resource switching method for the above application, by detecting the language currently used by the mobile terminal, and when the language currently used by the mobile terminal is different from the default language used by the current application program, request the server to correspond to the language used by the current mobile terminal. resources, and parse the received resources, and then replace the default language resource content of the current application with the parsed resource content, thereby realizing the switching of voice resources. This switching method does not need to integrate language resources in the installation package, reducing The size of the installation package is reduced, thereby reducing the download traffic of the application program and reducing the occupied space of the application program.

图2是根据一示例性实施例示出的另一种应用程序的多语言资源切换方法的流程图,如图2所示,该多语言资源切换方法包括以下步骤S201-S208:Fig. 2 is a flowchart of another multilingual resource switching method for an application program according to an exemplary embodiment. As shown in Fig. 2, the multilingual resource switching method includes the following steps S201-S208:

在步骤S201中,在当前应用程序启动时,检测当前移动终端采用的语言。In step S201, when the current application is started, the language currently used by the mobile terminal is detected.

在步骤S202中,判断当前移动终端采用的语言与当前应用程序采用的默认语言是否相同,若不同,执行步骤S203,若相同,不执行语言资源的切换,操作结束。In step S202, it is judged whether the language adopted by the current mobile terminal is the same as the default language adopted by the current application program. If not, step S203 is executed. If they are the same, language resource switching is not performed, and the operation ends.

在步骤S203中,向服务器请求当前移动终端采用的语言对应的资源。In step S203, the resource corresponding to the language currently adopted by the mobile terminal is requested from the server.

在步骤S204中,判断是否接收到服务器返回的资源,若接收到,则执行步骤S205,否则,转向执行步骤S206。In step S204, it is judged whether the resource returned by the server is received, if so, execute step S205, otherwise, proceed to execute step S206.

在步骤S205中,解析服务器返回的资源,并转向执行步骤S208。In step S205, analyze the resource returned by the server, and turn to step S208.

在步骤S206中,记录向服务器请求资源的次数。In step S206, the number of resource requests to the server is recorded.

在步骤S207中,判断记录的次数是否达到预设次数,若达到,则停止向服务器请求资源,操作结束,若未达到,则转向执行步骤S203。In step S207, it is judged whether the number of times of recording reaches the preset number of times, if so, stop requesting resources from the server, and the operation ends, if not, then go to step S203.

在步骤S208中,将当前应用程序的默认语言资源内容替换为解析后的资源内容。In step S208, the default language resource content of the current application is replaced with the parsed resource content.

上述应用程序的多语言资源切换方法实施例,通过记录向服务器请求资源的次数,并在请请求资源的次数达到预设次数时,停止向服务器请求资源,从而避免了用户操作过程中出现卡顿现象。In the embodiment of the multilingual resource switching method of the above application program, by recording the number of resource requests from the server, and when the number of resource request requests reaches the preset number, stop requesting resources from the server, thereby avoiding the occurrence of stuck during user operations Phenomenon.

图3是根据一示例性实施例示出的另一种应用程序的多语言资源切换方法的流程图,如图3所示,该实施例在上述步骤S104之后,还可以包括如下步骤:Fig. 3 is a flow chart showing another method for switching multilingual resources of an application program according to an exemplary embodiment. As shown in Fig. 3, this embodiment may further include the following steps after the above step S104:

在步骤S105中,根据解析后的资源内容动态引用当前移动终端的系统资源。In step S105, the system resource of the current mobile terminal is dynamically referenced according to the analyzed resource content.

在该实施例中,当前应用程序可以根据解析后的资源内容动态引用当前移动终端的系统资源,例如可以采用表达式Stringstr=model.str来动态引用手机的系统资源,其中,model的值可以根据解析后的资源内容进行动态的调整。In this embodiment, the current application program can dynamically reference the system resources of the current mobile terminal according to the resolved resource content, for example, the expression Stringstr=model.str can be used to dynamically reference the system resources of the mobile phone, wherein the value of model can be based on The parsed resource content is dynamically adjusted.

上述应用程序的多语言资源切换方法实施例,通过动态引用当前移动终端的系统资源,从而不需要在安装包中封装静态资源,进一步减小了安装包的大小,同时,不需要用户频繁升级应用程序。In the embodiment of the multilingual resource switching method for the above application program, by dynamically referencing the system resources of the current mobile terminal, there is no need to encapsulate static resources in the installation package, which further reduces the size of the installation package, and at the same time, does not require users to frequently upgrade the application program.

图4是根据一示例性实施例示出的另一种应用程序的多语言资源切换方法的流程图,如图4所示,该实施例在上述步骤S104之后,还可以包括如下步骤:Fig. 4 is a flow chart of another multilingual resource switching method for an application according to an exemplary embodiment. As shown in Fig. 4, this embodiment may further include the following steps after the above step S104:

在步骤S106中,若获知服务器中存在当前语言资源的更新内容,则从服务器获取更新内容,并在下次启动时加载更新内容。In step S106, if it is known that the updated content of the current language resource exists in the server, the updated content is obtained from the server, and the updated content is loaded at the next startup.

在该实施例中,可以通过多种方式获知服务器中是否存在当前语言资源的更新内容,并在服务器中存在当前语言资源的更新内容时,从服务器获取更新内容。以下列举两种实现方式:In this embodiment, it is possible to learn whether there is an updated content of the current language resource in the server through various methods, and obtain the updated content from the server when there is an updated content of the current language resource in the server. Here are two implementations:

第一种方式,当前应用程序向服务器发送更新检测请求,以检测服务器中是否存在当前语言资源的更新内容,若存在更新内容,则从服务器获取更新内容。In the first way, the current application program sends an update detection request to the server to detect whether there is update content of the current language resource in the server, and if there is update content, obtain the update content from the server.

第二种方式,当前应用程序接收服务器返回的当前语言资源的更新通知,并根据该更新通知从服务器获取当前语言资源的更新内容。In the second way, the current application program receives the update notification of the current language resource returned by the server, and obtains the update content of the current language resource from the server according to the update notification.

但不论采用哪种方式,在从服务器获取更新内容之后,本次启动仍然继续使用之前的语言资源,以保证操作的流畅性和稳定性,不让用户感受到因为下载带来的卡顿现象。But no matter which method is used, after obtaining the updated content from the server, the previous language resources will continue to be used in this startup to ensure the smoothness and stability of the operation and prevent users from feeling stuck due to downloading.

另外,在语言资源有更新之后,用户不需要重新下载应用程序进行安装,而是在从服务器获取更新内容之后,在用户无察觉的情况下完成更新。In addition, after the language resource is updated, the user does not need to re-download the application program for installation, but after obtaining the update content from the server, the update is completed without the user noticing.

上述应用程序的多语言资源切换方法实施例,通过从服务器获取更新内容,并在下次启动时加载更新内容,既可以保证操作的流畅性和稳定性,又可以保证用户不会察觉到,同时可以实现安装包的自动升级,减少了用户手动升级安装包的操作,提高了用户体验。In the embodiment of the multilingual resource switching method for the above application program, by obtaining the updated content from the server and loading the updated content at the next startup, it can not only ensure the smoothness and stability of the operation, but also ensure that the user will not be aware of it, and at the same time can The automatic upgrade of the installation package is realized, the operation of manually upgrading the installation package by the user is reduced, and the user experience is improved.

与前述应用程序的多语言资源切换方法实施例相对应,本公开还提供了应用程序的多语言资源切换装置实施例。Corresponding to the aforementioned embodiment of the method for switching multilingual resources of an application, the present disclosure also provides an embodiment of a device for switching multilingual resources of an application.

图5是根据一示例性实施例示出的一种应用程序的多语言资源切换装置的框图,如图5所示,该应用程序的多语言资源切换装置包括:检测模块51、确定请求模块52、接收解析模块53和替换模块54。Fig. 5 is a block diagram of an application program multilingual resource switching device according to an exemplary embodiment. As shown in Fig. 5, the application program multilingual resource switching device includes: a detection module 51, a determination request module 52, The analysis module 53 and the replacement module 54 are received.

检测模块51被配置为在当前应用程序启动时,检测当前移动终端采用的语言。The detection module 51 is configured to detect the language currently used by the mobile terminal when the current application program is started.

在该实施例中,当前应用程序可以为跨境电商平台的客户端,它可以支持多种语言,而该当前应用程序预先可以使用一种语言作为默认语言,例如可以使用最广泛的英语作为默认语言,即将英语对应的资源作为默认语言资源,以保证大多数用户能够得到好的使用体验。In this embodiment, the current application program can be a client of the cross-border e-commerce platform, which can support multiple languages, and the current application program can use one language as the default language in advance, for example, the most widely used English can be used as the default language. The default language is to use the resources corresponding to English as the default language resources to ensure that most users can get a good experience.

在当前应用程序启动时,可以检测当前移动终端采用的语言,例如,检测当前手机采用的语言是中文。When the current application program is started, it may detect the language currently adopted by the mobile terminal, for example, detect that the language currently adopted by the mobile phone is Chinese.

确定请求模块52被配置为若检测模块51检测到当前移动终端采用的语言与当前应用程序采用的默认语言不同,则向服务器请求当前移动终端采用的语言对应的资源。The determination request module 52 is configured to request resources corresponding to the language used by the current mobile terminal from the server if the detection module 51 detects that the language used by the current mobile terminal is different from the default language used by the current application program.

在该实施例中,如果当前移动终端例如手机采用的语言与当前应用程序采用的默认语言不同,则可以向服务器请求当前移动终端采用的语言对应的资源。例如,可以向服务器发送对应语言资源的请求,服务器接收该请求后,根据该请求中携带的语言向当前应用程序返回对应的资源。In this embodiment, if the language currently used by the mobile terminal such as the mobile phone is different from the default language used by the current application program, a resource corresponding to the language used by the current mobile terminal may be requested from the server. For example, a request for corresponding language resources may be sent to the server, and after receiving the request, the server returns corresponding resources to the current application program according to the language carried in the request.

由于中文与英文不同,因此,可以向服务器请求中文资源。Since Chinese is different from English, Chinese resources can be requested from the server.

接收解析模块53被配置为接收并解析确定请求模块52请求服务器返回的资源。The receiving and parsing module 53 is configured to receive and parse the resource returned by the determining request module 52 requested by the server.

在该实施例中,当前应用程序接收服务器返回的资源后,可以对接收的资源进行解析,以获得资源内容。In this embodiment, after the current application program receives the resource returned by the server, it may parse the received resource to obtain resource content.

其中,资源内容可以包括但不局限于该图片、文字和链接等内容。Wherein, the resource content may include but not limited to the picture, text, link and other content.

继续上例进行描述,可以对接收的中文资源进行解析,以获得中文资源内容。Continuing the description of the above example, the received Chinese resource can be parsed to obtain the content of the Chinese resource.

替换模块54被配置为将当前应用程序的默认语言资源内容替换为接收解析模块53解析后的资源内容。The replacement module 54 is configured to replace the default language resource content of the current application with the resource content parsed by the parsing module 53 .

在该实施例中,在对资源进行解析之后,可以用解析后的资源内容动态替换当前应用程序的默认语言资源内容,并在本地存储解析后的资源内容。In this embodiment, after the resource is parsed, the resource content of the default language of the current application can be dynamically replaced with the parsed resource content, and the parsed resource content is stored locally.

继续上例进行描述,在获得中文资源内容后,可以使用中文资源内容替换英文资源内容,从而实现语言资源的切换。Continuing the description of the above example, after obtaining the Chinese resource content, you can use the Chinese resource content to replace the English resource content, so as to realize the switching of language resources.

如图5所示的装置用于实现上述如图1所示的方法流程,涉及到的相关内容描述相同,此处不赘述。The device shown in FIG. 5 is used to implement the above-mentioned method flow shown in FIG. 1 , and related content is described in the same way, and will not be repeated here.

上述应用程序的多语言资源切换装置实施例,通过检测当前移动终端采用的语言,并在当前移动终端采用的语言与当前应用程序采用的默认语言不同时,向服务器请求当前移动终端采用的语言对应的资源,并解析接收的资源,然后将当前应用程序的默认语言资源内容替换为解析后的资源内容,从而实现了语音资源的切换,该切换方法不需要将语言资源整合在安装包中,减少了安装包的大小,从而降低了应用程序的下载流量,减小了应用程序的占用空间。The embodiment of the multilingual resource switching device for the above application program detects the language currently used by the mobile terminal, and when the language used by the current mobile terminal is different from the default language used by the current application program, it requests the server to correspond to the language used by the current mobile terminal. resources, and parse the received resources, and then replace the default language resource content of the current application with the parsed resource content, thereby realizing the switching of voice resources. This switching method does not need to integrate language resources in the installation package, reducing The size of the installation package is reduced, thereby reducing the download traffic of the application program and reducing the occupied space of the application program.

图6是根据一示例性实施例示出的另一种应用程序的多语言资源切换装置的框图,如图6所示,在上述图5所示实施例的基础上,该装置还可包括:记录模块55、第一确定处理模块56和第二确定处理模块57。Fig. 6 is a block diagram of another application multilingual resource switching device according to an exemplary embodiment. As shown in Fig. 6, on the basis of the embodiment shown in Fig. 5 above, the device may further include: module 55 , a first determination processing module 56 and a second determination processing module 57 .

记录模块55被配置为在确定请求模块52向服务器请求当前移动终端采用的语言对应的资源之后,若未接收到服务器返回的资源,则记录向服务器请求资源的次数。The recording module 55 is configured to record the number of resource requests from the server if no resource returned by the server is received after it is determined that the request module 52 requests the server for resources corresponding to the language currently adopted by the mobile terminal.

第一确定处理模块56被配置为若记录模块55记录的次数达到预设次数,则停止向服务器请求资源。The first determination processing module 56 is configured to stop requesting resources from the server if the number of times recorded by the recording module 55 reaches a preset number of times.

第二确定处理模块57被配置为若记录模块55记录的次数未达到预设次数,则重新执行向服务器请求当前移动终端采用的语言对应的资源。The second determination processing module 57 is configured to re-execute requesting resources corresponding to the language currently used by the mobile terminal from the server if the number of times recorded by the recording module 55 does not reach the preset number of times.

如图6所示的装置用于实现上述如图2所示的方法流程,涉及到的相关内容描述相同,此处不赘述。The device shown in FIG. 6 is used to implement the above-mentioned method flow shown in FIG. 2 , and related content is described in the same way, and will not be repeated here.

上述应用程序的多语言资源切换装置实施例,通过记录向服务器请求资源的次数,并在请请求资源的次数达到预设次数时,停止向服务器请求资源,从而避免了用户操作过程中出现卡顿现象。The embodiment of the multilingual resource switching device for the above application program records the number of resource requests from the server, and stops requesting resources from the server when the number of resource request requests reaches the preset number of times, thereby avoiding the occurrence of stuck during user operations Phenomenon.

图7是根据一示例性实施例示出的另一种应用程序的多语言资源切换装置的框图,如图7所示,在上述图5所示实施例的基础上,该装置还可以包括:引用模块58。Fig. 7 is a block diagram of another application program multilingual resource switching device according to an exemplary embodiment. As shown in Fig. 7, on the basis of the embodiment shown in Fig. 5 above, the device may further include: Module 58.

引用模块58被配置为根据接收解析模块53解析后的资源内容动态引用当前移动终端的系统资源。The reference module 58 is configured to dynamically reference the system resources of the current mobile terminal according to the resource content parsed by the receiving and parsing module 53 .

如图7所示的装置用于实现上述如图3所示的方法流程,涉及到的相关内容描述相同,此处不赘述。The device shown in FIG. 7 is used to implement the above-mentioned method flow shown in FIG. 3 , and the relevant content involved is described in the same way and will not be repeated here.

上述应用程序的多语言资源切换装置实施例,通过动态引用当前移动终端的系统资源,从而不需要在安装包中封装静态资源,进一步减小了安装包的大小,同时,不需要用户频繁升级应用程序。The embodiment of the multilingual resource switching device for the above-mentioned application programs dynamically references the system resources of the current mobile terminal, so that there is no need to encapsulate static resources in the installation package, which further reduces the size of the installation package, and at the same time, does not require users to frequently upgrade the application program.

图8是根据一示例性实施例示出的另一种应用程序的多语言资源切换装置的框图,如图8所示,在上述图5所示实施例的基础上,该装置还可包括:获取加载模块59。Fig. 8 is a block diagram of another application program multilingual resource switching device according to an exemplary embodiment. As shown in Fig. 8, on the basis of the embodiment shown in Fig. 5 above, the device may further include: Load module 59.

获取加载模块59被配置为若获知服务器中存在当前语言资源的更新内容,则从服务器获取更新内容,并在下次启动时加载更新内容。The acquiring and loading module 59 is configured to acquire the updated content from the server if it knows that the updated content of the current language resource exists in the server, and load the updated content at the next startup.

在该实施例中,在从服务器获取更新内容之后,本次启动仍然继续使用之前的语言资源,以保证操作的流畅性和稳定性,不让用户感受到因为下载带来的卡顿现象。In this embodiment, after the updated content is obtained from the server, the previous language resources are still used in this startup to ensure the fluency and stability of the operation, and prevent the user from feeling stuck due to downloading.

另外,在语言资源有更新之后,用户不需要重新下载应用程序进行安装,而是在从服务器获取更新内容之后,在用户无察觉的情况下完成更新。In addition, after the language resource is updated, the user does not need to re-download the application program for installation, but after obtaining the update content from the server, the update is completed without the user noticing.

如图8所示的装置用于实现上述如图4所示的方法流程,涉及到的相关内容描述相同,此处不赘述。The device shown in FIG. 8 is used to implement the above-mentioned method flow shown in FIG. 4 , and related content is described in the same way, and will not be repeated here.

上述应用程序的多语言资源切换装置实施例,通过从服务器获取更新内容,并在下次启动时加载更新内容,既可以保证操作的流畅性和稳定性,又可以保证用户不会察觉到,同时可以实现安装包的自动升级,减少了用户手动升级安装包的操作,提高了用户体验。In the embodiment of the multilingual resource switching device for the above-mentioned application program, by obtaining the updated content from the server and loading the updated content at the next startup, it can not only ensure the fluency and stability of the operation, but also ensure that the user will not be aware of it, and at the same time can The automatic upgrade of the installation package is realized, the operation of manually upgrading the installation package by the user is reduced, and the user experience is improved.

图9是根据一示例性实施例示出的另一种应用程序的多语言资源切换装置的框图,如图9所示,在上述图8所示实施例的基础上,获取加载模块59可包括:发送获取子模块591和接收获取子模块592中的至少一个子模块。Fig. 9 is a block diagram of another application program multilingual resource switching device according to an exemplary embodiment. As shown in Fig. 9, on the basis of the embodiment shown in Fig. 8 above, the acquisition and loading module 59 may include: At least one submodule of the sending and obtaining submodule 591 and the receiving and obtaining submodule 592.

发送获取子模块591被配置为向服务器发送更新检测请求,以检测服务器中是否存在当前语言资源的更新内容,若存在更新内容,则从服务器获取更新内容。The sending and obtaining sub-module 591 is configured to send an update detection request to the server to detect whether there is an update content of the current language resource in the server, and if there is update content, obtain the update content from the server.

接收获取子模块592被配置为接收服务器返回的当前语言资源的更新通知,并根据更新通知从服务器获取当前语言资源的更新内容。The receiving and obtaining sub-module 592 is configured to receive the update notification of the current language resource returned by the server, and obtain the update content of the current language resource from the server according to the update notification.

在该实施例中,可以通过多种方式获知服务器中是否存在当前语言资源的更新内容,并在服务器中存在当前语言资源的更新内容时,从服务器获取更新内容。以下列举两种实现方式:In this embodiment, it is possible to learn whether there is an updated content of the current language resource in the server through various methods, and obtain the updated content from the server when there is an updated content of the current language resource in the server. Here are two implementations:

第一种方式,当前应用程序向服务器发送更新检测请求,以检测服务器中是否存在当前语言资源的更新内容,若存在更新内容,则从服务器获取更新内容。In the first way, the current application program sends an update detection request to the server to detect whether there is update content of the current language resource in the server, and if there is update content, obtain the update content from the server.

第二种方式,当前应用程序接收服务器返回的当前语言资源的更新通知,并根据该更新通知从服务器获取当前语言资源的更新内容。In the second way, the current application program receives the update notification of the current language resource returned by the server, and obtains the update content of the current language resource from the server according to the update notification.

如图9所示的装置用于实现上述如图4所示的方法流程,涉及到的相关内容描述相同,此处不赘述。The device shown in FIG. 9 is used to implement the above-mentioned method flow shown in FIG. 4 , and the relevant content involved is described in the same way and will not be repeated here.

上述应用程序的多语言资源切换装置实施例,可以通过多种方式获知服务器中是否存在当前语言资源的更新内容,并在服务器中存在当前语言资源的更新内容时,从服务器获取更新内容,实现方式灵活、多样。The embodiment of the multilingual resource switching device for the above-mentioned application program can learn whether there is an updated content of the current language resource in the server through various methods, and obtain the updated content from the server when there is an updated content of the current language resource in the server. Flexible and versatile.

关于上述实施例中的装置,其中各个模块、子模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the apparatus in the above embodiments, the specific manner in which each module and sub-module performs operations has been described in detail in the embodiments related to the method, and will not be described in detail here.

图10是根据一示例性实施例示出的一种适用于应用程序的多语言资源切换装置的框图。例如,装置1000可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理,飞行器等。Fig. 10 is a block diagram showing an apparatus for switching multilingual resources suitable for applications according to an exemplary embodiment. For example, the apparatus 1000 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, an aircraft, and the like.

参照图10,装置1000可以包括以下一个或多个组件:处理组件1002,存储器1004,电源组件1006,多媒体组件1008,音频组件1010,输入/输出(I/O)的接口1012,传感器组件1014,以及通信组件1016。10, device 1000 may include one or more of the following components: processing component 1002, memory 1004, power supply component 1006, multimedia component 1008, audio component 1010, input/output (I/O) interface 1012, sensor component 1014, and communication component 1016.

处理组件1002通常控制装置1000的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理元件1002可以包括一个或多个处理器1020来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件1002可以包括一个或多个模块,便于处理组件1002和其他组件之间的交互。例如,处理部件1002可以包括多媒体模块,以方便多媒体组件1008和处理组件1002之间的交互。The processing component 1002 generally controls the overall operations of the device 1000, such as those associated with display, telephone calls, data communications, camera operations, and recording operations. The processing element 1002 may include one or more processors 1020 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 1002 may include one or more modules that facilitate interaction between processing component 1002 and other components. For example, processing component 1002 may include a multimedia module to facilitate interaction between multimedia component 1008 and processing component 1002 .

存储器1004被配置为存储各种类型的数据以支持在设备1000的操作。这些数据的示例包括用于在装置1000上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器1004可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。The memory 1004 is configured to store various types of data to support operations at the device 1000 . Examples of such data include instructions for any application or method operating on device 1000, contact data, phonebook data, messages, pictures, videos, and the like. The memory 1004 can be realized by any type of volatile or non-volatile storage device or their combination, 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.

电力组件1006为装置1000的各种组件提供电力。电力组件1006可以包括电源管理系统,一个或多个电源,及其他与为装置1000生成、管理和分配电力相关联的组件。Power component 1006 provides power to various components of device 1000 . Power components 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for device 1000 .

多媒体组件1008包括在所述装置1000和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件1008包括一个前置摄像头和/或后置摄像头。当设备1000处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。The multimedia component 1008 includes a screen that provides an output interface between the device 1000 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense a boundary of a touch or swipe action, but also detect duration and pressure associated with the touch or swipe action. In some embodiments, the multimedia component 1008 includes a front camera and/or a rear camera. When the device 1000 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capability.

音频组件1010被配置为输出和/或输入音频信号。例如,音频组件1010包括一个麦克风(MIC),当装置1000处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器1004或经由通信组件1016发送。在一些实施例中,音频组件1010还包括一个扬声器,用于输出音频信号。The audio component 1010 is configured to output and/or input audio signals. For example, the audio component 1010 includes a microphone (MIC), which is configured to receive external audio signals when the device 1000 is in operation modes, such as call mode, recording mode and voice recognition mode. Received audio signals may be further stored in memory 1004 or sent via communication component 1016 . In some embodiments, the audio component 1010 also includes a speaker for outputting audio signals.

I/O接口1012为处理组件1002和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 1012 provides an interface between the processing component 1002 and a peripheral interface module, which may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: a home button, volume buttons, start button, and lock button.

传感器组件1014包括一个或多个传感器,用于为装置1000提供各个方面的状态评估。例如,传感器组件1014可以检测到设备1000的打开/关闭状态,组件的相对定位,例如所述组件为装置1000的显示器和小键盘,传感器组件1014还可以检测装置1000或装置1000一个组件的位置改变,用户与装置1000接触的存在或不存在,装置1000方位或加速/减速和装置1000的温度变化。传感器组件1014可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件1014还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件1014还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。Sensor assembly 1014 includes one or more sensors for providing status assessments of various aspects of device 1000 . For example, the sensor component 1014 can detect the open/closed state of the device 1000, the relative positioning of components, such as the display and keypad of the device 1000, and the sensor component 1014 can also detect a change in the position of the device 1000 or a component of the device 1000 , the presence or absence of user contact with the device 1000 , the device 1000 orientation or acceleration/deceleration and the temperature change of the device 1000 . The sensor assembly 1014 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. The sensor assembly 1014 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 1014 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.

通信组件1016被配置为便于装置1000和其他设备之间有线或无线方式的通信。装置1000可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信部件1016经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信部件1016还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。The communication component 1016 is configured to facilitate wired or wireless communication between the apparatus 1000 and other devices. The device 1000 can access wireless networks based on communication standards, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1016 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1016 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology and other technologies.

在示例性实施例中,装置1000可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, apparatus 1000 may be programmed by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation for performing the methods described above.

在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器1004,上述指令可由装置1000的处理器1020执行以完成上述方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium including instructions, such as the memory 1004 including instructions, which can be executed by the processor 1020 of the device 1000 to implement the above method. For example, the non-transitory computer readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.

本领域技术人员在考虑说明书及实践这里公开的公开后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, and these modifications, uses or adaptations follow the general principles of the present disclosure and include common knowledge or conventional technical means in the technical field not disclosed in the present disclosure . The specification and examples are to be considered exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It should be understood that the present disclosure is not limited to the precise constructions which have been described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (11)

Translated fromChinese
1.一种应用程序的多语言资源切换方法,其特征在于,所述方法包括:1. A method for switching multilingual resources of an application program, characterized in that the method comprises:在当前应用程序启动时,检测当前移动终端采用的语言;When the current application starts, detect the language used by the current mobile terminal;若所述当前移动终端采用的语言与所述当前应用程序采用的默认语言不同,则向服务器请求当前移动终端采用的语言对应的资源;If the language used by the current mobile terminal is different from the default language used by the current application program, requesting resources corresponding to the language used by the current mobile terminal from the server;接收并解析所述服务器返回的资源;receiving and parsing the resource returned by the server;将所述当前应用程序的默认语言资源内容替换为解析后的资源内容。The default language resource content of the current application is replaced with the parsed resource content.2.根据权利要求1所述的应用程序的多语言资源切换方法,其特征在于,所述方法还包括:2. The multilingual resource switching method of the application program according to claim 1, wherein the method further comprises:在所述向服务器请求当前移动终端采用的语言对应的资源之后,若未接收到所述服务器返回的资源,则记录向服务器请求所述资源的次数;After the request to the server for resources corresponding to the language currently used by the mobile terminal, if the resource returned by the server is not received, record the number of times the resource is requested from the server;若所述次数达到预设次数,则停止向服务器请求所述资源;If the number of times reaches a preset number of times, stop requesting the resource from the server;若所述次数未达到所述预设次数,则重新执行向服务器请求当前移动终端采用的语言对应的资源。If the number of times does not reach the preset number of times, re-requesting resources corresponding to the language currently used by the mobile terminal from the server.3.根据权利要求1所述的应用程序的多语言资源切换方法,其特征在于,所述方法还包括:3. The multilingual resource switching method of the application program according to claim 1, wherein the method further comprises:根据所述解析后的资源内容动态引用当前移动终端的系统资源。The system resource of the current mobile terminal is dynamically referenced according to the resolved resource content.4.根据权利要求1所述的应用程序的多语言资源切换方法,其特征在于,所述方法还包括:4. The multilingual resource switching method of the application program according to claim 1, wherein the method further comprises:若获知所述服务器中存在当前语言资源的更新内容,则从所述服务器获取所述更新内容,并在下次启动时加载所述更新内容。If it is known that the update content of the current language resource exists in the server, the update content is obtained from the server, and the update content is loaded at the next startup.5.根据权利要求4所述的应用程序的多语言资源切换方法,其特征在于,所述若获知所述服务器中存在当前语言资源的更新内容,则从所述服务器获取所述更新内容,包括:5. The multilingual resource switching method of an application program according to claim 4, wherein if it is known that there is an updated content of the current language resource in the server, obtaining the updated content from the server includes :向所述服务器发送更新检测请求,以检测所述服务器中是否存在当前语言资源的更新内容,若存在所述更新内容,则从所述服务器获取所述更新内容;和/或Send an update detection request to the server to detect whether there is an update content of the current language resource in the server, and if there is the update content, obtain the update content from the server; and/or接收所述服务器返回的当前语言资源的更新通知,并根据所述更新通知从所述服务器获取所述当前语言资源的更新内容。receiving an update notification of the current language resource returned by the server, and acquiring update content of the current language resource from the server according to the update notification.6.一种应用程序的多语言资源切换装置,其特征在于,所述装置包括:6. A device for switching multilingual resources of an application program, characterized in that the device comprises:检测模块,被配置为在当前应用程序启动时,检测当前移动终端采用的语言;The detection module is configured to detect the language adopted by the current mobile terminal when the current application program is started;确定请求模块,被配置为若所述检测模块检测到所述当前移动终端采用的语言与所述当前应用程序采用的默认语言不同,则向服务器请求当前移动终端采用的语言对应的资源;The determining request module is configured to, if the detection module detects that the language used by the current mobile terminal is different from the default language used by the current application program, then request resources corresponding to the language used by the current mobile terminal from the server;接收解析模块,被配置为接收并解析所述确定请求模块请求所述服务器返回的资源;A receiving and parsing module configured to receive and parse the resources returned by the server requested by the determining request module;替换模块,被配置为将所述当前应用程序的默认语言资源内容替换为所述接收解析模块解析后的资源内容。A replacement module configured to replace the default language resource content of the current application with the resource content parsed by the receiving and parsing module.7.根据权利要求6所述的应用程序的多语言资源切换装置,其特征在于,所述装置还包括:7. The multilingual resource switching device of the application program according to claim 6, wherein the device further comprises:记录模块,被配置为在所述确定请求模块向服务器请求当前移动终端采用的语言对应的资源之后,若未接收到所述服务器返回的资源,则记录向服务器请求所述资源的次数;The recording module is configured to record the number of times the resource is requested from the server if the resource returned by the server is not received after the determining request module requests the server for resources corresponding to the language currently used by the mobile terminal;第一确定处理模块,被配置为若所述记录模块记录的所述次数达到预设次数,则停止向服务器请求所述资源;The first determination processing module is configured to stop requesting the resource from the server if the number of times recorded by the recording module reaches a preset number of times;第二确定处理模块,被配置为若所述记录模块记录的所述次数未达到所述预设次数,则重新执行向服务器请求当前移动终端采用的语言对应的资源。The second determination processing module is configured to re-execute requesting resources corresponding to the language currently used by the mobile terminal from the server if the number of times recorded by the recording module does not reach the preset number of times.8.根据权利要求6所述的应用程序的多语言资源切换装置,其特征在于,所述装置还包括:8. The multilingual resource switching device of the application program according to claim 6, wherein the device further comprises:引用模块,被配置为根据所述接收解析模块解析后的资源内容动态引用当前移动终端的系统资源。The reference module is configured to dynamically reference the system resources of the current mobile terminal according to the resource content parsed by the receiving and parsing module.9.根据权利要求6所述的应用程序的多语言资源切换装置,其特征在于,所述装置还包括:9. The multilingual resource switching device of the application program according to claim 6, wherein the device further comprises:获取加载模块,被配置为若获知所述服务器中存在当前语言资源的更新内容,则从所述服务器获取所述更新内容,并在下次启动时加载所述更新内容。The obtaining and loading module is configured to obtain the updated content from the server if it is known that the updated content of the current language resource exists in the server, and load the updated content at the next startup.10.根据权利要求9所述的应用程序的多语言资源切换装置,其特征在于,所述获取加载模块包括:10. The multilingual resource switching device of the application program according to claim 9, wherein the acquisition and loading module comprises:发送获取子模块,被配置为向所述服务器发送更新检测请求,以检测所述服务器中是否存在当前语言资源的更新内容,若存在所述更新内容,则从所述服务器获取所述更新内容;和/或The sending and obtaining submodule is configured to send an update detection request to the server to detect whether there is an update content of the current language resource in the server, and if there is the update content, obtain the update content from the server; and / or接收获取子模块,被配置为接收所述服务器返回的当前语言资源的更新通知,并根据所述更新通知从所述服务器获取所述当前语言资源的更新内容。The receiving and obtaining submodule is configured to receive the update notification of the current language resource returned by the server, and obtain the update content of the current language resource from the server according to the update notification.11.一种应用程序的多语言资源切换装置,其特征在于,包括:11. A multilingual resource switching device for an application, characterized in that it comprises:处理器;processor;用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;其中,所述处理器被配置为:Wherein, the processor is configured as:在当前应用程序启动时,检测当前移动终端采用的语言;When the current application starts, detect the language used by the current mobile terminal;若所述当前移动终端采用的语言与所述当前应用程序采用的默认语言不同,则向服务器请求当前移动终端采用的语言对应的资源;If the language used by the current mobile terminal is different from the default language used by the current application program, requesting resources corresponding to the language used by the current mobile terminal from the server;接收并解析所述服务器返回的资源;receiving and parsing the resource returned by the server;将所述当前应用程序的默认语言资源内容替换为解析后的资源内容。The default language resource content of the current application is replaced with the parsed resource content.
CN201610151251.9A2016-03-162016-03-16Multi-language resource switching method and device of application programPendingCN105824633A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201610151251.9ACN105824633A (en)2016-03-162016-03-16Multi-language resource switching method and device of application program

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201610151251.9ACN105824633A (en)2016-03-162016-03-16Multi-language resource switching method and device of application program

Publications (1)

Publication NumberPublication Date
CN105824633Atrue CN105824633A (en)2016-08-03

Family

ID=56523639

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201610151251.9APendingCN105824633A (en)2016-03-162016-03-16Multi-language resource switching method and device of application program

Country Status (1)

CountryLink
CN (1)CN105824633A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106227550A (en)*2016-08-052016-12-14浪潮(北京)电子信息产业有限公司Generation method, system and the computer of a kind of Internationalized Graphical User Interface
CN106681709A (en)*2016-11-242017-05-17宇龙计算机通信科技(深圳)有限公司System language switching method and device
CN106855807A (en)*2016-12-162017-06-16北京创世乐享科技有限公司The rendering method and system of multilingual list
CN107368309A (en)*2017-07-072017-11-21惠州Tcl移动通信有限公司Realize that application program supports multilingual method, storage device and mobile terminal
CN109344412A (en)*2018-09-202019-02-15五八有限公司A kind of language transfer method, device, equipment and storage medium
CN109446796A (en)*2018-09-192019-03-08北京达佳互联信息技术有限公司Application control method and device, mobile terminal and storage medium
CN109634872A (en)*2019-02-252019-04-16北京达佳互联信息技术有限公司Application testing method, device, terminal and storage medium
JP2020504346A (en)*2016-10-122020-02-06ホアウェイ・テクノロジーズ・カンパニー・リミテッド Character string display method and terminal device
CN111241852A (en)*2020-01-072020-06-05北京字节跳动网络技术有限公司File translation method, device, terminal and storage medium
CN112035132A (en)*2019-05-152020-12-04北京京东尚科信息技术有限公司 Application language switching method and device
CN112596839A (en)*2020-12-242021-04-02青岛海尔科技有限公司Language resource management method, operation terminal, storage medium and electronic device
CN112835633A (en)*2020-12-172021-05-25海信视像科技股份有限公司Display device and control method of display language
CN115130029A (en)*2021-03-262022-09-30Oppo广东移动通信有限公司Starting window generation method and device, computer readable medium and electronic equipment
CN116208793A (en)*2021-11-302023-06-02Vidaa国际控股(荷兰)公司 A method for synchronizing application language and display device
CN116541117A (en)*2023-05-102023-08-04中国工商银行股份有限公司 Language switching method, device, storage medium and electronic device in application program

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104020991A (en)*2014-05-162014-09-03可牛网络技术(北京)有限公司Method and device for multi-language switching of application program
CN104580658A (en)*2013-10-112015-04-29中兴通讯股份有限公司Mobile terminal configuration method and device
CN105094905A (en)*2015-07-212015-11-25北京金山安全软件有限公司Method and device for dynamically loading language resources

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104580658A (en)*2013-10-112015-04-29中兴通讯股份有限公司Mobile terminal configuration method and device
CN104020991A (en)*2014-05-162014-09-03可牛网络技术(北京)有限公司Method and device for multi-language switching of application program
CN105094905A (en)*2015-07-212015-11-25北京金山安全软件有限公司Method and device for dynamically loading language resources

Cited By (19)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106227550A (en)*2016-08-052016-12-14浪潮(北京)电子信息产业有限公司Generation method, system and the computer of a kind of Internationalized Graphical User Interface
US10942621B2 (en)2016-10-122021-03-09Huawei Technologies Co., Ltd.Character string display method and terminal device
JP2020504346A (en)*2016-10-122020-02-06ホアウェイ・テクノロジーズ・カンパニー・リミテッド Character string display method and terminal device
CN106681709A (en)*2016-11-242017-05-17宇龙计算机通信科技(深圳)有限公司System language switching method and device
CN106855807A (en)*2016-12-162017-06-16北京创世乐享科技有限公司The rendering method and system of multilingual list
CN106855807B (en)*2016-12-162020-04-21北京创世乐享科技有限公司Method and system for presenting multi-language form
CN107368309A (en)*2017-07-072017-11-21惠州Tcl移动通信有限公司Realize that application program supports multilingual method, storage device and mobile terminal
WO2019007414A1 (en)*2017-07-072019-01-10惠州Tcl移动通信有限公司Method for realizing support of application for multiple languages, storage device, and mobile terminal
CN109446796A (en)*2018-09-192019-03-08北京达佳互联信息技术有限公司Application control method and device, mobile terminal and storage medium
CN109344412A (en)*2018-09-202019-02-15五八有限公司A kind of language transfer method, device, equipment and storage medium
CN109634872A (en)*2019-02-252019-04-16北京达佳互联信息技术有限公司Application testing method, device, terminal and storage medium
CN109634872B (en)*2019-02-252023-03-10北京达佳互联信息技术有限公司Application testing method, device, terminal and storage medium
CN112035132A (en)*2019-05-152020-12-04北京京东尚科信息技术有限公司 Application language switching method and device
CN111241852A (en)*2020-01-072020-06-05北京字节跳动网络技术有限公司File translation method, device, terminal and storage medium
CN112835633A (en)*2020-12-172021-05-25海信视像科技股份有限公司Display device and control method of display language
CN112596839A (en)*2020-12-242021-04-02青岛海尔科技有限公司Language resource management method, operation terminal, storage medium and electronic device
CN115130029A (en)*2021-03-262022-09-30Oppo广东移动通信有限公司Starting window generation method and device, computer readable medium and electronic equipment
CN116208793A (en)*2021-11-302023-06-02Vidaa国际控股(荷兰)公司 A method for synchronizing application language and display device
CN116541117A (en)*2023-05-102023-08-04中国工商银行股份有限公司 Language switching method, device, storage medium and electronic device in application program

Similar Documents

PublicationPublication DateTitle
CN105824633A (en)Multi-language resource switching method and device of application program
CN107329742A (en)SDK call method and device
CN107315606A (en)Using update method and device
WO2017113666A1 (en)Application interface switching method and device
CN105808305B (en)Static resource loading method and device
CN106095455A (en)A kind of application update method and device
CN106528735A (en)Method and device for controlling browser to play media resources
CN105912363A (en)Module loading method and apparatus
CN107094094A (en)Networking methods, device and the terminal of application program
CN107301242A (en)Method, device and the storage medium of page jump
WO2016150104A1 (en)App theme loading method and device
CN107239351A (en)Method of attaching and device
CN107220059A (en)The display methods and device of application interface
CN104063424B (en)Web page picture shows method and demonstration device
CN107911482A (en)Intended application deployment method and device
CN107632835A (en)Using installation method and device
CN107463372A (en)The method for updating pages and device of a kind of data-driven
CN106060129A (en)Information processing method and device.
CN106407458A (en)Method and device for acquiring content of browser application program
CN106210258A (en) Web page access method and device
CN105912202A (en)Application sharing method and device
CN107179837B (en)Input method and device
CN108108206A (en)Mobile payment cut-in method and device
CN107239307A (en)The display methods and device of version updating information
CN107463414B (en)Application installation method and device

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication
RJ01Rejection of invention patent application after publication

Application publication date:20160803


[8]ページ先頭

©2009-2025 Movatter.jp