Data processing method and device and electronic equipment
1. A data processing method applied to a first client, the method comprising:
acquiring user-defined multi-language editing information; the user-defined multi-language editing information comprises a user-defined translation of the display content of the target user interface UI control;
refreshing the display content of the target UI control according to the user-defined multi-language editing information so as to update the display content of the target UI control into the user-defined translation;
and under the condition that the reporting condition of the multi-language editing information is determined to be met, reporting the user-defined multi-language editing information to a server, so that under the condition that the upgrading condition is determined to be met, the server determines a multi-language updating file according to the received multi-language editing information, and updates the user-defined multi-language file for the corresponding client according to the multi-language updating file.
2. The method of claim 1, wherein obtaining custom multilingual editing information comprises:
under the condition that a first control instruction is detected, entering a user-defined multi-language editing mode; the first control instruction is used for controlling the first client to enter a user-defined multi-language editing mode;
highlighting a UI control supporting the user-defined multi-language editing;
displaying a multi-language editing interface aiming at the target UI control under the condition that a user-defined multi-language editing instruction aiming at the target UI control is detected;
acquiring user-defined multi-language editing information input through the multi-language editing interface;
under the condition that a second control instruction is detected, the user-defined multi-language editing mode is exited, and highlighting of a UI control supporting user-defined multi-language editing is cancelled; and the second control instruction is used for controlling the first client to exit the user-defined multi-language editing mode.
3. The method of claim 1, wherein the reporting the customized multilingual edit information to a server comprises:
and reporting the user-defined multi-language editing information and the region information of the first client to the server, so that the server determines a multi-language updating file of the first target region according to the received multi-language editing information and the region information under the condition that the multi-language file of the first target region meets the upgrading condition.
4. The method of claim 1, wherein after obtaining the customized multilingual editing information, further comprising:
and sending the user-defined multi-language editing information to a second client so that the second client displays the user-defined translation according to the user-defined multi-language editing information under the condition of displaying the display content of the target UI control.
5. The method of claim 1, further comprising:
under the condition that the first client is started, sending a state query request to the server, so that the server determines whether the first client needs to update or rollback the multi-language files according to the multi-language file version information of the first client;
downloading a multilingual update file from the server under the condition that the multilingual file is determined to be needed to be updated, generating a multilingual backup file according to a local custom multilingual file, updating the local custom multilingual file according to the multilingual update file, and refreshing the display content of the UI control according to the updated local custom multilingual file;
under the condition that the multi-language file rollback is determined to be needed, replacing the local user-defined multi-language file with the multi-language backup file, and refreshing the display content of the UI control according to the replaced local user-defined multi-language file;
and under the condition that the updating or the rollback of the multi-language file is determined not to be needed, refreshing the display content of the UI control according to the local self-defined multi-language file.
6. A data processing method is applied to a server side, and the method comprises the following steps:
receiving user-defined multi-language editing information reported by a client;
determining a multi-language updating file according to the received multi-language editing information under the condition that the upgrading condition is determined to be met;
and updating the self-defined multi-language file for the corresponding client according to the multi-language updating file.
7. The method of claim 6, wherein the determining that an upgrade condition is satisfied comprises:
for any entry in the received multi-language editing information, determining the proportion of different self-defined translations corresponding to the entry according to the received multi-language editing information;
determining that the entry meets the updating condition under the condition that the ratio of the user-defined translation with the highest ratio exceeds a preset ratio threshold;
and determining that the upgrading condition is met under the condition that the number of the entries meeting the updating condition reaches a preset number threshold.
8. The method of claim 7, wherein the receiving the customized multilingual edit information reported by the client comprises:
receiving user-defined multi-language editing information and regional information reported by a client;
the step of determining the proportion of different custom translations corresponding to any entry in the received multi-language editing information according to the received multi-language editing information comprises the following steps:
determining the self-defined multi-language editing information of the same region according to the self-defined multi-language editing information and the region information;
for any entry included in the user-defined multi-language editing information of any region, determining the ratio of different user-defined translations corresponding to the entry according to the multi-language editing information of the region;
and under the condition that the number of the entries meeting the updating condition reaches a preset number threshold, determining that the updating condition is met, wherein the method comprises the following steps:
for any region, determining that the multi-language file of the region meets the upgrading condition under the condition that the number of the entries meeting the updating condition in the region reaches a preset number threshold.
9. The method of claim 6, wherein said updating the customized multilingual file from the multilingual update file to the corresponding client comprises:
receiving a state query request sent by a client, wherein the state query request at least comprises multi-language file version information of the client;
and determining whether the client needs to update or rollback the multi-language files according to the multi-language file version information of the client and the local multi-language file version information, and outputting a determination result to the client, wherein the determination result comprises one of the need of updating the multi-language files, the need of rolling back the multi-language files and the need of updating or rolling back the multi-language files.
10. The method according to claim 9, wherein the status query request further includes region information of the client;
the determining whether the client needs to update or rollback the multi-language file according to the multi-language file version information of the client and the local multi-language file version information comprises:
determining multi-language file version information of a second target region from local multi-language file version information according to the region information of the client; the second target region is a region matched with the region information of the client;
and determining whether the client needs to update or rollback the multi-language file according to the multi-language file version information of the client and the multi-language file version information of the second target region.
11. A data processing apparatus, applied to a first client, the apparatus comprising:
the acquisition unit is used for acquiring the user-defined multi-language editing information; the user-defined multi-language editing information comprises a user-defined translation of the display content of the target user interface UI control;
the processing unit is used for refreshing the display content of the target UI control according to the customized multi-language editing information so as to update the display content of the target UI control into the customized translation;
and the sending unit is used for reporting the user-defined multi-language editing information to the server under the condition that the reporting condition of the multi-language editing information is determined to be met, so that the server determines a multi-language updating file according to the received multi-language editing information under the condition that the updating condition is determined to be met, and performs user-defined multi-language file updating on the corresponding client according to the multi-language updating file.
12. The apparatus of claim 11, further comprising:
the mode control unit is used for entering a self-defined multi-language editing mode under the condition that the first control instruction is detected; the first control instruction is used for controlling the first client to enter a user-defined multi-language editing mode; highlighting a UI control supporting the user-defined multi-language editing;
the obtaining unit is specifically configured to display a multilingual editing interface for the target UI control when a user-defined multilingual editing instruction for the target UI control is detected; acquiring user-defined multi-language editing information input through the multi-language editing interface;
the mode control unit is also used for exiting the user-defined multi-language editing mode and canceling the highlight display of the UI control supporting the user-defined multi-language editing under the condition that a second control instruction is detected; the second control instruction is used for controlling the first client to exit the user-defined multi-language editing mode;
and/or the presence of a gas in the gas,
the sending unit is used for reporting the user-defined multi-language editing information and the region information of the first client to the server, so that the server determines a multi-language updating file of a first target region according to the received multi-language editing information and the region information under the condition that the multi-language file of the first target region meets the upgrading condition;
and/or the presence of a gas in the gas,
the sending unit is further configured to send the customized multi-language editing information to a second client, so that the second client displays the customized translation according to the customized multi-language editing information under the condition that the display content of the target UI control is displayed;
and/or the presence of a gas in the gas,
the sending unit is further configured to send a status query request to the server when the first client is started, so that the server determines whether the first client needs to update or rollback the multi-language file according to the multi-language file version information of the first client;
the processing unit is further used for downloading the multi-language update file from the server under the condition that the multi-language file is determined to be needed to be updated, generating a multi-language backup file according to the local user-defined multi-language file, updating the local user-defined multi-language file according to the multi-language update file, and refreshing the display content of the UI control according to the updated local user-defined multi-language file; under the condition that the multi-language file rollback is determined to be needed, replacing the local user-defined multi-language file with the multi-language backup file, and refreshing the display content of the UI control according to the replaced local user-defined multi-language file; and under the condition that the updating or the rollback of the multi-language file is determined not to be needed, refreshing the display content of the UI control according to the local self-defined multi-language file.
13. A data processing apparatus, applied to a server, the apparatus comprising:
the receiving unit is used for receiving the user-defined multi-language editing information reported by the client;
the determining unit is used for determining the multi-language updating file according to the received multi-language editing information under the condition that the upgrading condition is determined to be met;
and the processing unit is used for updating the customized multi-language file for the corresponding client according to the multi-language updating file.
14. The apparatus of claim 13,
the determining unit is specifically configured to determine, for any entry in the multilingual editing information received by the receiving unit, a proportion of different custom translations corresponding to the entry according to the received multilingual editing information; determining that the entry meets the updating condition under the condition that the ratio of the user-defined translation with the highest ratio exceeds a preset ratio threshold; determining that the upgrade condition is met under the condition that the number of the entries meeting the update condition reaches a preset number threshold;
the receiving unit is specifically used for receiving user-defined multi-language editing information and regional information reported by a client;
the determining unit is specifically configured to determine the customized multi-language editing information of the same region according to the customized multi-language editing information and the region information; for any entry included in the user-defined multi-language editing information of any region, determining the ratio of different user-defined translations corresponding to the entry according to the multi-language editing information of the region;
the determining unit is further specifically configured to determine, for any region, that the multilingual file in the region meets the upgrade condition when the number of entries meeting the update condition in the region reaches a second preset number threshold;
and/or the presence of a gas in the gas,
the receiving unit is further configured to receive a status query request sent by a client, where the status query request at least includes multi-language file version information of the client;
the processing unit is specifically configured to determine whether the client needs to perform multi-language file update or rollback according to the multi-language file version information of the client and the local multi-language file version information, and output a determination result to the client, where the determination result includes one of the need to perform multi-language file update, the need to perform multi-language file rollback, and the need not to perform multi-language file update or rollback;
the state query request also comprises the region information of the client;
the processing unit is further used for determining the multi-language file version information of a second target region from the local multi-language file version information according to the region information of the client; the second target region is a region matched with the region information of the client; and determining whether the client needs to update or rollback the multi-language file according to the multi-language file version information of the client and the multi-language file version information of the second target region.
15. An electronic device comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor being configured to execute the machine executable instructions to implement the method of any one of claims 1-5 or 6-10.
Background
With the rapid development of smart mobile devices and mobile applications, the internationalization of mobile applications has become a major trend. Users in different regions all desire to use mobile applications with local language habits.
At present, the language switching mode of the mobile application program is basically to translate languages of each region in advance, and the mobile application program is directly mapped to the translated languages of each region in a code according to different regions.
However, due to the factors such as the accuracy and the hysteresis of the translation, the current mobile application multilingual solution has a habit that some translations cannot fit each region well, and there may be wrong translations.
Disclosure of Invention
In view of this, the present application provides a data processing method, an apparatus and an electronic device, so as to improve the accuracy and comprehensiveness of multiple language translations of an application.
According to a first aspect of the embodiments of the present application, there is provided a data processing method applied to a first client, the method including:
acquiring user-defined multi-language editing information; the user-defined multi-language editing information comprises a user-defined translation of the display content of the target user interface UI control;
refreshing the display content of the target UI control according to the user-defined multi-language editing information so as to update the display content of the target UI control into the user-defined translation;
and under the condition that the reporting condition of the multi-language editing information is determined to be met, reporting the user-defined multi-language editing information to a server, so that under the condition that the upgrading condition is determined to be met, the server determines a multi-language updating file according to the received multi-language editing information, and updates the user-defined multi-language file for the corresponding client according to the multi-language updating file.
According to a second aspect of the embodiments of the present application, there is provided a data processing method applied to a server, the method including:
receiving user-defined multi-language editing information reported by a client;
determining a multi-language updating file according to the received multi-language editing information under the condition that the upgrading condition is determined to be met;
and updating the self-defined multi-language file for the corresponding client according to the multi-language updating file.
According to a third aspect of the embodiments of the present application, there is provided a data processing apparatus, applied to a first client, the apparatus including:
the acquisition unit is used for acquiring the user-defined multi-language editing information; the user-defined multi-language editing information comprises a user-defined translation of the display content of the target user interface UI control;
the processing unit is used for refreshing the display content of the target UI control according to the customized multi-language editing information so as to update the display content of the target UI control into the customized translation;
and the sending unit is used for reporting the user-defined multi-language editing information to the server under the condition that the reporting condition of the multi-language editing information is determined to be met, so that the server determines a multi-language updating file according to the received multi-language editing information under the condition that the updating condition is determined to be met, and performs user-defined multi-language file updating on the corresponding client according to the multi-language updating file.
According to a fourth aspect of the embodiments of the present application, there is provided a data processing apparatus, applied to a server, the apparatus including:
the receiving unit is used for receiving the user-defined multi-language editing information reported by the client;
the determining unit is used for determining the multi-language updating file according to the received multi-language editing information under the condition that the upgrading condition is determined to be met;
and the processing unit is used for updating the customized multi-language file for the corresponding client according to the multi-language updating file.
According to a fifth aspect of embodiments of the present application, there is provided an electronic device comprising a processor and a memory, wherein,
a memory for storing a computer program;
and the processor is used for realizing the data processing method provided by the first aspect or the second aspect when executing the program stored in the memory.
According to a sixth aspect of embodiments herein, there is provided a machine-readable storage medium storing machine-executable instructions that, when executed by a processor, implement the data processing method provided by the first or second aspect.
According to a seventh aspect of embodiments of the present application, there is provided a computer program, which is stored in a machine-readable storage medium and when executed by a processor, causes the processor to perform the data processing method provided by the first aspect or the second aspect.
According to the data processing method, the user-defined multi-language editing information is started for the application program, the display content of the UI control supporting the user-defined multi-language editing in the application program can be subjected to user-defined editing, the display content of the target UI control is displayed as the self-defined edited translation, the translation of the display content of the UI control is made to be more fit with the language habit of an application area, the language of the multi-language translation of the application program can be expanded, the wrong translation of the translated area can be corrected in time, and the accuracy and the comprehensiveness of the multi-language translation of the application program are improved; in addition, the obtained multilingual editing information is reported to the server side through the client side, and the server side updates the customized multilingual file of the corresponding client side under the condition that the upgrading condition is determined to be met, so that the communication between the user and the application program developer on the translation content is realized, and the accuracy and the comprehensiveness of the translation of the application program are further improved.
Drawings
FIG. 1 is a flow chart diagram illustrating a data processing method according to an exemplary embodiment of the present application;
FIG. 2 is a schematic flow chart diagram illustrating another data processing method according to yet another exemplary embodiment of the present application;
FIG. 3 is a schematic diagram illustrating a user-defined multilingual major flow according to an exemplary embodiment of the present application;
FIG. 4 is a schematic diagram illustrating a main flow of a user sharing a customized multi-lingual document according to an exemplary embodiment of the present application;
FIG. 5 is a schematic diagram illustrating a main flow of updating multiple languages according to language habits of a user according to an exemplary embodiment of the present application;
FIG. 6 is a schematic diagram illustrating a main flow of an APP update/rollback multiple language file according to an exemplary embodiment of the present application;
FIG. 7 is a diagram illustrating an overall architecture of an SDK according to an exemplary embodiment of the present application;
FIG. 8 is a schematic workflow diagram illustrating an SDK architecture according to an exemplary embodiment of the present application;
FIG. 9 is an interaction flow diagram illustrating a custom multilingual edit according to an exemplary embodiment of the present application;
FIG. 10 is a block diagram of a data processing apparatus according to an exemplary embodiment of the present application;
FIG. 11 is a schematic block diagram of another data processing apparatus according to yet another exemplary embodiment of the present application;
FIG. 12 is a block diagram of a data processing apparatus according to an exemplary embodiment of the present application;
fig. 13 is a schematic diagram of a hardware structure of an electronic device according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
In order to make the technical solutions provided in the embodiments of the present application better understood and make the above objects, features and advantages of the embodiments of the present application more comprehensible, the technical solutions in the embodiments of the present application are described in further detail below with reference to the accompanying drawings.
Referring to fig. 1, a flow chart of a data processing method provided in the embodiment of the present application is schematically shown, where the data processing method may be applied to any client (referred to as a first client herein) that supports an application program in the technical solution of the embodiment of the present application, and as shown in fig. 1, the data processing method may include the following steps:
it should be noted that, the sequence numbers of the steps in the embodiments of the present application do not mean the execution sequence, and the execution sequence of each process should be determined by the function and the inherent logic of the process, and should not constitute any limitation to the implementation process of the embodiments of the present application.
And S100, obtaining user-defined multi-language editing information, wherein the user-defined multi-language editing information comprises a user-defined translation of the display content of the target UI control.
In the embodiment of the present application, a target UI (User Interface) control does not refer to a fixed control, but may refer to any one or more UI controls supporting customized multiple languages in the first client.
In the embodiment of the application, in order to improve the accuracy and comprehensiveness of the multilingual translation of the application, a user-defined multilingual editing function can be started for the application, and the display content of a UI control supporting the user-defined multilingual editing in the application is displayed as the accurate translation of a specified language in a user-defined multilingual editing mode.
Illustratively, some or all of the UI controls in a custom multi-language functionality enabled application support custom multi-language editing.
And step S110, refreshing the display content of the target UI control according to the customized multi-language editing information so as to update the display content of the target UI control into a customized translation.
In the embodiment of the application, under the condition that the user-defined multi-language editing information is obtained, the display content of the target UI space can be refreshed according to the obtained user-defined multi-language editing information, so that the display content of the target UI control is updated to the user-defined translation included in the obtained user-defined multi-language editing information.
For example, in order to make the display content of the target UI control consistent with the display content before the restart after the first client is restarted, the first client may store the acquired customized multi-language editing information when the first client acquires the customized multi-language editing information, for example, store the acquired customized multi-language editing information in a form of a customized multi-language file, and refresh the display content of the target UI control according to the acquired customized multi-language editing information, so as to update the display content of the target UI control to a customized translation.
Illustratively, the obtained customized multilingual editing information can be stored in a local disk.
Illustratively, in order to improve the reading efficiency of the customized multilingual editing information, the acquired customized multilingual editing information may be cached in the memory.
Illustratively, under the condition that the user-defined multi-language editing information is successfully stored, the display content of the target UI control can be refreshed according to the user-defined multi-language editing information, so that the display content of the target UI control is updated into a user-defined translation, and the inconsistency between the display content of the target UI control after the application is restarted and the display content before the application is restarted can be avoided.
It should be noted that, in the embodiment of the present application, before the failure of saving the disk due to power failure or failure, the user-defined multi-language editing information that has been successfully saved may be used. For faults such as program crash, insufficient memory and the like, the user-defined multi-language state (which may include a state of user-defined multi-language editing and contents already edited) before the faults such as program crash, insufficient memory and the like can be recorded, and the APP is restarted, and then the operation is continuously and automatically returned to the last operation. And aiming at the conditions of sudden power failure of the mobile phone and the like, the step of manually re-operating the user-defined multi-language editing by the user is needed.
And step S120, reporting the customized multi-language editing information to the server under the condition that the reporting condition of the multi-language editing information is determined to be met, so that the server determines a multi-language updating file according to the received multi-language editing information under the condition that the updating condition is determined to be met, and updating the customized multi-language file for the corresponding client according to the multi-language updating file.
In the embodiment of the application, in order to realize communication between the user and the application developer on the translation content and improve the accuracy and comprehensiveness of the translation of the application, the client can report the acquired user-defined multi-language editing information to the server under the condition that the reporting condition of the multi-language editing information is met.
The server side can determine whether the upgrading condition is met or not when receiving the multi-language editing information reported by the client side, determine the multi-language updating file according to the received multi-language editing information when determining that the upgrading condition is met, and update the customized multi-language file for the corresponding client side according to the multi-language updating file, and the specific implementation can refer to the relevant description in the method flow shown in fig. 2.
It can be seen that, in the method flow shown in fig. 1, by enabling the user-defined multi-language editing information to the application program, the display content of the target UI control can be displayed as a translation (i.e., a user-defined translation) of the user-defined editing by performing the user-defined editing on the display content of the UI control supporting the user-defined multi-language editing in the application program, so that the translation of the display content of the UI control is more suitable for the language habit of the application area, the language of the multilingual translation of the application program can be expanded, an incorrect translation of the translated area can be corrected in time, and the accuracy and the comprehensiveness of the multilingual translation of the application program are improved; in addition, the obtained multilingual editing information is reported to the server side through the client side, and the server side updates the customized multilingual file of the corresponding client side under the condition that the upgrading condition is determined to be met, so that the communication between the user and the application program developer on the translation content is realized, and the accuracy and the comprehensiveness of the translation of the application program are further improved.
In some embodiments, the obtaining of the customized multilingual editing information in step S100 may include:
displaying a multi-language editing interface aiming at the target UI control under the condition that a user-defined multi-language editing instruction aiming at the target UI control is detected;
and acquiring the user-defined multi-language editing information input through the multi-language editing interface.
Illustratively, the display content of the target UI control can be customized and translated by inputting a customized multi-language editing instruction aiming at the target UI control.
Correspondingly, when a user-defined multi-language editing instruction is detected for the target UI control, if a click instruction for the target UI control is detected, a multi-language editing interface for the target UI control can be displayed, for example, an editable user-defined multi-language popup is popped up, and user-defined multi-language editing information input through the multi-language editing interface is obtained.
For example, a user may perform custom multi-language editing on a UI control by clicking on the UI control displayed on the UI interface. Under the condition that a user-defined multi-language editing instruction aiming at the target UI control is detected, an editable user-defined multi-language popup window can be popped up in a floating window mode on the upper layer of the current UI interface, and a user performs user-defined translation on the display content of the target UI control through the user-defined multi-language popup window.
It should be noted that, when a customized multilingual editing instruction for a target UI control is detected, a currently used multilingual translation may be displayed in a multilingual editing interface displayed for the target UI control, so as to improve the pertinence and accuracy of the customized translation.
In addition, for a UI control that does not support customized multilingual editing, when a customized multilingual editing instruction for the UI control is detected, for example, when a click instruction for the UI control is detected in a customized multilingual editing mode, the instruction may not be responded to.
In some embodiments, before the displaying the multilingual editing interface for the target UI control in the case that the customized multilingual editing instruction for the target UI control is detected, the method further includes:
under the condition that a first control instruction is detected, entering a user-defined multi-language editing mode, wherein the first control instruction is used for indicating a first client to enter the user-defined multi-language editing mode;
and under the condition of a multi-language editing mode, detecting a self-defined multi-language editing instruction aiming at the target UI control.
Illustratively, in order to improve the controllability of the customized multilingual editing and reduce the probability of occurrence of misoperation, an instruction for controlling the client to enter the customized multilingual editing mode may be preset.
Accordingly, in the case where a control instruction (referred to as a first control instruction herein) for controlling the first client to enter the customized multilingual editing mode is detected, such as a shake or a click instruction on a preset function button, the customized multilingual editing mode may be entered, and in the case of the customized multilingual editing mode, the customized multilingual editing instruction for the target UI control is detected, and in the case where the customized multilingual editing instruction for the target UI control is detected, the processing may be performed in the manner described in the above embodiment.
In one example, in the case of the multi-language editing mode, the method may further include:
and highlighting the UI control supporting the user-defined multi-language editing.
For example, considering that some UI controls may exist in the application program enabling the customized multilingual editing and do not support the customized multilingual editing, in order to improve the editing efficiency and improve the user experience, the UI controls supporting the customized multilingual editing may be highlighted in the multilingual editing mode.
For example, in the case of the multi-language editing mode, a prompt mark, such as a yellow box, may be masked on the UI control supporting the customized multi-language editing; alternatively, a red dot is displayed in the upper right corner.
For example, UI controls that support custom multi-language editing may be highlighted with the first client in the multi-language editing mode. The user can perform customized multi-language editing on the UI control by clicking the highlighted UI control. And under the condition that a user-defined multi-language editing instruction aiming at the target UI control is detected, an editable user-defined multi-language popup window can be popped up, and a user performs user-defined translation on the display content of the target UI control through the user-defined multi-language popup window.
In one example, the method further comprises:
and under the condition that a second control instruction is detected, exiting the user-defined multi-language editing mode and canceling the highlighting of the UI control supporting the user-defined multi-language editing, wherein the second control instruction is used for controlling the first client to exit the user-defined multi-language editing mode.
Illustratively, in order to avoid misoperation and optimize the display effect of the UI control of the application program, the client can be controlled to exit the customized multi-language editing mode under the condition of finishing customized multi-language editing.
Accordingly, upon detecting a control instruction (referred to herein as a second control instruction) for controlling the first client to exit the custom multilingual editing mode, such as a shake, or a click instruction on a preset function button, or the like, the custom multilingual editing mode may be exited and the highlighting of UI controls supporting the custom multilingual editing may be cancelled.
In some embodiments, the step S120 of determining that the multi-language editing information reporting condition is satisfied may include:
and under the condition that the user-defined multi-language editing aiming at the target UI control is finished, determining that the reporting condition of the multi-language editing information is met.
For example, when it is determined that the customized multi-language editing for the target UI control is completed, for example, when the second control instruction is detected, it is determined that the multi-language editing information reporting condition is satisfied, that is, the first client may automatically report the acquired customized multi-language editing information to the server when it is determined that the customized multi-language editing for the target UI control is completed, so as to improve the reporting efficiency of the customized multi-language editing information.
In other embodiments, the step S120 of determining that the condition for reporting the multi-language editing information is satisfied may include:
and determining that the multi-language editing information reporting condition is met under the condition that a reporting confirmation instruction aiming at the user-defined multi-language editing information is detected.
For example, in order to improve the controllability of reporting the customized multi-language editing information, before reporting the acquired customized multi-language editing information, reporting confirmation may be performed.
For example, when it is determined that the custom multilingual editing for the target UI control is completed, a prompt message may be output, where the prompt message is used to prompt the user to confirm whether the acquired custom multilingual editing information is to be reported, and when a report confirmation instruction for the acquired custom multilingual editing information is detected, it is determined that a multilingual editing information reporting condition is satisfied, and the acquired custom multilingual editing information is to be reported.
For example, the specific processing flow of the server when receiving the customized multilingual editing information reported by the client may refer to the related description below, and details are not described herein in this embodiment of the present application.
In some embodiments, the step S120 of reporting the customized multilingual editing information to the server may include:
and reporting the user-defined multi-language editing information and the region information of the first client to the server, so that the server determines the multi-language updating file of the first target region according to the received multi-language editing information and the region information under the condition that the multi-language file of the first target region meets the upgrading condition.
For example, in consideration of the fact that language habits of different regions may be different, in order to ensure the accuracy of customized multiple languages and make the customized multiple languages more fit with the language habits of users, the updating can be performed in combination with the regions under the condition of performing the update of the multiple language files.
Correspondingly, the first client can report the regional information of the first client to the server under the condition of reporting the multi-language editing information to the server.
For example, the region information of the client may be determined according to the relevant setting of the client by the user, for example, according to the attribution setting of the client (if not set, a default value may be used).
For example, the division of different regions may be divided according to a predetermined area range, for example, according to provinces, according to geographical large regions (e.g., east China, etc.)
The server side can count the customized multi-language editing information of different regions according to the region information when receiving the customized multi-language editing information reported by the client side and the region information, so as to determine whether the multi-language files of each region meet the upgrading condition, and determine the multi-language updating file of a first target region according to the received multi-language editing information of the first target region when determining that the multi-language files of a certain region (referred to as a first target region herein) meet the upgrading condition, and the specific implementation can refer to the related description in the method flow shown in fig. 2.
In some embodiments, after obtaining the customized multilingual editing information, the method may further include:
and sending the customized multi-language editing information to the second client so that the second client displays the customized translation according to the customized multi-language editing information under the condition of displaying the display content of the target UI control.
It should be noted that the second client does not refer to a fixed client, but may refer to one or more other clients of the same application as the first client.
For example, in order to implement sharing of the customized translation content between users, for the obtained customized multilingual editing information, the first client may send the customized translation content to the second client, for example, share the customized translation content to the second client through a local area network, bluetooth, or air delivery.
Under the condition that the second client receives the user-defined multi-language editing information sent by the first client, the user-defined translation included in the user-defined multi-language editing information can be displayed according to the user-defined multi-language editing information under the condition that the display content of the target UI control is displayed, so that user-defined translation conforming to local language habits can be rapidly diffused.
In some embodiments, the obtaining of the customized multilingual editing information in step S100 may include:
and receiving the customized multi-language editing information sent by the third client.
It should be noted that the third client does not refer to a fixed client specifically, but may refer to one or more other clients of the same application as the first client.
For an exemplary specific implementation process of the third client obtaining the customized multilingual editing information, reference may be made to the relevant description in the foregoing embodiment.
For the obtained customized multi-language editing information, the third client may share the information to the first client, and the specific implementation of the information may refer to the related description in the above embodiment.
In some embodiments, the method may further include:
under the condition that the first client is started, sending a state query request to the server, so that the server determines whether the first client needs to update or rollback the multi-language file according to the multi-language file version information of the first client;
downloading the multi-language update file from the server side under the condition that the multi-language file is determined to be needed to be updated, generating a multi-language backup file according to the local user-defined multi-language file, updating the local user-defined multi-language file according to the multi-language update file, and refreshing the display content of the UI control according to the updated local user-defined multi-language file; alternatively, the first and second electrodes may be,
under the condition that the multi-language file rollback is determined to be needed, replacing the local user-defined multi-language file with the multi-language backup file, and refreshing the display content of the UI control according to the replaced local user-defined multi-language file; alternatively, the first and second electrodes may be,
and under the condition that the updating or the rollback of the multi-language file is determined not to be needed, refreshing the display content of the UI control according to the local self-defined multi-language file.
For example, in the case of the first client starting, a status query request may be sent to the server to determine whether a multi-lingual file update or rollback is required.
For example, the status query request may carry version information of the multi-language file of the first client.
The server side can determine whether the first client side needs to update or rollback the multi-language file according to the multi-language file version information of the first client side under the condition that the server side receives the state query request.
For example, the server may compare the local multi-language file version information (i.e., the multi-language file version information of the server) with the received multi-language file version information of the first client (i.e., the multi-language file version information of the client), and in a case that the multi-language file version of the server is newer than the multi-language file version of the client, the server may determine that the first client needs to update the multi-language file; under the condition that the multi-language file version of the server side is older than that of the client side, the server side can determine that the first client side needs to perform multi-language file rollback; in case the multi-language file version at the server side is consistent with the multi-language file version at the client side, it may be determined that the first client does not need to perform multi-language file update or rollback.
The specific implementation of the server determining whether the client needs to perform multi-language file update or rollback may refer to the related description in the method flow shown in fig. 2.
The first client can download the multilingual update file from the server under the condition that the multilingual file update is determined to be needed, on one hand, the multilingual backup file is generated according to the local custom multilingual file, for example, the local custom multilingual file is copied to be used as the multilingual backup file, so that the rollback can be realized according to the multilingual backup file under the condition that the update fails; on the other hand, the local customized multi-language file can be updated according to the multi-language updating file, and the display content of the UI control can be refreshed according to the updated local customized multi-language file.
Illustratively, the multilingual file (including the multilingual update file, the local custom multilingual file, or the preset multilingual file, etc.) may include a plurality of key-value pairs (key-values), where key is a unique value of any entry required to be used by the preset current application for uniquely identifying the entry, and value is a translation of the entry.
For example, for any entry that needs to be used by the current application, a key may be assigned to uniquely identify the entry, a value corresponding to the key is a translation of the entry in the specified language, and the translation may include a default translation in preset multilingual files or a custom translation in custom multilingual files.
Taking the English translation as an example, a key can be set for any English entry required to be used by the current application program, and the default Chinese translation or the custom Chinese translation of the English entry is the value corresponding to the key.
For key-value pairs (namely, the same key) existing in the multilingual update file and the local self-defined multilingual file, if the values are different, the value in the multilingual update file is taken as the standard; adding a key-value pair which exists in the multi-language update file but does not exist in the local self-defined multi-language file into the local self-defined multi-language file; the key-value pairs that do not exist in the multilingual update file, but exist in the local custom multilingual file, remain unchanged.
Illustratively, under the condition that it is determined that the multi-language file rollback needs to be performed, the multi-language backup file can be used for replacing the local customized multi-language file, and the display content of the UI control is refreshed according to the replaced local customized multi-language file.
It should be noted that, in the above embodiment, the implementation description is directed to the case of performing rollback of a multi-language file to a previous version, and for the case of performing rollback of a multi-language file to multiple versions, for example, the initial version number of the multi-language file is 1.0, the version number of the server is 1.1 after the server performs a first update, and the version number of the server is 1.2 after the server performs a second update, and the server can roll back from the 1.2 version to 1.0 according to a detected instruction, for this case, the client downloads the multi-language update file from the server, and in the case of performing update of the multi-language backup file, the multi-language backup files with the same version number are stored as the old version of the multi-language file before use, and in the case of determining that the multi-language file rollback needs to be performed, the multi-language backup file with the same version number can be obtained from the stored multi-language backup files according to the version number of the multi-language file after the rollback, and rolling back the multilingual file according to the obtained multilingual backup file.
Illustratively, the version number of the multi-language version file is updated as the server side updates or rolls back the multi-language file, and the client side updates the multi-language file independently and does not update the version number of the multi-language file. For example, when the client side refreshes the display content of the target UI control according to the customized multilingual editing information input by the user, the version number of the multilingual file does not need to be updated.
Illustratively, in the case that it is determined that no multilingual file update or rollback is required, the display content of the UI control can be refreshed according to the local custom multilingual file.
For example, to implement the refreshing of the display content of the UI control, for any display content, whether a corresponding custom translation exists may be queried according to the key of the display content.
In the case that the corresponding custom translation exists, the custom translation corresponding to the key exists in the updated local custom multilingual file, the custom translation corresponding to the key exists in the replaced local custom multilingual file, or the custom translation corresponding to the key exists in the custom translation corresponding to the key, and the display content can be updated to the custom translation.
And under the condition that no corresponding self-defined translation exists, the display content can be displayed according to the translation in the preset multilingual file. It should be noted that, in the embodiment of the present application, when the client determines that the multi-language file rollback is required, but no multi-language backup file exists locally, the rollback operation may not be required.
Referring to fig. 2, a schematic flow chart of a data processing method provided in the embodiment of the present application is shown, where the data processing method may be applied to any server that supports an application program in the technical solution of the embodiment of the present application, and as shown in fig. 2, the data processing method may include the following steps:
and S200, receiving the user-defined multi-language editing information reported by the client.
In the embodiment of the present application, the specific implementation of the client reporting the customized multilingual editing information to the server can be referred to the related description in the above method embodiment.
And step S210, determining a multi-language updating file according to the received multi-language editing information under the condition that the upgrading condition is determined to be met.
And S220, updating the customized multi-language file for the corresponding client according to the multi-language updating file.
In the embodiment of the application, in order to improve the accuracy of the translation of the display content of the UI control and make the translation of the display content of the UI control more fit with the language habit of the application environment, the server may determine whether the translation of the display content of the UI control needs to be updated (also referred to as upgrading) in a unified manner according to the received multilingual editing information.
Illustratively, under the condition that the upgrading condition is determined to be met, the server side can determine a multi-language updating file of the display content of the UI control according to the received multi-language editing information, and perform customized multi-language file updating on the corresponding client side according to the multi-language updating file.
For example, the server may update the version information of the multi-language file when determining that the upgrade condition is satisfied and determining the multi-language update file, so that the client may update the customized multi-language file according to the multi-language update file when determining that the client needs to update the multi-language file according to the version information of the local multi-language file and the multi-language file version information of the client.
In some embodiments, the step S210 of determining that the upgrade condition is satisfied may include:
for any entry in the received multi-language editing information, determining the proportion of different self-defined translations corresponding to the entry according to the received multi-language editing information;
determining that the entry meets the updating condition under the condition that the ratio of the user-defined translation with the highest ratio exceeds a preset ratio threshold;
and determining that the upgrading condition is met under the condition that the number of the entries meeting the updating condition reaches a preset number threshold.
Illustratively, the server may count proportions of different custom translations corresponding to each entry in the received multilingual editing information according to the received multilingual editing information.
For example, assuming that the number of the custom translations 1 corresponding to the entry a in the multilingual editing information received by the server is 100 (that is, there are 100 multilingual editing information reported by the client to translate the entry a into the custom translation 1), the number of the custom translations 2 is 200, the number of the custom translations 3 is 300, and the number of the custom translations 4 is 400 (assuming that the entry a corresponds to 4 different custom translations in total), the proportions of the custom translation 1, the custom translation 2, the custom translation 3, and the custom translation 4 are 10%, 20%, 30%, and 40% in sequence for the entry a.
In order to improve the accuracy of the multilingual translation of the application program, for any entry, under the condition that the user-defined translation with the highest ratio in the corresponding different user-defined translations is determined, whether the ratio of the user-defined translation with the highest ratio exceeds a preset ratio threshold (the value can be set according to an actual scene) or not can be determined, and under the condition that the ratio of the user-defined translation with the highest ratio exceeds the preset ratio threshold, the user-defined translation with the highest ratio is determined as the target user-defined translation corresponding to the entry, so that the situation that the translations of the display contents of the UI control are uniformly updated into different universal translations under the condition that the differences of the user-defined translations of the display contents of the same UI control are large is avoided.
In one example, the server may determine the custom translation with the highest proportion as the target custom translation corresponding to the entry.
In another example, the server may display the custom translation with the highest proportion in a designated interface, confirm the custom translation by the relevant person, and determine the custom translation with the highest proportion as the target custom translation corresponding to the entry when a confirmation instruction is detected; and under the condition that a modification instruction for the custom translation is detected, modifying the custom translation according to the modification instruction, and determining the modified custom translation as a target custom translation corresponding to the vocabulary entry.
For example, the server may determine whether each entry meets the update condition according to the above manner, count the number of entries meeting the update condition, and determine that the upgrade condition is met when the number of entries meeting the update condition reaches a preset number threshold.
It should be noted that, when the server determines that the number of entries meeting the update condition reaches the preset number threshold, a prompt message may be output to prompt the relevant person that the upgrade condition is currently met, and when a confirmation instruction is detected, it is determined that the upgrade condition is met.
In one example, for any entry in the received multilingual editing information, determining the custom translation with the highest proportion corresponding to the entry as the target custom translation corresponding to the entry according to the received multilingual editing information, wherein the determining a multilingual update file according to the received multilingual editing information includes:
and for any entry, under the condition that the target self-defined translation corresponding to the entry exists, adding the corresponding relation between the entry and the target self-defined translation corresponding to the entry to the multi-language updating file.
In an example, the receiving the customized multilingual editing information reported by the client may include:
receiving user-defined multi-language editing information and regional information reported by a client;
the determining, for any entry in the received multilingual editing information, the percentage of different custom translations corresponding to the entry according to the received multilingual editing information may include:
determining the self-defined multi-language editing information of the same region according to the self-defined multi-language editing information and the region information;
for any entry included in the user-defined multi-language editing information of any region, determining the ratio of different user-defined translations corresponding to the entry according to the multi-language editing information of the region;
the determining that the upgrade condition is met under the condition that the number of the entries meeting the update condition reaches the preset number threshold may include:
for any region, determining that the region meets the upgrading condition under the condition that the number of the entries meeting the updating condition in the region reaches a preset number threshold.
For example, in consideration of the fact that language habits of different regions may be different, in order to ensure the accuracy of customized multiple languages and make the customized multiple languages more fit with the language habits of users, the updating can be performed in combination with the regions under the condition of performing the update of the multiple language files.
Correspondingly, the client can report the regional information of the client to the server under the condition of reporting the multi-language editing information to the server.
The relevant implementation of reporting the area information from the client to the server may refer to the relevant description in the method flow shown in fig. 1.
Illustratively, the server side can count the user-defined multi-language editing information of different regions according to the region information under the condition that the user-defined multi-language editing information reported by the client side and the region information are received, and respectively determine the proportion of different user-defined translations corresponding to each entry of each region.
For any region, the server side can count the proportion of different custom translations corresponding to each entry in the region; for any entry, the server side can determine the custom translation with the highest proportion corresponding to the entry, and determine the custom translation with the highest proportion as the target custom translation corresponding to the entry when the proportion of the custom translation with the highest proportion exceeds a preset proportion threshold.
For any region, under the condition that the number of entries meeting the updating condition in the region reaches a preset number threshold, the multilingual file in the region can be determined to meet the updating condition.
In some embodiments, in step S220, the updating the customized multilingual file for the corresponding client according to the multilingual update file may include:
receiving a state query request sent by a client, wherein the state query request at least comprises multi-language file version information of the client;
and determining whether the client needs to update or rollback the multi-language files according to the multi-language file version information of the client and the local multi-language file version information, and outputting a determination result to the client, wherein the determination result comprises one of the need of updating the multi-language files, the need of rolling the multi-language files and the need of updating or rolling the multi-language files.
For example, the implementation process of sending the status query request from the client to the server may refer to the relevant description in the embodiment of the method shown in fig. 1.
Illustratively, when the server receives a status query request sent by a client, the server may obtain the multi-language file version information of the client carried in the status query request, and determine whether the client needs to update or rollback the multi-language file according to the multi-language file version information of the client and the local multi-language file version information.
For example, in a case where the server determines that the local multi-language file version is higher than the multi-language file version of the client according to the multi-language file version information of the client and the local multi-language file version information, for example, the server performs multi-language file version update, but the client is not updated yet, and the server may determine that the client needs to perform multi-language file update, and output a determination result.
In the case that the server determines that the local multi-language file version is lower than the multi-language file version of the client according to the multi-language file version information of the client and the local multi-language file version information, for example, after the server updates the multi-language file version last time, relevant personnel determine that the update needs to be cancelled (if the update file has an error), and restore the multi-language file of the server to the version before the update last time.
Under the condition that the server side determines that the local multi-language file version is consistent with the multi-language file version of the client side according to the multi-language file version information of the client side and the local multi-language file version information, the server side can determine that the client side does not need to update or rollback the multi-language file.
In one example, the status query request further includes region information of the client;
the determining whether the client needs to update or rollback the multi-language file according to the multi-language file version information of the client and the local multi-language file version information may include:
determining multi-language file version information of a second target region from the local multi-language file version information according to the region information of the client; the second target area is an area matched with the area information of the client;
and determining whether the client needs to update or rollback the multi-language file according to the multi-language file version information of the client and the multi-language file version information of the second target region.
Illustratively, in order to ensure the accuracy of customized multiple languages and make the customized multiple languages more fit with the language habits of users, updating can be performed in combination with regions under the condition of performing multi-language file updating.
Correspondingly, the state query request sent by the client to the server can also carry the region information of the client.
The server side can obtain the region information and the multi-language file version information in the state query request under the condition that the server side receives the state query request sent by the client side, determines the multi-language file version information of a region (called a second target region in the text) matched with the address information of the client side from the multi-language file version information of the server side according to the region information, and determines whether the client side needs to update or rollback the multi-language file according to the multi-language file version information of the client side and the multi-language file version information of the second region.
The specific implementation of determining whether the client needs to update or rollback the multi-language file by the server according to the multi-language file version information of the client and the multi-language file version information of the server can refer to the relevant description in the above embodiment.
In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application, the technical solutions provided by the embodiments of the present application are described below with reference to specific examples.
Some terms appearing hereinafter will be explained first.
Embodiment one, user-defined multilingual flow
Referring to FIG. 3, a user-defined multilingual major flow may be as shown in FIG. 3, which may include the following steps:
and 3.1, monitoring operation instructions such as shaking the mobile equipment once or opening a preset switch supporting user-defined multi-language configuration and the like.
3.2, under the condition that the operation instruction in the step 3.1 is monitored, starting a custom mode, and covering a prompt mark (such as a yellow box) on a UI control supporting the custom multilingual.
3.3, under the condition that a click instruction for the UI control is detected, the control which does not support the user-defined mode is not processed; and for the control supporting the custom mode, popping up an editable custom multi-language popup window, and displaying the currently used multi-language translation by an edit box.
And 3.4, acquiring the user-defined multi-language editing information input through the user-defined multi-language popup, and trying to store the user-defined multi-language editing information. If the storage fails, no modification is made, requiring the user to re-trigger step 3.3. And if the storage is successful, refreshing the UI control.
And 3.5, monitoring control instructions such as shaking the mobile equipment once again or closing a preset switch supporting the user-defined multi-language configuration and the like.
And 3.6, closing the custom mode under the condition of monitoring the operation instruction in the step 3.5, removing the suggestive mark on the UI control, and recovering the UI control.
And 3.7, uploading the user-defined multi-language files and the regional information back to the server under the condition of automatic or inquiry of the user.
For example, the updating of the customized multilingual translation may be performed in conjunction with regional information, considering that language habits of different regions may be significantly different.
Correspondingly, under the condition that the client needs to report the customized multi-language file, the customized multi-language file and the region information can be uploaded to the server together.
And 3.8, the server performs big data analysis according to the region information and the user-defined multi-language file, and selects the multi-language fitting the language habit of the user in the specified region for upgrading and maintenance.
Second embodiment, user sharing custom multilingual document
Referring to fig. 4, the main process of sharing the customized multilingual document by the user can be shown in fig. 4, which mainly includes the following steps:
4.1, the client A shares the customized multi-language file to other clients, such as the client B, in a local area network (such as air delivery) or non-local area network sharing mode.
For example, the local area network sharing mode may include a short-distance closed transmission mode such as air delivery, bluetooth, an application self-building server, and the like; the non-local area network sharing mode may include other wide area network sharing modes besides the local area network sharing mode, such as sharing through email or instant messaging software.
4.2, after the client B imports the multi-language file shared by the client A, the application program is refreshed, and the multi-language customized by the client A can be obtained.
Embodiment three, updating multiple languages conforming to user language habits
Referring to fig. 5, a main flow of updating multiple languages according to the language habits of the user may be as shown in fig. 5, which may include the following steps:
and 5.1, the server counts the proportion conditions of different values (namely the customized translations of different users) corresponding to the keys (namely the predefined unique identifiers of the entries) of the entries according to the customized multi-language files uploaded by the users in a certain area, and generates a statistical comparison result.
5.2, according to the statistical result generated by the server, the personnel of products or operation and the like preferentially use the translation with high ratio (which can be considered to be fit with the language habit of the user in the region), and modify or directly use the statistical comparison result generated by the server in combination with other considerations.
And 5.3, generating a multi-language update file and updating the check result of the multi-language file update check interface.
Example four APP update/rollback multilingual File
Referring to fig. 6, the main flow of APP updating/rolling back a multilingual file can be as shown in fig. 6, which may include the following steps:
6.1, when the APP client is started, sending a state query request to the server to request to check whether the multilingual file needs to be updated or rolled back.
The state query request carries the multi-language file version number and the region information of the APP client.
6.2, if the processing is not needed, executing the step 6.3.
6.3. Reading the multi-language file and refreshing the UI control.
6.4, if rollback is needed, the multi-language backup file is replaced with the user-defined multi-language file, the multi-language backup file is deleted, and finally the step 6.3 is executed.
6.5, if the updating is needed, downloading the multilingual updating language files of the corresponding region of the user, then replacing the multilingual backup files with the customized multilingual files, merging the multilingual updating files into the customized multilingual files, and finally executing the step 6.3.
Embodiment five, SDK Overall architecture
Referring to fig. 7, the overall architecture design of the SDK may be as shown in fig. 7, where:
the overall architecture is designed to be an MVC (Model-View-Controller) three-layer structure of a UI layer, an LS (Local String) layer and a DB (DataBase) layer.
The UI layer corresponds to a V in the MVC three-layer structure and is responsible for interface display; the LS layer corresponds to C in the MVC three-layer structure and is responsible for service logic between the model and the view; the DB layer corresponds to M in the MVC three-layer structure and is responsible for providing data.
7.1, UI layer is UI control supporting self-defined multi-language (such as Text, Input, Button, etc.). And extended attributes and methods that support custom multilinguals.
Illustratively, the iOS and the Android respectively adopt a runtime mode and an annotation and reflection mode to extend the support attribute and the method, and for the visual layout file, respectively adopt an ibaspect (a technology for customizing the visual attribute of the iOS layout file) mode and an xmlns (an XML Namespaces technology) mode to extend the support attribute.
7.2, the LS layer is divided into an LSManager (LS manager) and an LScache (LS cache). The LSManager is mainly responsible for returning the multi-language to be displayed by the UI control, and the LScache is mainly responsible for storing and reading a Memory cache (Memory) and a Disk cache (Disk) of a user-defined multi-language.
7.3, the DB layer is composed of a preset multi-language File (Preinstall File) and a user-defined multi-language File (DIY File).
The specific workflow may be as shown in fig. 8, and includes the following steps:
8.1, when the UI control needs to display multiple languages, firstly, a corresponding multiple language value (namely value) is obtained from the LSManager according to the key of the entry to be displayed.
8.2, the LSManager calls the LScache to obtain the multi-language value according to the key.
8.3, the LScache judges whether the memory cache has a corresponding custom value or not, and if the memory cache has the corresponding custom value, the memory cache returns the custom value to the LSManager; and if the corresponding self-defined value is not cached, reading the disk cache. And if the disk cache has the corresponding custom value, returning the custom value to the LSManager, and storing the cache content of the disk into the memory cache.
And 8.4, if the user-defined value is not obtained in the LScache, the LSManager reads the preset multi-language file and returns the multi-language value to the UI control.
Ninth embodiment, interactive flow of custom multilingual editing
Referring to fig. 9, the interactive flow of the customized multilingual editing can be as shown in fig. 9, which can include the following steps:
9.1, popping up an editable custom multi-language popup window under the condition that a custom multi-language editing instruction is detected.
9.2, obtaining the user-defined multi-language editing information input through the editable user-defined multi-language popup window, calling the LScache to store the user-defined multi-languages, if the disk cache is successful, storing the user-defined multi-languages into the memory cache, and refreshing the UI; if the storage fails, no modification is made.
9.3, under the condition that an instruction for closing the customized multilingual editing mode is detected, uploading the customized multilingual file to the server, and carrying out big data analysis by the server according to the customized multilingual condition of the region, and selecting the multilingual conforming to the language habit of the user in the region for upgrading and maintenance.
The methods provided herein are described above. The following describes the apparatus provided in the present application:
referring to fig. 10, a schematic structural diagram of a data processing apparatus provided in an embodiment of the present application is shown, where the data processing apparatus may be applied to a client in the foregoing embodiment, for example, a first client, and as shown in fig. 10, the data processing apparatus may include:
an obtaining unit 1010 configured to obtain custom multilingual editing information; the user-defined multi-language editing information comprises a user-defined translation of the display content of the target user interface UI control;
a processing unit 1020, configured to refresh the display content of the target UI control according to the customized multilingual edit information, so that the display content of the target UI control is updated to the customized translation;
a sending unit 1030, configured to report the customized multilingual editing information to the server if it is determined that the reporting condition of the multilingual editing information is met, so that the server determines a multilingual update file according to the received multilingual editing information and updates the customized multilingual file on the corresponding client according to the multilingual update file if it is determined that the upgrading condition is met.
In some embodiments, the obtaining unit 1010 is specifically configured to, in a case that a customized multilingual editing instruction for the target UI control is detected, display a multilingual editing interface for the target UI control; and acquiring the user-defined multi-language editing information input through the multi-language editing interface.
In some embodiments, as shown in FIG. 11, the data processing apparatus may further include
The mode control unit 1040 is configured to enter a custom multilingual editing mode when the first control instruction is detected; the first control instruction is used for controlling the first client to enter a user-defined multi-language editing mode; highlighting a UI control supporting the user-defined multi-language editing;
the mode control unit 1040 is further configured to, when a second control instruction is detected, exit the customized multilingual editing mode and cancel highlighting of a UI control supporting customized multilingual editing; and the second control instruction is used for controlling the first client to exit the user-defined multi-language editing mode.
In some embodiments, the sending unit 1030 is configured to report the customized multilingual editing information and the region information of the first client to the server, so that the server determines a multilingual update file of a first target region according to the received multilingual editing information and the region information when determining that the multilingual file of the first target region meets an upgrade condition.
In some embodiments, the sending unit 1030 is further configured to send the customized multilingual editing information to a second client, so that the second client displays the customized translation according to the customized multilingual editing information when displaying the display content of the target UI control.
In some embodiments, the sending unit 1030 is further configured to send a status query request to the server when the first client is started, so that the server determines whether the first client needs to perform multi-language file update or rollback according to the multi-language file version information of the first client;
the processing unit 1020 is further configured to download a multilingual update file from the server, generate a multilingual backup file according to the local custom multilingual file, update the local custom multilingual file according to the multilingual update file, and refresh the display content of the UI control according to the updated local custom multilingual file, if it is determined that the multilingual file update is needed; or under the condition that the multi-language file rollback is determined to be needed, replacing the local user-defined multi-language file with the multi-language backup file, and refreshing the display content of the UI control according to the replaced local user-defined multi-language file; or, under the condition that the updating or the rollback of the multi-language file is determined not to be needed, the display content of the UI control is refreshed according to the local self-defined multi-language file.
Referring to fig. 12, a schematic structural diagram of a data processing apparatus provided in an embodiment of the present application is shown, where the data processing apparatus may be applied to a server in the foregoing embodiment, and as shown in fig. 12, the data processing apparatus may include:
a receiving unit 1210, configured to receive custom multi-language editing information reported by a client;
a determining unit 1220, configured to determine a multilingual update file according to the received multilingual editing information if it is determined that the upgrade condition is satisfied;
the processing unit 1230 is configured to perform customized multi-language file update on the corresponding client according to the multi-language update file.
In some embodiments, the determining unit 1220 is specifically configured to determine, for any entry in the multilingual editing information received by the receiving unit, a proportion of different custom translations corresponding to the entry according to the received multilingual editing information; determining that the entry meets the updating condition under the condition that the ratio of the user-defined translation with the highest ratio exceeds a preset ratio threshold; and determining that the upgrading condition is met under the condition that the number of the entries meeting the updating condition reaches a preset number threshold.
In some embodiments, the determining unit 1220 is specifically configured to, for any entry in the multilingual editing information received by the receiving unit, determine, according to the received multilingual editing information, a custom translation corresponding to the entry with a highest proportion as a target custom translation corresponding to the entry;
and under the condition that the upgrading condition is met, for any entry, under the condition that the target custom translation corresponding to the entry exists, adding the corresponding relation between the entry and the target custom translation corresponding to the entry to the multi-language updating file.
In some embodiments, the receiving unit 1210 is specifically configured to receive user-defined multi-language editing information and regional information reported by a client;
the determining unit 1220 is specifically configured to determine the customized multi-language editing information of the same region according to the customized multi-language editing information and the region information; for any entry included in the user-defined multi-language editing information of any region, determining the ratio of different user-defined translations corresponding to the entry according to the multi-language editing information of the region;
the determining unit 1220 is further specifically configured to determine, for any region, that the multilingual file in the region meets the upgrade condition when the number of entries meeting the update condition in the region reaches a second preset number threshold.
In some embodiments, the receiving unit 1210 is further configured to receive a status query request sent by a client, where the status query request includes at least multi-language file version information of the client;
the processing unit 1230 is specifically configured to determine whether the client needs to perform multi-language file update or rollback according to the multi-language file version information of the client and the local multi-language file version information, and output a determination result to the client, where the determination result includes one of the need to perform multi-language file update, the need to perform multi-language file rollback, and the need not to perform multi-language file update or rollback.
In some embodiments, the status query request further includes region information of the client;
the processing unit 1230 is further configured to determine, according to the region information of the client, multi-language file version information of a second target region from the local multi-language file version information; the second target region is a region matched with the region information of the client; and determining whether the client needs to update or rollback the multi-language file according to the multi-language file version information of the client and the multi-language file version information of the second target region.
The embodiment of the application also provides an electronic device, which comprises a processor and a memory, wherein the memory is used for storing the computer program; and a processor for implementing the data processing method described above when executing the program stored in the memory.
Fig. 13 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present disclosure. The electronic device may include a processor 1301, a memory 1302 storing machine executable instructions. The processor 1301 and the memory 1302 may communicate via a system bus 1303. Also, the processor 1301 may perform the data processing methods described above by reading and executing machine-executable instructions in the memory 1302 corresponding to the data processing logic.
The memory 1302 referred to herein may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: a RAM (random Access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
In some embodiments, there is also provided a machine-readable storage medium, such as the memory 1302 in fig. 13, having stored therein machine-executable instructions that, when executed by a processor, implement the data processing method described above. For example, the machine-readable storage medium may be a ROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and so forth.
Embodiments of the present application also provide a computer program, which is stored in a machine-readable storage medium, such as the memory 1302 in fig. 13, and when executed by a processor, causes the processor 1301 to execute the data processing method described above.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.