Multi-language dynamic updating method and device
By setting up a language server for language resources, dynamic updates and maintenance of multilinguals are realized, and the problem of not being able to update language dynamically in the existing technology is solved, which reduces maintenance costs and improves the efficiency of language switching.
Patent Information
- Application Number
- CN202411538153.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-10-31
AI Technical Summary
The existing technology cannot realize dynamic updates and maintenance of multilinguals, resulting in applications requiring re-release of new versions to adapt to new languages, increasing the cost of later maintenance.
Remote loading of language resources is achieved by setting up a language server for language resources and requesting language resources from the application to the language server. There is no need to change the application, just import the language resources of the new language to the language server to achieve the application's support for the new language.
It reduces the cost of the application's post-maintenance, realizes dynamic language updates and maintenance, reduces the network traffic occupancy of user terminals, and improves the response rate of language switching.
Smart Images

Figure CN119473479A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multi-language switching, and in particular to a multi-language dynamic updating method and device. Background Art
[0002] International language switching is a function required by many product applications, especially for applications exported overseas. Users can choose different languages to switch, such as switching between Chinese, English, Korean, Japanese and other languages.
[0003] The multi-language switching of existing technology center applications is mainly achieved by pre-writing translation resources of different languages into the application, such as pre-embedding the translation resources into the binary package of the software. In this implementation method, the number of languages supported by the application 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 to generate a new version of the application. After the new version of the application is released to the network, the user downloads it from the network and installs the new version of the application on the user terminal, so that the application on the user terminal can support the new language. Therefore, the problem faced by the existing technology is that it is impossible to dynamically update and maintain the language. The application needs to adapt to the new language in the later stage and also needs to re-release a new version, resulting in relatively high maintenance costs in the later stage.
[0004] In view of this, overcoming the defects of the prior art is an urgent problem to be solved in the field of this technology. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a multi-language dynamic updating method.
[0006] The present invention adopts the following technical solution:
[0007] In a first aspect, the present invention provides a multi-language dynamic update method, comprising:
[0008] The application obtains a language identifier of a first language to be used; 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;
[0009] According to the language identifier, obtaining a first language resource from local storage; wherein the first language resource is a language resource matching 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 implement language switching of the application.
[0012] Preferably, the acquiring the first language resource from the language server specifically includes:
[0013] The user terminal establishes a connection with the language server through the application. If the user terminal successfully establishes the 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;
[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 can wait for the network of the user terminal to recover or connect to the network according to the prompt on the first prompt interface.
[0015] Preferably, after the network of the user terminal is restored, the method further comprises:
[0016] The app pops up a second prompt interface to prompt the user to switch the language again;
[0017] Alternatively, 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 obtaining the first language resource from the language server, the method further comprises:
[0019] The obtained first language resource is cached in the local storage, so that the user can obtain the first language resource from the local storage when performing a subsequent language switching operation.
[0020] Preferably, the method further comprises:
[0021] At each preset period, determining whether the language resources in the local storage have been used within the past preset time;
[0022] If the second language resource in the local storage has not been used within 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 so that the user can select the corresponding language to perform a language switching operation;
[0024] For the languages 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.
[0025] Preferably, the language resources in the local storage are managed using a directory file, and the step of caching the acquired first language resources in the local storage specifically includes:
[0026] The first language resource is cached to a preset location of local storage, and the language identifier of the first language resource is written into the directory file.
[0027] Preferably, when the user opens the application, the method further includes:
[0028] Check whether the system language of the user terminal matches the language resources 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 to facilitate the user to 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 includes:
[0031] Find whether there is historical selection information. If there is historical selection information, determine 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 will not be popped up, and the language resource currently used by the application will be directly used;
[0033] The historical selection information is generated when the user chooses not to switch to the system language in the third prompt interface that pops up in history, and the historical selection information includes the historical system language of the user terminal and the historical language resources of the application.
[0034] Preferably, after each language switch of the application or after detecting a system language switch of the user terminal, the historical selection information is deleted.
[0035] Preferably, the application is a label making APP; the user terminal accesses the remote label server through the locally installed label making APP, and when the user opens the label making interface of the label making APP, the method further includes:
[0036] The label making APP sends a material library request to the label server; wherein the material library request carries the language identifier;
[0037] The tag server obtains a language resource matching the language identifier according to the language identifier;
[0038] The language resource is used to switch the language of the material objects containing text in the first material library, to generate a second material library matching the language identifier, and the second material library is returned to the user terminal.
[0039] In a second aspect, the present invention further provides a multi-language dynamic updating device, which is used to implement the multi-language dynamic updating method described in the first aspect, and the device comprises:
[0040] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to execute the multi-language dynamic update method described in the first aspect.
[0041] In a third aspect, the present invention further provides a non-volatile computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are executed by one or more processors to complete the method described in the first aspect.
[0042] In a fourth aspect, a chip is provided, comprising: a processor and an interface, for calling and running a computer program stored in the memory from a memory, and executing the method of the first aspect.
[0043] According to a fifth aspect, a computer program product comprising instructions is provided. When the instructions are executed on a computer or a processor, the computer or the processor executes the method according to the first aspect.
[0044] The present invention realizes remote loading of language resources by setting a language server for language resources and requesting language resources from the language server through an application. When an application needs to adapt to a new language, there is no need to modify the application itself. Instead, the language resources of the newly added language are imported into the language server, so that the application can support the newly added language, thereby reducing the subsequent maintenance cost of the application. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0046] Figure 1 is a flowchart of a first multi-language dynamic update method provided by an embodiment of the present invention;
[0047] Figure 2 is a schematic diagram of a first multi-language dynamic update method provided by an embodiment of the present invention;
[0048] Figure 3 is a flow chart of a second multi-language dynamic updating method provided by an embodiment of the present invention;
[0049] Figure 4 is a schematic diagram of a second multi-language dynamic update method provided by an embodiment of the present invention;
[0050] Figure 5 is a schematic diagram of a second multi-language dynamic update method provided by an embodiment of the present invention;
[0051] Figure 6 is a schematic diagram of a third multi-language dynamic update method provided by an embodiment of the present invention;
[0052] Figure 7 is a flowchart of a third multi-language dynamic update method provided by an embodiment of the present invention;
[0053] Figure 8 is a flowchart of a fourth multi-language dynamic update method provided by an embodiment of the present invention;
[0054] Fig. 9 is a schematic diagram of a fourth multi-language dynamic update method provided by an embodiment of the present invention;
[0055] Fig.10 is a schematic diagram of a fifth multi-language dynamic update method provided by an embodiment of the present invention;
[0056] Fig.11 is a flowchart of a fifth multi-language dynamic update method provided by an embodiment of the present invention;
[0057] Fig.12 is a schematic diagram of a sixth multi-language dynamic update method provided by an embodiment of the present invention;
[0058] Fig.13 is a schematic diagram of a seventh multi-language dynamic update method provided by an embodiment of the present invention;
[0059] Fig.14 is a schematic diagram of an eighth multi-language dynamic update method provided by an embodiment of the present invention;
[0060] Fig.15 is a schematic diagram of a ninth multi-language dynamic updating method provided by an embodiment of the present invention;
[0061] Fig.16 is a flowchart of a sixth multi-language dynamic update method provided by an embodiment of the present invention;
[0062] Fig.17 is a schematic diagram of a tenth multi-language dynamic update method provided by an embodiment of the present invention;
[0063] Fig.18 is a schematic diagram of an eleventh multi-language dynamic update method provided by an embodiment of the present invention;
[0064] Fig.19 is a schematic diagram of a twelfth multi-language dynamic update method provided by an embodiment of the present invention;
[0065] Fig. 20 is a flowchart of a seventh multi-language dynamic update method provided by an embodiment of the present invention;
[0066] Fig.21 is a flowchart of an eighth multi-language dynamic updating method provided by an embodiment of the present invention;
[0067] Fig. 22 is a schematic diagram of a thirteenth multi-language dynamic update method provided by an embodiment of the present invention;
[0068] Fig.23 is a flowchart of a ninth multi-language dynamic update method provided by an embodiment of the present invention;
[0069] Fig.24 is a schematic diagram of a fourteenth multi-language dynamic update method provided by an embodiment of the present invention;
[0070] Fig.25 is a schematic diagram of a fifteenth multi-language dynamic update method provided by an embodiment of the present invention;
[0071] Fig.26 is a flowchart of a tenth multi-language dynamic update method provided by an embodiment of the present invention;
[0072] Fig. 27 is a schematic diagram of a sixteenth multi-language dynamic update method provided by an embodiment of the present invention;
[0073] Fig.28 is a schematic diagram of a seventeenth multi-language dynamic update method provided by an embodiment of the present invention;
[0074] Fig.29 It is a schematic diagram of the architecture of a multi-language dynamic updating device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0075] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0076] Unless the context requires otherwise, throughout the specification and claims, the term "including" is to be interpreted as open inclusion, that is, "including, but not limited to". In the description of the specification, the terms "one embodiment", "some embodiments", "exemplary embodiments", "examples", "specific examples" or "some examples" and the like are intended to indicate that specific features, structures, materials or characteristics associated with the embodiment or example are included in at least one embodiment or example of the present disclosure. The schematic representation of the above terms does not necessarily refer to the same embodiment or example. In addition, the specific features, structures, materials or characteristics may be included in any one or more embodiments or examples in any appropriate manner, that is, although they may be carried in the embodiments or examples of the above terms due to reasons such as the order and position of appearance, it is not limited to that they can be carried in combination by one embodiment or example.
[0077] In the description of the present invention, the terms "first" and "second" are used only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may 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, the same type of nouns may be described as two independent individuals by adding "A" and "B" at the end. In this case, the corresponding features defined as "A" and "B" are only used to distinguish the same type of individuals for description purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features.
[0078] In the description of the present invention, the expression "A and / or B" (where A and B are used to formally represent specific characteristic contents) will be involved, and the corresponding expressions include the following three combinations: only A, only B, and a combination of A and B.
[0079] As used herein, "about," "substantially," or "approximately" includes the stated value and an average value that is within an acceptable range of deviation from the particular value as determined by one of ordinary skill in the art taking into account the measurements in question and the errors associated with the measurement of the particular quantity (i.e., the limitations of the measurement system).
[0080] In addition, the technical features involved in the various embodiments of the present invention 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 invention provides a multi-language dynamic update method, such as Figure 1 As shown, including:
[0083] In step 201, the application obtains a language identifier of a first language to be used; wherein the first language is obtained by the application in response to a language switching operation of a user, and the language switching operation may be that the user enters a language switching interface on the application and selects a corresponding language as the first language, such as Figure 2 As shown, the language on the language switching interface is obtained by the application in advance by requesting the language server, that is, a corresponding language identifier is set for each supported language in the language server, and one 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 pre-requests the language server to obtain a supported language list message, and the language list message includes the language identifiers and names of each language, and these languages are displayed on the language switching interface for user selection. After determining the first language, find the language identifier corresponding to the first language from the language list message. Or the first language is obtained by the application reading the system language of the user terminal where it is located; in actual use, when the user installs and starts the application on the user terminal for the first time, the application will determine the system language of the user terminal according to the language environment of the user terminal, and use the system language as the first language.
[0084] In step 202, a first language resource is obtained from the local storage according to the language identifier; wherein the first language resource is a language resource matching the language identifier; a person skilled in the art may pre-place some commonly used language resources in the installation package of the application, and when the user installs the application, the language resources are cached in the local storage, and these commonly used language resources can be directly obtained from 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 obtained from the local storage, the first language resource is obtained from the language server; wherein each language resource may be pre-generated by a person skilled in the art and imported into the language server. When it is necessary to increase the supported language, the person skilled in the art only needs to import the corresponding language resource into the language server, and the application can support the newly added language in the subsequent use process.
[0086] In step 204, the first language resource is loaded onto the application interface to implement language switching of the application.
[0087] The above steps 201 to 204 can be understood as: obtaining language resources from the local storage first, and if the language resources cannot be obtained, then obtaining language resources from the language server. In a preferred embodiment, after obtaining the first language resource from the language server, the method further includes: caching the obtained first language resource in the local storage, so that the user can obtain the first language resource from the local storage when performing a subsequent language switching operation.
[0088] This embodiment realizes remote loading of language resources by setting a language server for language resources and requesting language resources from the language server through the application. When the application needs to adapt to a new language, there is no need to modify the application itself, but to import the language resources of the newly added language into the language server, so that the application can support the newly added language, thereby reducing the subsequent maintenance cost of the application. In addition, the acquired language resources are cached in the local storage, so that when the user uses the language resources later, there is no need to request the language server again, thereby reducing network traffic occupation and improving the corresponding rate of language switching.
[0089] In an optional implementation, the first language resource is obtained from the language server, such as Figure 3 As shown, specifically including:
[0090] In step 301, the user terminal establishes a connection with the language server through the application. If the user terminal successfully establishes the 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; the language resource request carries the language identifier of the required language.
[0091] In step 302, if the user terminal fails to establish a connection with the language server, a first prompt interface pops up, so that the user can wait for the network of the user terminal to recover or connect to the network according to the prompt on the first prompt interface. Figure 4 As shown, the prompt "The network is poor, the language resources cannot be obtained, please wait for the network to recover before operating" is displayed in the first prompt interface, or "The network is not connected, the language resources cannot be obtained, please connect to the network before operating" is displayed in the first prompt interface.
[0092] Furthermore, after the network of the user terminal is restored, the method further includes: the application pops up a second prompt interface to prompt the user to re-perform the language switching operation; 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 follows: Figure 5 As shown, the second prompt interface displays “Network recovery, please reselect language”.
[0093] After the first prompt interface pops up, the network status is also detected in real time. When the network is detected to be restored, the second prompt interface pops up, and after the user clicks on the application interface, the second prompt interface is automatically closed so that the user can select a language. If the user closes the first prompt interface, it is considered that the user has given up the language switch, and the application interface is restored to the upper interface, that is, the language switch interface is exited.
[0094] Considering that in actual application scenarios, the storage space of the user terminal is limited, in order to avoid language resources occupying a large amount of storage space, the method also includes: at each preset period, determining whether the language resources in the local storage have been used in the past preset time; if the second language resources in the local storage have not been used in the past preset time, deleting the second language resources from the local storage. The preset period and preset time are obtained by those skilled in the art based on empirical analysis. In actual use, the preset period can be one month, and the preset time can be one year.
[0095] In a specific application scenario, when a 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 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, such as Figure 4 As shown, a "cached" icon is displayed on the right side of the corresponding language as a cache indicator.
[0096] In order to facilitate the management of the language resources stored locally, in a preferred embodiment, a directory file is also used to manage the language resources in the local storage. The first language resource obtained is cached in the local storage, specifically including: caching the first language resource to a preset location of the local storage, and writing the language identifier of the first language resource into the directory file. The preset location is obtained by analysis by a person skilled in the art and is used to store language resources. The directory file can be embodied in the form of a csv file, and the directory file stores the language identifier and language name of the language resources in the local storage, 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 last switched to the corresponding language resource, so that the application can manage the storage cycle of the language resource according to the time recorded in the directory file, that is, if it has not been used within the past preset time, the corresponding language resource is deleted.
[0097] Considering that in actual use, the language selected by the user in the language switching interface may be inconsistent with the system language of the user terminal, in order to deal with this scenario, this embodiment also provides a preferred implementation method, that is, when the user opens the application, the method also includes: detecting whether the system language of the user terminal matches the language resources currently used by the application; if it is detected that the system language of the user terminal does not match the language resources currently used by the application, a third prompt interface is popped up to facilitate the user to choose whether to switch to the system language on the third prompt interface. In one embodiment, the third prompt interface is as follows: Figure 6 As shown, in the third prompt interface, a prompt “The current language is inconsistent with the system language, do you want to switch to the system language” is displayed. When the user clicks the “Keep in current language” button, the language is not switched to the system language. When the user clicks the “Switch to system language” button, the method described in the above steps 201 to 204 is executed to switch the application to the system language.
[0098] In a preferred embodiment, before detecting whether the system language of the user terminal matches the language resource currently used by the application, Figure 7 As shown, the method also includes:
[0099] In step 401, it is checked whether there is historical selection information. If there is historical selection information, it is determined 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 will not be popped up, and the language resource currently used by the application will be directly used; wherein the historical selection information is generated when the user chooses not to switch to the system language in the third prompt interface that pops up in history, and the historical selection information includes the historical system language of the user terminal and the historical language resource of the application. In addition, after each language switch of the application, or after detecting the system language switch of the user terminal, the historical selection information is deleted.
[0101] The above steps 401-402 can be understood as: when the user selects "Keep in current language" on the third prompt interface, the language used by the application at this time and the system language used by the user terminal at this time are recorded in the historical selection information. When the application is opened subsequently, it is first determined based on the historical selection information whether the user has chosen to retain the current language of the application under the same language environment conditions. If it is determined that the user has chosen to retain the current language, the third prompt interface will not pop up, but the application interface will be entered directly in the current language. Otherwise, after it is determined that the system language is different from the current language of the application, the third prompt interface will pop up. The purpose of this implementation is to avoid the third prompt interface from popping up repeatedly, and by deleting the historical selection information after the language is switched, it supports the third prompt interface to pop up again for the user to select.
[0102] Embodiment 2:
[0103] On the basis of Example 1, this embodiment also provides a preferred implementation method in combination with a specific application scenario, that is, in an actual application scenario, the application is a label making APP; the user terminal accesses the remote label server through the locally installed label making APP, and when the user opens the label making interface of the label making APP, Figure 8 As shown, the multi-language dynamic updating method described in this embodiment also includes:
[0104] In step 501, the label making APP sends a material library request to the label server; wherein the material library request carries the language identifier; the material library request also includes the requested label id.
[0105] In step 502, the tag server obtains a language resource matching the language identifier according to the language identifier.
[0106] In step 503, the language resource is used to switch the language of the material objects 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.
[0107] The material object containing text mainly refers to a material object that exists in the form of a vector object and contains text elements, such as <text>< / text> Other forms of material objects, such as vector objects without text elements, vector objects with text in the form of paths, and non-vector objects (such as high-resolution objects) are not within the scope of language switching.
[0108] In actual use, if a material object is carried in a label, the language switching will also be performed along with the material object. The language switching is mainly achieved by hiding and displaying the text elements in the vector object. Specifically, the artist sets text elements of multiple languages in the vector object in advance. For example, a vector object in the first material library contains the text element " <text> 8:00 Breakfast< / text> " and text elements are " <text> 8:00 breakfast< / text> ", by modifying the display attributes of the two text elements, one of them is hidden and the other is displayed, the vector object language can be switched. Fig. 9 Switch to Fig.10 The interface shown.
[0109] The first material library is usually created by an artist on an artist terminal, that is, the first material library comes from the artist terminal. Fig.11 As shown, specifically:
[0110] In step 601, the artist terminal establishes a collaboration process with the user terminal through the tag server, wherein the first material library of the artist terminal is stored locally or in the tag server in the local area network and has the original resolution; wherein the collaboration process of the two parties is established by the user opening the tag sent by the artist terminal to the user terminal through the tag server, such as Fig.12 As shown, after clicking the "Collaborative Modification" button, a request for collaboration message is sent to the artist terminal. The artist terminal displays a request for collaboration window according to the collaboration message. After the artist accepts the collaboration in the request for collaboration window, the collaboration process is successfully established and the user enters the label making interface.
[0111] Among them, if the first material library of the artist terminal is stored locally, collaboration can only be established when the artist terminal is online (that is, the artist terminal is connected to the label server). When the artist terminal is offline (that is, the artist terminal is not connected to the label server), the label making APP displays the corresponding collaboration failure message. If the first material library of the artist terminal is stored in the local area network, collaboration can be established when the artist terminal is offline, and any changes made to the label by the user during the collaboration process will be updated to the label making interface of the artist terminal when the artist terminal is opened next time.
[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 set original pixel size of the vector object. For example, for svg objects, the width of the original resolution is the value corresponding to the label width in the svg file, and the height of the original resolution is the value corresponding to the label height in the svg file.
[0113] The original resolution is for high-resolution objects. For material objects of vector objects, the original resolution can be understood as the resolution pre-calculated by those skilled in the art and clearly displayed on the art terminal.
[0114] In step 602, after switching the language of the material object containing text in the first material library, the tag server generates a second material library with a resolution adapted for the user terminal according to the terminal screen size, screen resolution and selected label size; wherein the resolution adaptation is achieved by the tag server in advance through resolution compression based on the first material library with the original resolution.
[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 artist terminal. The resolution adaptation rules of the second material library are pre-analyzed by technicians in this field based on experience. Specifically, the resolution adaptation rules of the second material library are analyzed based on the fact that the material can be clearly displayed on the user terminal and is not clearly displayed when used to produce labels. Adjusting the resolution is also manifested as adjusting the pixel size of the material object in actual use. That is, Fig.13 As shown, the language of the material objects in the first material library is switched first, and then the resolution is compressed to obtain the material objects in the second material library. During the resolution compression, for vector objects, it is achieved by directly converting them into image objects of required resolution.
[0116] The first material library can be understood as a collection of multiple material objects.
[0117] The size of each material object in the second material library is calculated using the following first formula:
[0118]
[0119] Where 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, and W u is the width of the user terminal, H u is the height of the user terminal, W c H is the width of the art terminal. c is the height of the art terminal, and the unit is px. min() represents the minimum value in the brackets. k is the compression multiple obtained by technicians in this field based on empirical analysis. k is greater than 0 and less than or equal to 1.
[0120] For example, the size of the artist terminal is 31.5 inches, and its resolution is 2560×1440, and the size of the user terminal is 6.7 inches, and its resolution is 1440×2560. 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 with a set original pixel size of (W, H) (unit: px), the size after resolution compression is like Fig.13 As shown, the material object with an original resolution of (256, 256) size is compressed to a size of (144, 144).
[0121] The second material library is presented in the form of thumbnails on the label making APP, such as Fig.10 As shown, a second material library with a corresponding resolution is stored in the memory of the user terminal. 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 artists, if they need to make vector objects support multiple languages, they need to add a "text group" on the material object creation interface of the artist terminal, and add text elements in multiple languages to the text group, such as Fig.14 As shown, the artist terminal communicates with the language server to obtain the language list message of the language supported by the language server, thereby obtaining the name and language identifier of each language. When the artist adds text to the text group and sets the corresponding language, a text element is generated in the corresponding vector object, and the language identifier of the language is included in the id of the text element. If the technicians in this field set the language identifier of the language "Simplified Chinese" to "china" in the language server, when adding text with the language "Simplified Chinese", the text group id, "china", and the sorting number of the text in the text group can be used to generate the id of the text element, such as generating a partial text in a material object such as Fig.15 As shown, correspondingly, when the tag server switches the language, it searches for the text element in the material object and confirms whether the text element contains the language identifier of the language to be switched. If the language identifier exists, the display attribute value of the text element is set to block to display it. Otherwise, the display attribute value of the text element is set to none to hide it.
[0123] This embodiment compresses the material objects on the artist's terminal and sends them to the user terminal, so as to establish collaborative modification between the user and the artist, realize the connection between the user and the artist, and enable the user to accurately feedback the changes made to the materials on the label to the artist, thereby improving the efficiency of label customization and modification, and improving user satisfaction by providing users with a way to modify. In addition, combined with the implementation methods in the above embodiments, this embodiment can open up the complete process of the three parties of user-artist-supply chain, greatly improving the efficiency of label customization and production. In addition, this embodiment sends to the user terminal material objects after resolution compression. Since the compressed material objects will suffer from image quality loss after being enlarged, they are usually not used for subsequent label production by users, but are only used for reference browsing of effects by users on the user terminal, thereby effectively protecting the rights of the artist's label products and preventing the labels from being exported and misused by users.
[0124] In an optional implementation manner, after the user terminal pulls at least two material objects from the second material library and completes the arrangement of the material objects according to one or more of the preset layer relationship, position relationship, perspective degree and size scaling, as shown in FIG. Fig.16 As shown, the method also includes:
[0125] In step 701, the label making APP obtains a first execution request to replace a selected material object; the first execution request may be a user long pressing the corresponding material object in the label, or after clicking the corresponding material object, clicking the material replacement icon in the upper left corner of the material, such as Fig.17 shown.
[0126] In step 702, the label making APP generates a replaceable material display message according to the identifier of the selected material object and the zoom level of the selected material object carried in the first execution request, and sends the message to the label server through the user terminal.
[0127] In step 703, the tag server will determine the type attribute of the replaceable material based on the identifier of the selected material object, and filter out a set of material objects used to constitute the first replacement material sub-library based on the type attribute; wherein the identifier of the material object is automatically generated when the artist generates the corresponding material, and one material object corresponds to a unique identifier, and before creating the material object, the artist first creates a material library, each material library corresponds to a type attribute, and then creates a material object in the corresponding material library. The created material object has the type data of the material library where it is located. The method of filtering out a set of material objects used to constitute the first replacement material sub-library based on the type attribute is: filtering out all material objects in the material library where the selected material object is located.
[0128] In step 704, the tag server uses the language resource to switch the language of the material objects containing text in the material object set, and scales the material objects associated with the material object set according to the scaling degree of the selected material object to meet the resolution required for presentation clarity after scaling, thereby obtaining a first replacement material sub-library with a resolution that matches the resolution; the language replacement method has been described in detail in the above embodiment 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] Wherein, 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, and W u is the width of the user terminal, H u is the height of the user terminal, W c H is the width of the art terminal. c It is the height of the art terminal, and the unit is px. min() represents the minimum value in the brackets. scaleTimes is the magnification of the selected material object.
[0132] like Fig.18 As 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 the label making area is enlarged to (216, 216), the resolution of the selected material object when it is in the first material library is (256, 256), if there is another material object, the material object has the same type attribute as the candidate material object, and the resolution of the material object when it is in the first material library is (256, 280), then the resolution corresponding to the material object when it is screened and used as the material object in the first replacement material sub-library is That is (216, 236), such as Fig.19 shown.
[0133] In step 705, the first replacement material sub-library adapted to the resolution is returned to the user terminal for displaying replaceable materials on the label making APP interface.
[0134] Among them, it should be emphasized here that the optional material objects displayed in the label making APP are still presented in the form of thumbnails. The first replacement material sub-library is only cached in the background. When the user chooses to use the corresponding material object to replace the selected material object by clicking on the thumbnail, the material object with resolution adaptation in the first replacement material sub-library is loaded into the label of the label making APP interface.
[0135] And, in actual use, such as Fig. 20 As shown, the method also includes:
[0136] In step 706, for the replacement operation of the selected material object completed in the label making APP interface on the user terminal side, an update message carrying the identifier 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 artist terminal, so that the artist terminal obtains the replaced material object with the corresponding original resolution according to the identifier of the replaced material object carried in the update message and updates it to the label making interface on the artist terminal. The updating of the replaced material object with the corresponding original resolution to the label making interface on the artist terminal is actually to scale the replaced material object with the original resolution to match the selected material object, and then update it to the label making interface of the artist terminal, still in the same way. Fig.18 and Fig.19 As shown in the example, if the selected material object is enlarged times, the original resolution of the replaced material object is (256, 280), then the resolution of the replaced material object updated to the label making interface on the artist terminal is That is (384, 420).
[0138] In a preferred implementation, returning the first replacement material sub-library adapted to the resolution to the user terminal for displaying replaceable materials on the label making APP interface specifically includes:
[0139] According to the terminal screen size and the label making APP interface setting mode, the number n of replaceable post-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 by a technician in this field based on the size of the thumbnail displayed on the label making APP interface (different label making APP interface setting modes may correspond to different thumbnail sizes), and the size and spacing of each component on the label making APP interface, and then substituting the terminal screen size into the calculation rule to obtain the calculation.
[0141] The first replacement material sub-library adapted to the resolution is equally divided according to the number n, and the transfer and display of the replaceable materials to the user terminal are completed in a batch sending manner under paging operation or in a batch sending manner under scroll bar operation.
[0142] like Fig.17 As shown, if n is 19, the 19 replaceable materials are returned to the user terminal, and the user terminal stores the 19 replaceable materials in the file system and displays thumbnails of the 19 replaceable materials on one page; wherein the thumbnails are all generated after loading the second material library, specifically: thumbnails of each material object in the second material library are generated, and these thumbnails carry identifiers that match the corresponding material objects, and when the thumbnails need to be displayed, the identifier of the material object is used to select the corresponding thumbnail for display, and conversely, when the user selects the corresponding thumbnail, the corresponding material object is selected through the identifier of the thumbnail.
[0143] In a practical application scenario, such as Fig.21 As shown, the method also includes:
[0144] In step 801, the label making APP obtains a second execution request to reduce or increase the resolution of a selected material object; the second execution request may be to click the adjustment resolution icon in the lower left corner of the selection box after clicking to select the corresponding material object, so as to pop up a resolution adjustment box, such as Fig. 22 As shown in the figure, select the corresponding resolution as the resolution of the material object in the resolution adjustment box and click the OK button.
[0145] In step 802, the label making APP sends the identifier 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 the preset multiple of the resolution of the corresponding material object in the second material library, and the preset multiple is obtained by technical personnel in this field based on demand analysis, and the preset multiple is greater than or equal to 1.
[0146] In step 803, after completing a round of second execution requests on the user terminal side, the user terminal sends a synchronization message to the tag server so that the tag server synchronizes the modified resolution level of the selected material object on the current user terminal side to the artist terminal.
[0147] Among them, when the tag server synchronizes the modified resolution level of the selected material object on the current user terminal side to the artist terminal, the corresponding resolution level is the cumulative resolution level adjustment that has been made when generating the second material library. Assuming that the pixel size of the corresponding material object in the first material library is (W, H), its pixel size in the second material library after conversion is (W', H'), and after the user's zoom in or out operation, its pixel size becomes (W", H"), and the user adjusts the resolution of the material object to 0.8 times the resolution, then the pixel size of the material object becomes (0.8×W", 0.8×H"), and correspondingly, the pixel size of the material object synchronized to the artist terminal is
[0148]
[0149] It should be noted here that the difference between the adjustment of resolution in the above steps 701-702 and the other implementation methods mentioned above is that: the other implementation methods mentioned above are all based on the physical size of the material object in the label making area, and the resolution is adjusted synchronously; while steps 701-702 directly adjust the resolution while keeping the physical size of the material object in the label making area unchanged, thereby changing the clarity or blurriness of the material object in the label making area, which is usually used to blur the material object in the background pixels.
[0150] This embodiment also provides a preferred implementation, that is, when the user selects a background layer of a specified type, wherein the specified type includes an array type and a single object magnification type, such as Fig.23 As shown, the method further includes:
[0151] In step 901, when the user drags and enlarges a non-background layer element beyond a first preset value and then releases it, the label making APP generates a prompt window to confirm whether to arrange the first material object currently being dragged and enlarged according to the current background layer type to generate a new background layer; wherein the first preset value is obtained by a technician in this field based on empirical analysis.
[0152] In step 902, after obtaining confirmation that the first material object currently being dragged and enlarged is generated into a new background layer, Fig.24 As shown in the figure, after clicking the "Replace to Background Layer" button, the first material object currently being dragged and enlarged is adjusted according to its array mode or magnification ratio to generate a new background layer according to the type of the previous background layer to be replaced. Fig.25 shown.
[0153] There is also an optional implementation: when the user selects a background layer of a specified type, wherein the specified type includes an array type and a single object magnification type, such as Fig.26 As shown, the method further includes:
[0154] In step 1001, when the user drags a single object enlarged background layer element and reduces it beyond a second preset value and then releases it, the label making APP generates a prompt window to confirm whether to generate an icon type material object for the background layer that is currently being dragged and reduced; wherein the second preset value is obtained by a technician in this field based on empirical analysis.
[0155] In step 1002, after obtaining confirmation that the background layer currently being dragged and reduced is generated into an icon type material object, Fig. 27 As shown in the figure, after clicking the "Generate New Material Object" button, an icon type material object is generated according to the size when it is released, such as Fig.28 As shown, the generated new material object will be displayed in the personal icon library.
[0156] Embodiment 3:
[0157] like Fig.29 , is a schematic diagram of the architecture of a multi-language dynamic updating device according to an embodiment of the present invention. The multi-language dynamic updating device according to this embodiment includes one or more processors 21 and a memory 22. Fig.29 A processor 21 is taken as an example.
[0158] The processor 21 and the memory 22 may be connected via a bus or other means. Fig.29 The example of connecting through bus is taken in the following.
[0159] The memory 22 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs and non-volatile computer executable programs, such as the multi-language dynamic update method in Example 1. The processor 21 executes the multi-language dynamic update method by running the non-volatile software programs and instructions stored in the memory 22.
[0160] The memory 22 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 22 may optionally include a memory remotely arranged relative to the processor 21, and these remote memories may be connected to the processor 21 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0161] The program instructions / modules are stored in the memory 22, and when executed by the one or more processors 21, the multi-language dynamic update method in the above-mentioned embodiment 1 is executed.
[0162] It is worth noting that the information interaction, execution process, etc. between the modules and units within the above-mentioned devices and systems are based on the same concept as the processing method embodiment of the present invention. The specific contents can be found in the description of the method embodiment of the present invention and will not be repeated here.
[0163] A person skilled in the art may understand that all or part of the steps in the various methods of the embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0164] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A multi-language dynamic update method, characterized in that: include: The application obtains a language identifier of a first language to be used; 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; According to the language identifier, obtaining a first language resource from local storage; wherein the first language resource is a language resource matching the language identifier; If the first language resource is not successfully obtained from the local storage, the first language resource is obtained from the language server; The first language resource is loaded onto the application interface to implement language switching of the application.
2. The multi-language dynamic updating method according to claim 1, characterized in that: The obtaining of the first language resource from the language server specifically includes: The user terminal establishes a connection with the language server through the application. If the user terminal successfully establishes the 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; If the user terminal fails to establish a connection with the language server, a first prompt interface is popped up, so that the user can wait for the network of the user terminal to recover or connect to the network according to the prompt on the first prompt interface.
3. The multi-language dynamic updating method according to claim 2, characterized in that: After the network of the user terminal is restored, the method further includes: The app pops up a second prompt interface to prompt the user to switch the language again; Alternatively, the user terminal re-establishes a connection with the language server through the application, and obtains the first language resource from the language server.
4. The multi-language dynamic updating method according to claim 1, characterized in that: After obtaining the first language resource from the language server, the method further includes: The obtained first language resource is cached in the local storage, so that the user can obtain the first language resource from the local storage when performing a subsequent language switching operation.
5. The multi-language dynamic updating method according to claim 4, characterized in that: The method also includes: At each preset period, determining whether the language resources in the local storage have been used within the past preset time; If the second language resource in the local storage has not been used within the past preset time, the second language resource is deleted from the local storage.
6. The multi-language dynamic updating method according to claim 4, characterized in that: When a user opens the language switching interface of the application, the languages supported by the application are displayed on the language switching interface so that the user can select a corresponding language for language switching operation; For the languages 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.
7. The multi-language dynamic updating method according to claim 4, characterized in that: The directory file is used to manage the language resources in the local storage, and the first language resource obtained is cached in the local storage, specifically including: The first language resource is cached to a preset location of local storage, and the language identifier of the first language resource is written into the directory file.
8. The multi-language dynamic updating method according to claim 1, characterized in that: When the user opens the app, the method also includes: Check whether the system language of the user terminal matches the language resources 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 to facilitate the user to select whether to switch to the system language on the third prompt interface.
9. The multi-language dynamic updating method according to claim 8, characterized in that: Before detecting whether the system language of the user terminal matches the language resource currently used by the application, the method further includes: Find whether there is historical selection information. If there is historical selection information, determine 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 will not be popped up, and the language resource currently used by the application will be directly used; The historical selection information is generated when the user chooses not to switch to the system language in the third prompt interface that pops up in history, and the historical selection information includes the historical system language of the user terminal and the historical language resources of the application.
10. The multi-language dynamic updating method according to claim 9, characterized in that: After each language switch of the application or after detecting that the system language switch of the user terminal is detected, the historical selection information is deleted.
11. The multi-language dynamic updating method according to any one of claims 1 to 10, characterized in that: The application is a label making APP; the user terminal accesses the remote label server through the locally installed label making APP, and 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 tag server obtains a language resource matching the language identifier according to the language identifier; The language resource is used to switch the language of the material objects containing text in the first material library, to generate a second material library matching the language identifier, and the second material library is returned to the user terminal.
12. A non-volatile computer storage medium, characterized in that: The computer storage medium stores computer executable instructions, which are executed by one or more processors to complete the multi-language dynamic update method according to any one of claims 1-11.
13. A multi-language dynamic updating device, characterized in that: The device comprises: At least one processor; and a memory in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the processor to execute the multi-language dynamic update method according to any one of claims 1-11.
Citation Information
Patent Citations
Method and device for multi-language switching of application program
CN104020991A
Display control method and user equipment
CN106527920A
Language switching method for terminal application dynamic copywriting, server and storage medium
CN109669741A
Language configuration method and device, computer readable storage medium and server
CN111158813A
Multi-language switching method and device, electronic equipment, storage medium and program product
CN117056001A