A multilingual dynamic updating method and device
By setting up a language server for the application, remote loading and local caching of language resources are achieved, solving the dynamic update problem of multilingual applications, reducing maintenance costs and improving response speed.
Patent Information
- Application Number
- CN202411538153.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2044-10-31
AI Technical Summary
In existing technologies, multilingual switching applications cannot be dynamically updated, resulting in high maintenance costs and the need to release new versions to adapt to new languages.
By setting up a language server for the application, the application can dynamically obtain language resources from the language server, enabling remote loading of language resources without modifying the application itself. New language resources can be imported into the language server, and local caching can be used to optimize network traffic and response speed.
It reduces the post-application maintenance cost, improves the response speed of language switching, reduces network traffic consumption, and enables dynamic updates and maintenance of the language.
Smart Images

Figure CN119473479B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of multi-language switching, in particular to a multi-language dynamic updating method and device. BACKGROUND
[0002] International language switching is a function required by many product applications, especially for overseas output applications. Users can select different languages for switching and use, such as switching between Chinese, English, Korean, Japanese and other languages.
[0003] The multi-language switching of the prior art application is mainly achieved by pre-writing translation resources of different languages into the application, such as embedding translation resources into the binary package of the software. In this implementation manner, the number of languages supported by the application for switching is fixed. If a new language needs to be adapted for the application, the developer needs to write the translation resources corresponding to the new language into the application, thereby generating a new version of the application. After the new version of the application is published to the network end, the user downloads the new version of the application from the network end and installs it on the user terminal, so as to realize the support of the new language for the application on the user terminal. Therefore, the existing technology has the problem of being unable to dynamically update and maintain the language, and the application needs to be re-published for new language adaptation, resulting in high maintenance cost in the later period.
[0004] Therefore, it is urgent to overcome the defects of the prior art in the technical field. SUMMARY
[0005] The technical problem to be solved by the present application is to provide a multi-language dynamic updating method.
[0006] The present application adopts the following technical solutions:
[0007] In a first aspect, the present application provides a multi-language dynamic updating method, comprising:
[0008] The application obtains the language identifier of the first language required to be used, wherein the first language is obtained by the application in response to the language switching operation of the user, or the first language is obtained by the application reading the system language of the user terminal;
[0009] According to the language identifier, the first language resource is obtained from the local storage, wherein the first language resource is the language resource matched with the language identifier;
[0010] If the first language resource is not successfully obtained from the local storage, the first language resource is obtained from the language server;
[0011] The first language resource is loaded onto the application interface to realize the language switching of the application.
[0012] Preferably, the first language resource is obtained from the language server, specifically comprising:
[0013] The user terminal establishes a connection with the language server through the application. If the user terminal successfully establishes a connection with the language server, the language resource request carrying the language identifier is sent to the language server to obtain the first language resource.
[0014] If the user terminal fails to establish a connection with the language server, a first prompt interface is popped up so that the user waits for the network recovery or connection of the user terminal according to the prompt on the first prompt interface.
[0015] Preferably, after the network of the user terminal is recovered, the method further comprises:
[0016] The second prompt interface is popped up to prompt the user to perform the language switching operation again.
[0017] Or, the user terminal re-establishes a connection with the language server through the application and obtains the first language resource from the language server.
[0018] Preferably, after the first language resource is obtained from the language server, the method further comprises:
[0019] The obtained first language resource is cached in the local storage so that the first language resource is obtained from the local storage when the user performs the language switching operation subsequently.
[0020] Preferably, the method further comprises:
[0021] Every interval of a preset period, it is judged whether the language resource in the local storage is used in the past preset time;
[0022] If the second language resource in the local storage is not used in the past preset time, the second language resource is deleted from the local storage.
[0023] Preferably, when the user opens the language switching interface of the application, the languages supported by the application are displayed on the language switching interface for the user to select the corresponding language to perform the language switching operation.
[0024] For the language corresponding to the language resource cached in the local storage, a cache identifier is marked on the language switching interface so that the user can identify the cached language resource through the cache identifier.
[0025] Preferably, the language resources in the local storage are managed using a directory file, and the caching of the obtained first language resource in the local storage specifically comprises:
[0026] cache the first language resource to a preset location of the local storage, and write the language identifier of the first language resource into the directory file.
[0027] Preferably, when the user opens the application, the method further comprises:
[0028] detecting whether the system language of the user terminal matches the language resource currently used by the application;
[0029] if it is detected that the system language of the user terminal does not match the language resource currently used by the application, a third prompt interface is popped up so that the user can select whether to switch to the system language on the third prompt interface.
[0030] Preferably, before detecting whether the system language of the user terminal matches the language resource currently used by the application, the method further comprises:
[0031] checking whether historical selection information exists, if the historical selection information exists, judging whether the language resource currently used by the application matches the historical language resource in the historical selection information, and whether the system language of the user terminal matches the historical system language in the historical selection information;
[0032] if the language resource currently used by the application matches the historical language resource in the historical selection information, and the system language of the user terminal matches the historical system language in the historical selection information, the third prompt interface is not popped up, and the language resource currently used by the application is directly continued to be used;
[0033] wherein the historical selection information is generated when the user selects not to switch to the system language on the historically popped-up third prompt interface, and the historical selection information includes the historical system language of the user terminal and the historical language resource of the application.
[0034] Preferably, after the language of the application is switched each time, or after it is detected that the system language of the user terminal is switched, the historical selection information is deleted.
[0035] Preferably, the application is a label making APP; the user terminal accesses a remote label server through the locally installed label making APP; when the user opens a label making interface of the label making APP, the method further comprises:
[0036] the label making APP sends a material library request to the label server; wherein the language identifier is carried in the material library request;
[0037] the label server acquires the language resource matched with the language identifier according to the language identifier;
[0038] Using the language resource, language switching is performed on the material object containing text in the first material library, a second material library matching the language identifier is generated, and the second material library is returned to the user terminal.
[0039] In a second aspect, the application further provides a multi-language dynamic updating device for implementing the multi-language dynamic updating method in the first aspect, and the device comprises:
[0040] at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to execute the multi-language dynamic updating method in the first aspect.
[0041] In a third aspect, the application further provides a non-volatile computer storage medium, which stores computer executable instructions, and the computer executable instructions are executed by one or more processors to complete the method in the first aspect.
[0042] In a fourth aspect, a chip is provided, which comprises a processor and an interface for calling and running a computer program stored in a memory to execute the method in the first aspect.
[0043] In a fifth aspect, a computer program product comprising instructions is provided, and when the instructions are executed on a computer or a processor, the computer or the processor executes the method in the first aspect.
[0044] The application implements remote loading of language resources by setting a language server for language resources and by applying a form of requesting language resources from the language server, and when an application needs to adapt to a new language, the application does not need to be modified, but the language resources of the new language are imported into the language server, so that the application supports the new language, thereby reducing the later maintenance cost of the application. BRIEF DESCRIPTION OF DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiments of the application. Obviously, the drawings described below are only some of the embodiments of the application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.
[0046] Figure 1 is a flowchart of the first multi-language dynamic updating method provided by the embodiments of the application;
[0047] Figure 2 is a schematic diagram of the first multi-language dynamic updating method provided by the embodiments of the application;
[0048] Figure 3 is a flowchart of a second multilingual dynamic updating method provided by an embodiment of the present application;
[0049] Figure 4 is a flowchart of a second multilingual dynamic updating method provided by an embodiment of the present application;
[0050] Figure 5 is a flowchart of a second multilingual dynamic updating method provided by an embodiment of the present application;
[0051] Figure 6 is a flowchart of a third multilingual dynamic updating method provided by an embodiment of the present application;
[0052] Figure 7 is a flowchart of a third multilingual dynamic updating method provided by an embodiment of the present application;
[0053] Figure 8 is a flowchart of a fourth multilingual dynamic updating method provided by an embodiment of the present application;
[0054] Figure 9 is a flowchart of a fourth multilingual dynamic updating method provided by an embodiment of the present application;
[0055] Figure 10 is a flowchart of a fifth multilingual dynamic updating method provided by an embodiment of the present application;
[0056] Figure 11 is a flowchart of a fifth multilingual dynamic updating method provided by an embodiment of the present application;
[0057] Figure 12 is a flowchart of a sixth multilingual dynamic updating method provided by an embodiment of the present application;
[0058] Figure 13 is a flowchart of a seventh multilingual dynamic updating method provided by an embodiment of the present application;
[0059] Figure 14 is a flowchart of an eighth multilingual dynamic updating method provided by an embodiment of the present application;
[0060] Figure 15 is a flowchart of a ninth multilingual dynamic updating method provided by an embodiment of the present application;
[0061] Figure 16 is a flowchart of a sixth multilingual dynamic updating method provided by an embodiment of the present application;
[0062] Figure 17 is a flowchart of a tenth multilingual dynamic updating method provided by an embodiment of the present application;
[0063] Figure 18 is a schematic diagram of the eleventh multilingual dynamic updating method provided by the embodiment of the present application;
[0064] Figure 19 is a schematic diagram of the twelfth multilingual dynamic updating method provided by the embodiment of the present application;
[0065] Figure 20 is a flowchart of the seventh multilingual dynamic updating method provided by the embodiment of the present application;
[0066] Figure 21 is a flowchart of the eighth multilingual dynamic updating method provided by the embodiment of the present application;
[0067] Figure 22 is a schematic diagram of the thirteenth multilingual dynamic updating method provided by the embodiment of the present application;
[0068] Figure 23 is a flowchart of the ninth multilingual dynamic updating method provided by the embodiment of the present application;
[0069] Figure 24 is a schematic diagram of the fourteenth multilingual dynamic updating method provided by the embodiment of the present application;
[0070] Figure 25 is a schematic diagram of the fifteenth multilingual dynamic updating method provided by the embodiment of the present application;
[0071] Figure 26 is a flowchart of the tenth multilingual dynamic updating method provided by the embodiment of the present application;
[0072] Figure 27 is a schematic diagram of the sixteenth multilingual dynamic updating method provided by the embodiment of the present application;
[0073] Figure 28 is a schematic diagram of the seventeenth multilingual dynamic updating method provided by the embodiment of the present application;
[0074] Figure 29 is a schematic diagram of the seventeenth multilingual dynamic updating method provided by the embodiment of the present application; DETAILED DESCRIPTION
[0075] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.
[0076] Unless otherwise required by context, as used herein, the term "comprises" or "comprising" is understood to be an open reference that specifies the presence of stated features, elements, integers, steps, or the like, but does not preclude the presence or addition of one or more other features, elements, integers, steps, or the like. In describing the present disclosure, the terms "one embodiment," "some embodiments," "exemplary embodiment," "an example," "a specific example," or "some examples," as may occur in the specification, are not necessarily all referring to the same embodiment or example. Furthermore, the terms "comprise," "comprising," "include," "including," "contain," "containing," "have," "having," "maintain," "maintaining," or the like are not necessarily limited to a positive disclosure of the stated features, elements, integers, steps, or the like, but rather are to be construed as specifying the presence of stated features, elements, integers, steps, or the like, but not precluding the presence or addition of one or more other features, elements, integers, steps, or the like.
[0077] In the description of the present disclosure, the terms "first", "second", etc. are used only to describe the purpose of description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features limited by "first", "second" can explicitly or implicitly include one or more of the features. In the description of the embodiments of the present disclosure, unless otherwise specified, the meaning of "multiple" is two or more. In addition, for example, in the description, the same type of nouns can also be described as two independent individuals by adding "A", "B" at the end, in which case the features limited by "A", "B" are only used for the purpose of distinguishing the description of the same type of individuals, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated.
[0078] In the description of the present disclosure, the expression "A and / or B" (where A and B are used to represent specific feature content in form) includes the following three combinations: only A, only B, and the combination of A and B.
[0079] As used herein, "about," "approximately," or "circa" in connection with a value includes the recited value and the average value within an acceptable range of deviation from the particular value, as determined by one of ordinary skill in the art taking into account the measurement at issue and the error associated with measuring the particular quantity (i.e., the limitations of the measurement system).
[0080] In addition, the technical features involved in each of the embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.
[0081] Embodiment 1:
[0082] Embodiment 1 of the present application provides a multi-language dynamic updating method, as shown in Figure 1 the figure, comprising:
[0083] In step 201, the application acquires the language identifier of the first language required to be used; wherein the first language is acquired by the application in response to the language switching operation of the user, and the language switching operation can be that the user selects a corresponding language as the first language after operating into the language switching interface on the application, as shown in Figure 2 The languages on the language switching interface are obtained by the application from the language server in advance, that is, the corresponding language identifier is set for each supported language in the language server, and a language corresponds to a unique language identifier. In actual use, the name of the language can be directly used as the language identifier, or the language identifier can be customized. The application obtains the supported language list message from the language server in advance, and the language list message includes the language identifier and the name of each language. These languages are displayed on the language switching interface for the user to select. After the first language is determined, the language identifier corresponding to the first language is found in the language list message. Or the first language is obtained by the application reading the system language of the user terminal; in actual use, when the user installs and starts the application on the user terminal for the first time, the application determines the system language of the user terminal according to the language environment of the user terminal, and uses the system language as the first language.
[0084] In step 202, the first language resource is acquired from the local storage according to the language identifier; wherein the first language resource is the language resource matched with the language identifier; some commonly used language resources can be placed in the installation package of the application by those skilled in the art in advance, and the language resources are cached in the local storage when the user installs the application. These commonly used language resources can be directly obtained in the local storage in subsequent use. The local storage is the memory of the user terminal.
[0085] In step 203, if the first language resource is not successfully acquired from the local storage, the first language resource is acquired from the language server; wherein each language resource can be generated by those skilled in the art in advance and imported into the language server. When a supported language needs to be added, those skilled in the art only need to import the corresponding language resource into the language server, so that the application can support the newly added language in subsequent use.
[0086] In step 204, the first language resource is loaded onto the application interface to realize the language switching of the application.
[0087] The steps 201-204 can be understood as: the language resource is preferentially obtained from the local storage, and if the language resource cannot be obtained, the language resource is obtained from the language server. In the preferred embodiment, after the first language resource is obtained from the language server, the method further comprises: caching the obtained first language resource to the local storage, so that the first language resource is obtained from the local storage when the user performs the language switching operation subsequently.
[0088] The embodiment realizes the remote loading of the language resource by setting the language server for the language resource and by the form that the application requests the language resource from the language server, and when the application needs to adapt to a new language, the application itself does not need to be changed, but the language resource of the new language is imported into the language server, so that the application supports the new language, thereby reducing the later maintenance cost of the application. And the obtained language resource is cached to the local storage, so that the user does not need to request the language server again when the language resource is used subsequently, thereby reducing the network traffic occupation and improving the corresponding rate of language switching.
[0089] In an optional embodiment, the first language resource is obtained from the language server, and the method comprises: Figure 3 As shown in the figure, specifically comprising:
[0090] In step 301, the user terminal establishes a connection with the language server through the application, and if the user terminal and the language server establish a connection successfully, the language resource request carrying the language identifier is sent to the language server to obtain the first language resource; the language resource request carries the language identifier of the required language.
[0091] In step 302, if the user terminal and the language server fail to establish a connection, a first prompt interface is popped up, so that the user waits for the network recovery or connection of the user terminal according to the prompt on the first prompt interface. In an optional embodiment, the first prompt interface is as shown in the figure, and the first prompt interface displays the prompt "the network is not good, and the language resource cannot be obtained, please operate after the network is recovered", or displays "the network is not connected, and the language resource cannot be obtained, please connect the network and then operate". Figure 4
[0092] And after the network of the user terminal is recovered, the method further comprises: the application pops up a second prompt interface to prompt the user to perform the language switching operation again; or the user terminal re-establishes a connection with the language server through the application and obtains the first language resource from the language server. The second prompt interface is as shown in the figure, and the second prompt interface displays "the network is recovered, please select the language again". Figure 5
[0093] Wherein, after the first prompt interface is popped up, the network condition is detected in real time, when the network is detected to be recovered, the second prompt interface is popped up, and after the user clicks the application interface, the second prompt interface is automatically closed, so that the user can select the language. If the user closes the first prompt interface, it is considered that the user gives up the language switching, and the interface of the application is returned to the upper interface, that is, the language switching interface is exited.
[0094] In view of the fact that the storage space of the user terminal is limited in the actual application scenario, in order to avoid that the language resources occupy a large amount of storage space, the method further comprises: every interval preset period, judging whether the language resources in the local storage are used in the past preset time; if the second language resources in the local storage are not used in the past preset time, the second language resources are deleted from the local storage. The preset period and the preset time are obtained by the person skilled in the art according to experience analysis, and in actual use, the preset period can be one month, and the preset time can be 1 year.
[0095] In a specific application scenario, when the user opens the language switching interface of the application, the supported languages of the application are displayed on the language switching interface, so that the user can select the corresponding language for language switching operation; for the language corresponding to the language resources cached in the local storage, a cache mark is marked on the language switching interface, so that the user can identify the cached language resources through the cache mark, such as Figure 4 As shown in the figure, the "cached" icon is displayed on the right side of the corresponding language as a cache mark.
[0096] In order to facilitate the management of the language resources in the local storage, in the preferred embodiment, the directory file is also used to manage the language resources in the local storage, and the first language resources obtained are cached in the local storage, specifically comprising: caching the first language resources in the preset position of the local storage, and writing the language identifier of the first language resources into the directory file. The preset position is obtained by the person skilled in the art, and is used to store the language resources. The directory file can be in the form of a csv file, and the language identifier and the language name of the language resources in the local storage are stored in the directory file, so that the application can find out which language resources are cached in the local storage by reading the directory file. In actual use, the directory file also stores the time when the application switches to the corresponding language resource last time, so that the application can manage the storage period of the language resources according to the time recorded in the directory file, that is, if it is not used in the past preset time, the corresponding language resources are deleted.
[0097] In view of the fact that in actual use, the language selected by the user on the language switching interface can not be consistent with the system language of the user terminal, in order to cope with this scenario, the present embodiment also provides a preferred implementation, namely, when the user opens the application, the method further comprises: detecting whether the system language of the user terminal matches the language resource currently used by the application; if it is detected that the system language of the user terminal does not match the language resource currently used by the application, a third prompt interface is popped up so as to allow the user to select on the third prompt interface whether to switch to the system language. In an implementation, the third prompt interface displays a prompt "the current language is inconsistent with the system language, do you want to switch to the system language?" as shown in FIG. 3B, when the user clicks the "keep in the current language" button, the system language is not switched to, and when the user clicks the "switch to the system language" button, the method described in steps 201-204 above is executed to switch the application to the system language. Figure 6
[0098] In the preferred implementation, before detecting whether the system language of the user terminal matches the language resource currently used by the application, the method further comprises: Figure 7
[0099] In step 401, it is checked whether there is historical selection information, if there is historical selection information, it is judged whether the language resource currently used by the application matches the historical language resource in the historical selection information, and whether the system language of the user terminal matches the historical system language in the historical selection information.
[0100] In step 402, if the language resource currently used by the application matches the historical language resource in the historical selection information, and the system language of the user terminal matches the historical system language in the historical selection information, the third prompt interface is not popped up, and the language resource currently used by the application is directly continued to be used; wherein the historical selection information is generated when the user selects not to switch to the system language on the third prompt interface which is historically popped up, and the historical selection information comprises the historical system language of the user terminal and the historical language resource of the application. Furthermore, the historical selection information is deleted after each language switching of the application, or after detecting the system language switching of the user terminal.
[0101] The steps 401-402 can be understood as follows: when the user selects "keep in current language" on the third prompt interface, the language used at this time and the system language used by the user terminal at this time are recorded into the historical selection information, and when the application is opened subsequently, it is first judged according to the historical selection information whether the user has selected to keep the current language of the application under the same language environment condition, if it is judged that the user has selected to keep the current language, the third prompt interface is not popped up, but the application interface is directly entered in the current language, otherwise, after it is judged that the system language is different from the current language of the application, the third prompt interface is popped up. The purpose of this implementation is to avoid repeated popping up of the third prompt interface, and by deleting the historical selection information after language switching, the third prompt interface is supported to be popped up again for user selection.
[0102] Embodiment 2:
[0103] On the basis of embodiment 1, this embodiment further combines a specific application scenario to provide a preferred implementation, that is, in an actual application scenario, the application is a label making APP; the user terminal accesses a remote label server through a locally installed label making APP, when the user opens a label making interface of the label making APP, as shown in Figure 8 The multilingual dynamic updating method of this embodiment further includes:
[0104] In step 501, the label making APP sends a material library request to the label server; wherein the language identifier is carried in the material library request; the material library request also contains the requested label id.
[0105] In step 502, the label server acquires language resources matched with the language identifier according to the language identifier.
[0106] In step 503, the language resources are used to switch the language of the material objects containing text in the first material library, to generate a second material library matched with the language identifier, and to return the second material library to the user terminal.
[0107] The material objects containing text mainly refer to material objects in the form of vector objects and containing text elements, such as svg format vector objects containing <text>< / text> elements. Other forms of material objects, such as vector objects not containing text elements, vector objects with text in the form of path and non-vector objects (such as high-resolution objects) are not within the scope of language switching.
[0108] In practical use, tags containing source objects also switch languages along with the source objects. This language switching is primarily achieved by hiding and showing text elements within the vector object. Specifically, the designers pre-set text elements in multiple languages within the vector object. For example, a vector object in the first source object might contain the text element "...". <text>8:00 breakfast< / text> " and text elements are " <text>8:00 breakfast< / text> By modifying the display property of these two text elements, one can be hidden and the other shown, thus achieving the switching of the language of the vector object. Figure 9 Switch to as shown Figure 10 The interface shown.
[0109] The first resource library is typically created by graphic designers on their workstations; that is, the first resource library originates from the graphic designer's workstation. Figure 11 As shown, specifically:
[0110] In step 601, the graphic designer terminal establishes a collaborative process with the user terminal through the tag server. The graphic designer terminal's first material library is stored locally or on a tag server within a local area network and possesses its original resolution. The establishment of this collaborative process begins after the user opens a tag sent to the user terminal by the graphic designer terminal via the tag server. Figure 12 As shown, after clicking the "Collaborative Modification" button, a collaboration request message is sent to the graphic designer's terminal. The graphic designer's terminal displays a collaboration request window based on the collaboration message. After the graphic designer accepts the collaboration in the collaboration request window, the collaboration process is successfully established, and the user enters the tag creation interface.
[0111] If the graphic designer's primary resource library is stored locally, collaboration is only supported when the graphic designer is online (i.e., the graphic designer has established a connection with the tag server). When the graphic designer is offline (i.e., the graphic designer has not established a connection with the tag server), the tag creation app displays a corresponding collaboration failure message. If the graphic designer's primary resource library is stored on a local area network, collaboration is supported when the graphic designer is offline, and any modifications made to the tags by the user during collaboration will be updated on the graphic designer's tag creation interface the next time the graphic designer is opened.
[0112] For high-resolution objects, the original resolution refers to the fixed pixel size of the object. For vector objects, the original resolution refers to the original pixel size set by the vector object. For example, for SVG objects, the width of the original resolution is the value corresponding to the `width` tag in the SVG file, and the height of the original resolution is the value corresponding to the `height` tag in the SVG file.
[0113] The original resolution is for high-resolution objects, and for material objects of a vector object, the original resolution can be understood as a resolution that is clearly displayed on an art terminal and is pre-calculated by a person skilled in the art.
[0114] In step 602, after language switching of the material object containing text in the first material library, the label server generates a set of second material libraries with resolution adaptation for the user terminal according to the terminal screen size, screen resolution and selected label size; wherein the resolution adaptation is realized by resolution compression of the first material library with the original resolution by the label server in advance.
[0115] The terminal screen size is specifically the screen size of the user terminal, and the screen resolution includes the screen resolution of the user terminal and the screen resolution of the art terminal. The resolution adaptation rule of the second material library is pre-analyzed by a person skilled in the art according to experience, specifically: taking clear display on the user terminal and insufficient clear display for producing labels as the basis, the resolution adaptation rule of the second material library is analyzed, and the resolution adjustment also shows the pixel size adjustment of the material object in actual use. That is, as shown in the figure, the material objects in the first material library are first language-switched, and then resolution compressed to obtain the material objects in the second material library, and in the resolution compression, for a vector object, it is directly converted into an image object with the required resolution. Figure 13
[0116] The first material library can be understood as a collection of a plurality of material objects.
[0117] The size of each material object in the second material library is calculated using the following first formula:
[0118]
[0119] Wherein, W' is the width after resolution compression, W is the width of the original resolution, H' is the height after resolution compression, H is the height of the original resolution, W u is the width of the user terminal, H u is the height of the user terminal, W c is the width of the art terminal, H c is the height of the art terminal, and the unit is px, min() represents the minimum value in the selected brackets, and k is a compression multiple analyzed by a person skilled in the art according to experience, k is greater than 0 and less than or equal to 1.
[0120] For example, the size of the art terminal is 31.5 inches, and the resolution is 2560x1440, the size of the user terminal is 6.7 inches, and the resolution is 1440x2560, when the corresponding material object is a high-resolution object with a fixed pixel size of (W, H) (unit: px), or when the corresponding material object is a vector object, and the original pixel size set is (W, H) (unit: px), then the size of the resolution compression is As shown in Figure 13 , the material object with original resolution of (256, 256) size is compressed to (144, 144) size.
[0121] The second material library is presented in the form of a thumbnail on the label making APP, as shown in Figure 10 , but the corresponding second material library with adaptive resolution is stored in the memory of the user terminal, and when the user pulls the corresponding thumbnail to the label making area of the label making APP, the corresponding material object in the second material library is read from the memory and loaded into the label making area.
[0122] In actual use, for the art worker, if the vector object needs to support multiple languages, it is necessary to add a "text group" on the material object making interface of the art terminal, and add text elements of multiple languages in the text group, as shown in Figure 14 , wherein the art terminal communicates with the language server to obtain the language list message supported by the language server, so as to obtain the name and language identification of each language, and when the art worker adds text in the text group and sets the corresponding language, a text element is generated in the corresponding vector object, and the language identification of the language is included in the id of the text element, for example, if the language identification of the language "Simplified Chinese" is set as "china" in the language server, when the text with the language "Simplified Chinese" is added, the id of the text element can be generated by combining the text group id, "china", and the sorting number of the text in the text group, for example, as shown in Figure 15 , and correspondingly, when the language is switched in the label server, the text element is searched in the material object, and it is confirmed whether the language identification of the required switching language is included in the text element, if the language identification exists, the display attribute value of the text element is set to block to make it display, otherwise, the display attribute value of the text element is set to none to make it hidden.
[0123] The embodiment can establish the collaborative modification between the user and the graphic designer, realize the connection between the user and the graphic designer, accurately feed back the changes of the materials on the label to the graphic designer, improve the efficiency of label customization and modification, provide a way for the user to modify, improve the satisfaction of the user, and combine the implementation mode in the above embodiment. The embodiment can connect the complete process of the user-graphic designer-supply chain, greatly improve the efficiency of label customization and production. Moreover, the resolution compressed material object is sent to the user terminal. Since the quality of the compressed material object will be lost after being enlarged, the user cannot use it for subsequent label production, but only for effect reference browsing on the user terminal, thereby effectively protecting the rights of the graphic designer's label product and avoiding the label being stolen by the user.
[0124] In an optional implementation mode, after the user terminal pulls at least two material objects from the second material library and arranges the material objects according to one or more of the preset layer relationship, position relationship, perspective degree and size scaling, the method further includes: Figure 16
[0125] In step 701, the label making APP acquires a first execution request for replacing a selected material object in the label; the first execution request can be that the user long-presses a corresponding material object in the label or clicks the replace material icon in the upper left corner of the material after clicking the corresponding material object, as shown in Figure 17
[0126] In step 702, the label making APP generates a replaceable material display message according to the identification of the selected material object and the scaling degree of the selected material object carried in the first execution request, and sends the replaceable material display message to the label server through the user terminal.
[0127] In step 703, the label server determines the type attribute of the replaceable material according to the identification of the selected material object, and filters out a material object set for constituting a first replaceable material sub-library according to the type attribute; the identification of the material object is automatically generated when the graphic designer creates the corresponding material, and one material object corresponds to one unique identification. Moreover, the graphic designer creates a material library before creating a material object, each material library corresponds to a type attribute, and the graphic designer creates a material object in the corresponding material library. The created material object has the type data of the material library. The filtering out of the material object set for constituting the first replaceable material sub-library according to the type attribute is that all material objects in the material library where the selected material object is located are filtered out.
[0128] In step 704, the label server uses the language resource to switch the language of the material object containing text in the material object set, and according to the zooming degree of the selected material object, the resolution of each material object associated with the material object set is processed to meet the resolution of the clearness after zooming, and a first replacement material sub-library with adaptive resolution is obtained; the language replacement method has been described in detail in the above embodiments, and will not be repeated here.
[0129] The resolution of the material object in the first replacement material sub-library is calculated using the following second formula:
[0130]
[0131] Where W' is the width of the material object in the first replacement material sub-library, W is the width of the original resolution, H' is the width of the material object in the first replacement material sub-library, H is the height of the original resolution, W u is the width of the user terminal, H u is the height of the user terminal, W c is the width of the art terminal, H c is the height of the art terminal, all in px, min() represents the minimum value in the brackets, and scaleTimes is the magnification of the selected material object.
[0132] As Figure 18 shown, still taking k as 1 as an example, assuming that the resolution of the selected material object in the second material library is (144, 144), and it is enlarged to (216, 216) in the label making area, the resolution of the selected material object corresponding to the first material library is (256, 256), and there is another material object, which has the same type attribute as the selected material object, and the resolution of the material object corresponding to the first material library is (256, 280), then the resolution of the material object corresponding to the first replacement material sub-library when the material object is selected and used as a material object in the first replacement material sub-library is i.e. (216, 236), as Figure 19 shown.
[0133] In step 705, the first replacement material sub-library with adaptive resolution is returned to the user terminal for completing the display of replaceable material on the label making APP interface.
[0134] It is emphasized here that the optional material objects displayed in the label making APP are still presented in the form of thumbnails, and the first replacement material sub-library is only cached in the background. When the user selects to replace the selected material object by clicking the thumbnail, the resolution-adapted material object in the first replacement material sub-library is loaded onto the label in the label making APP interface.
[0135] In actual use, as shown in Figure 20 , the method further comprises:
[0136] In step 706, for the replacement operation of the selected material object completed in the label making APP interface of the user terminal side, an update message carrying the identification of the replaced material object is sent to the label server via the user terminal.
[0137] In step 707, the label server forwards the update message to the art designer terminal, so that the art designer terminal obtains the replaced material object of the corresponding original resolution according to the identification of the replaced material object carried in the update message and updates it to the label making interface on the art designer terminal. In fact, the replaced material object of the original resolution is scaled by a multiple matching the selected material object and then updated to the label making interface on the art designer terminal, which is still presented in the form of thumbnails. Figure 18 and Figure 19 For example, if the selected material object is enlarged by times, and the original resolution of the replaced material object is (256, 280), the resolution of the replaced material object on the label making interface on the art designer terminal is , i.e. (384, 420).
[0138] In a preferred embodiment, the first replacement material sub-library with the resolution adapted to the user terminal is returned for the display of replaceable material objects on the label making APP interface, specifically comprising:
[0139] According to the terminal screen size and the label making APP interface setting mode, the number n of replaceable material objects that can be displayed in one round is determined; wherein the label making APP interface setting mode includes multiple modes such as display with medium icons, display with large icons, and display with small icons.
[0140] The number n is calculated according to a calculation rule of the number n obtained by a person skilled in the art based on the size of the thumbnail displayed on the label making APP interface (different label making APP interface setting modes can correspond to different thumbnail sizes), and the size and spacing of each component on the label making APP interface, and then the terminal screen size is substituted into the calculation rule to obtain the number n.
[0141] The first replacement material sub-library with the resolution is equally divided according to the number n, and the delivery and display of the replaceable material to the user terminal are completed in a batch sending mode under a paging operation or a batch sending mode under a scroll bar operation.
[0142] As shown in Figure 17 n is 19, the 19 replaceable materials are returned to the user terminal, the user terminal stores the 19 replaceable materials into the file system, and displays the thumbnails of the 19 replaceable materials on a page; wherein the thumbnails are all generated after loading the second material library, specifically: generating the thumbnails of each material object in the second material library, and making these thumbnails carry the identification matched with the corresponding material object, when it is needed to display the thumbnail, the corresponding thumbnail is selected for display using the identification of the material object, otherwise, when the user selects the corresponding thumbnail, the corresponding material object is selected through the identification of the thumbnail.
[0143] In an actual application scenario, as shown in Figure 21 The method further comprises:
[0144] In step 801, the label making APP obtains a second execution request of reducing or increasing the resolution of a selected material object; the second execution request can be that after clicking on the selected material object, the resolution adjustment icon at the lower left corner of the selected box is clicked to pop up the resolution adjustment box, as shown in Figure 22 After selecting the corresponding resolution as the resolution of the material object in the resolution adjustment box, the determination button is clicked.
[0145] In step 802, the label making APP sends the identification of the selected material object carried in the second execution request to the label server through the user terminal, so that the label server synchronizes the material objects of the selected material object at different resolution levels to the user terminal; the resolution level is not higher than a preset multiple of the resolution of the corresponding material object in the second material library, and the preset multiple is obtained by a person skilled in the art according to demand analysis, and the preset multiple is greater than or equal to 1.
[0146] In step 803, after completing a round of second execution request on the user terminal side, the user terminal sends a synchronization message to the label server, so that the label server synchronizes the modified resolution level of the selected material object on the current user terminal side to the art designer terminal.
[0147] In the process of synchronizing the resolution level of the selected material object modified by the current user terminal to the art designer terminal, the corresponding resolution level is the resolution level adjusted in the process of generating the second material library. Assuming that the pixel size of the corresponding material object in the first material library is (W, H), the pixel size of the material object in the second material library after conversion is (W', H'), and the pixel size of the material object is changed to (W", H") after the user's zoom-in or zoom-out operation, the user adjusts the resolution of the material object to 0.8 times the resolution, and the pixel size of the material object is changed to (0.8×W", 0.8×H"). Correspondingly, the pixel size of the material object synchronized to the art designer terminal is
[0148]
[0149] It should be noted that the resolution adjustment in steps 701-702 is different from the resolution adjustment in the other embodiments in that the resolution adjustment in the other embodiments is based on the physical size of the material object on the label making area, while the resolution adjustment in steps 701-702 is directly performed while keeping the physical size of the material object on the label making area unchanged, thereby changing the clarity or blur of the material object on the label making area, which is usually used to blur the material object in the background pixels.
[0150] The present embodiment also provides a preferred embodiment, i.e., when the user selects a specified type of background layer, wherein the specified type includes an array type and a single object zoom-in type, as shown in Figure 23 The method further comprises:
[0151] In step 901, when the user releases the dragged and zoomed-in non-background layer element beyond a first preset value, the label making APP generates a prompt window to confirm whether to arrange the first material object currently being dragged and zoomed-in according to the current background layer type to generate a new background layer; wherein the first preset value is obtained by experienced analysis by those skilled in the art.
[0152] In step 902, after obtaining the confirmation that the first material object currently being dragged and zoomed-in generates a new background layer, as shown in Figure 24 After clicking the "replace to background layer" button, the first material object currently being dragged and zoomed-in is adjusted according to the array mode or zoom-in proportion of the previous background layer to be replaced to generate a new background layer. The label after replacement is as shown in Figure 25
[0153] There is an alternative embodiment that when the user selects a type of background layer, wherein the type includes an array type and a single object magnification type, as shown in Figure 26 the method further comprises:
[0154] In step 1001, when the user releases a single object magnification type background layer element after dragging and reducing it beyond a second preset value, the label making APP generates a prompt window to confirm whether to generate an icon type material object of the currently dragged and reduced background layer; wherein the second preset value is obtained by experienced analysis by those skilled in the art.
[0155] In step 1002, after obtaining the confirmation of generating an icon type material object of the currently dragged and reduced background layer, as shown in Figure 27 after clicking the "generate new material object" button, an icon type material object is generated according to the size at the time of release, as shown in Figure 28 The generated new material object will be displayed in the personal icon library.
[0156] Embodiment 3:
[0157] As shown in Figure 29 is a schematic diagram of the architecture of the multi-language dynamic updating device of the embodiment of the application. The multi-language dynamic updating device of the embodiment includes one or more processors 21 and a memory 22. Among them, Figure 29 take one processor 21 as an example.
[0158] The processor 21 and the memory 22 can be connected through a bus or other means, Figure 29 take the connection through the bus as an example.
[0159] The memory 22 is a kind of non-volatile computer readable storage medium, which can be used to store non-volatile software programs and non-volatile computer executable programs, such as the multi-language dynamic updating method in embodiment 1. The processor 21 executes the multi-language dynamic updating method by running the non-volatile software programs and instructions stored in the memory 22.
[0160] The memory 22 can include a high-speed random access memory, and can also include a non-volatile memory, for example, at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 22 can optionally include a memory remotely arranged with respect to the processor 21, and these remote memories can be connected to the processor 21 through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0161] The program instructions / modules are stored in the memory 22, and when executed by the one or more processors 21, perform the multilingual dynamic updating method in the above embodiment 1.
[0162] It is worth noting that the information interaction, execution process, etc. between the modules and units in the above device and system, since the same concept as the processing method embodiments of the present application, the specific content can be seen in the description of the method embodiments of the present application, here will not be repeated.
[0163] Those skilled in the art can understand that all or part of the steps in the various embodiments of the method can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer readable storage medium, which can include read only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc.
[0164] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A multi-lingual dynamic updating method, characterized in that, The method comprises the following steps: obtaining a language identifier of a first language required by an application; wherein the first language is obtained by the application in response to a language switching operation of a user, or the first language is obtained by the application reading a system language of a user terminal; obtaining a first language resource from a local storage according to the language identifier; wherein the first language resource is a language resource matched with the language identifier; if the first language resource is not successfully obtained from the local storage, obtaining the first language resource from a language server; loading the first language resource on an application interface to realize language switching of the application; when the user opens the application, the method further comprises the following steps: detecting whether the system language of the user terminal matches the language resource currently used by the application; if it is detected that the system language of the user terminal does not match the language resource currently used by the application, a third prompt interface is popped up so that the user selects whether to switch to the system language on the third prompt interface; before detecting whether the system language of the user terminal matches the language resource currently used by the application, the method further comprises the following steps: checking whether historical selection information exists; if the historical selection information exists, it is judged whether the language resource currently used by the application matches the historical language resource in the historical selection information, and whether the system language of the user terminal matches the historical system language in the historical selection information; if the language resource currently used by the application matches the historical language resource in the historical selection information, and the system language of the user terminal matches the historical system language in the historical selection information, the third prompt interface is not popped up, and the language resource currently used by the application is directly continued to be used; 2. The multi-lingual dynamic updating method of claim 1, wherein, wherein the historical selection information is generated when the user selects not to switch to the system language on the third prompt interface which is historically popped up, and the historical selection information comprises the historical system language of the user terminal and the historical language resource of the application. The method of obtaining the first language resource from the language server comprises the following steps: the user terminal establishes a connection with the language server through the application; if the user terminal successfully establishes a connection with the language server, a language resource request carrying the language identifier is sent to the language server to obtain the first language resource; 3. The method of claim 2, wherein, if the user terminal fails to establish a connection with the language server, a first prompt interface is popped up so that the user waits for the network of the user terminal to recover or connect to the network according to the prompt on the first prompt interface. After the network of the user terminal recovers, the method further comprises the following steps: the application pops up a second prompt interface to prompt the user to perform a language switching operation again; 4. The method of claim 1, wherein, or, the user terminal re-establishes a connection with the language server through the application, and obtains the first language resource from the language server. After obtaining the first language resource from the language server, the method further comprises the following steps:
5. The method of claim 4, wherein, the obtained first language resource is cached in the local storage so that the first language resource is obtained from the local storage when the user performs a language switching operation subsequently. The method further comprises the following steps: every interval of a preset period, it is judged whether the language resource in the local storage is used within a preset time in the past; If the second language resource in the local storage is not used in a preset time in the past, the second language resource is deleted from the local storage.
6. The method of claim 4, wherein, When the user opens the language switching interface of the application, the supported languages of the application are displayed on the language switching interface for the user to select a corresponding language for language switching operation. For the language corresponding to the language resource cached in the local storage, a cache mark is marked on the language switching interface, so that the user can identify the cached language resource through the cache mark.
7. The method of claim 4, wherein, The language resources in the local storage are managed using a directory file, and the first language resource obtained is cached in the local storage, specifically including: The first language resource is cached in a preset position of the local storage, and the language identifier of the first language resource is written into the directory file.
8. The method of claim 1, wherein, The history selection information is deleted after each language switching of the application or after detecting the system language switching of the user terminal.
9. The method of claim 1-8, wherein, The application is a label making APP; the user terminal accesses a remote label server through the locally installed label making APP; when the user opens the label making interface of the label making APP, the method further includes: The label making APP sends a material library request to the label server; wherein the material library request carries the language identifier; The label server acquires language resources matched with the language identifier according to the language identifier; The language resources are used to perform language switching on the material objects containing text in the first material library, to generate a second material library matched with the language identifier, and to return the second material library to the user terminal.
10. A non-transitory computer storage medium, comprising, The computer storage medium stores computer executable instructions, which are executed by one or more processors to complete the multi-language dynamic updating method of any one of claims 1-9.
11. A multi-lingual dynamic updating apparatus, characterized by comprising: The device includes: At least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to execute the multi-language dynamic updating method of any one of claims 1-9.
Citation Information
Patent Citations
Method and device for multi-language switching of application program
CN104020991A