CN110457085B - File processing method and device, terminal equipment and computer readable medium - Google Patents

File processing method and device, terminal equipment and computer readable medium Download PDF

Info

Publication number
CN110457085B
CN110457085B CN201910620517.3A CN201910620517A CN110457085B CN 110457085 B CN110457085 B CN 110457085B CN 201910620517 A CN201910620517 A CN 201910620517A CN 110457085 B CN110457085 B CN 110457085B
Authority
CN
China
Prior art keywords
language
target
target application
response
sandbox
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910620517.3A
Other languages
Chinese (zh)
Other versions
CN110457085A (en
Inventor
田洪银
罗熹之
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201910620517.3A priority Critical patent/CN110457085B/en
Publication of CN110457085A publication Critical patent/CN110457085A/en
Application granted granted Critical
Publication of CN110457085B publication Critical patent/CN110457085B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • G06F9/454Multi-language systems; Localisation; Internationalisation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Document Processing Apparatus (AREA)
  • Machine Translation (AREA)

Abstract

The embodiment of the application discloses a file processing method, a file processing device, terminal equipment and a computer readable medium. An embodiment of the method comprises: in response to the detection of the starting of the target application, sending a language configuration file acquisition request to a cloud server, and receiving a plurality of language configuration files returned by the cloud server; storing the received language configuration files into a sandbox; determining a target language to be used by the target application; searching a target language configuration file of the target language from the sandbox; in response to finding, displaying text in the target language in the target application based on the target language profile. This embodiment reduces development costs when adding new language support to iOS applications.

Description

File processing method and device, terminal equipment and computer readable medium
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a file processing method, a file processing device, terminal equipment and a computer readable medium.
Background
With the development of computer technology, the types of languages supported by Applications (APPs) of terminal devices are more and more abundant. Generally, after an application is released, developers can further add new language support to the application as the scope of use and user needs expand. For example, the original application supports both chinese and english, and languages such as japanese and korean may be added.
For an application (i.e., an iOS application) running on an iOS system (a mobile operating system), the existing method generally adds a new language by adding a language file (e.g., a language file) to an executable file (bundle file) of the existing application, so as to generate a new version of the application. After the user updates the application of the new version, the new language can be displayed in the application. However, this approach requires a new application version to be released each time new language support is added, resulting in higher development costs when adding new language support to the application.
Disclosure of Invention
The embodiment of the application provides a file processing method, a file processing device, terminal equipment and a computer readable medium, so as to solve the technical problem that in the prior art, the development cost is high when language support is added to the iOS application.
In a first aspect, an embodiment of the present application provides a file processing method, which is applied to a terminal device, where the terminal device runs an iOS operating system and is installed with a target application, and the method includes: in response to the detection of the starting of the target application, sending a language configuration file acquisition request to the cloud server, and receiving a plurality of language configuration files returned by the cloud server; storing the received language configuration files into a sandbox; determining a target language to be used by a target application; searching a target language configuration file of a target language from the sandbox; in response to the finding, displaying text in the target language in the target application based on the target language profile.
In some embodiments, after finding the target language profile for the target language from the sandbox, the method further comprises: and in response to the condition that the language configuration file is not found, reading a preset language configuration file in an executable file of the target application, and storing the preset language configuration file into the sandbox.
In some embodiments, determining a target language to be used by the target application comprises: acquiring current position information, a default language and a default region preset by a user; determining whether the current position indicated by the current position information is located in a default area or not in response to the success of the current position information acquisition; in response to the fact that the current application is determined not to be located in the default area, determining whether the time interval between the current time and the last time of displaying the reminding information is larger than or equal to a preset reminding time interval or not, wherein the reminding information is used for reminding a user to switch the display language of the target application to the language of the location of the current position; in response to determining that the time interval is greater than or equal to the preset reminding time interval, displaying reminding information; and in response to detecting a language switching instruction triggered by the user aiming at the reminding information, determining the language used at the current position as the target language to be used by the target application.
In some embodiments, determining a target language to be used by the target application further comprises: determining a default language as a target language to be used by the target application in any of: the current position information fails to be acquired; or the current location is in a default zone; or the time interval between the current time and the last time of displaying the reminding information is less than the preset reminding time interval; or the language switching instruction triggered by the user aiming at the reminding information is not detected.
In some embodiments, displaying text in the target language in the target application based on the target language profile in response to finding the text in the target language comprises: in response to finding, performing the steps of: storing the target language configuration file into a memory; triggering a text display instruction, wherein the text display instruction comprises a keyword; searching keywords from a target language configuration file in a memory; and returning the text of the target language corresponding to the keywords and displaying the text in the target application.
In a second aspect, an embodiment of the present application provides a file processing apparatus, which is applied to a terminal device, where the terminal device runs an iOS operating system and is installed with a target application, and the apparatus includes: the sending unit is configured to respond to the detection of the starting of the target application, send a language configuration file obtaining request to the cloud server and receive a plurality of language configuration files returned by the cloud server; a first storing unit configured to store the received language configuration files into a sandbox; a determination unit configured to determine a target language to be used by a target application; a searching unit configured to search a target language configuration file of a target language from the sandbox; a display unit configured to display text of the target language in the target application based on the target language profile in response to the finding.
In some embodiments, the apparatus further comprises: and the second storing unit is configured to read the preset language configuration file in the executable file of the target application in response to the condition that the preset language configuration file is not found, and store the preset language configuration file into the sandbox.
In some embodiments, the determining unit is further configured to: acquiring current position information, a default language and a default region preset by a user; responding to the success of the current position information acquisition, and determining whether the current position indicated by the current position information is located in a default area; in response to the fact that the current time and the time interval of the last time display reminding information are not located in the default area, determining whether the current time and the time interval of the last time display reminding information are larger than or equal to a preset reminding time interval or not, wherein the reminding information is used for reminding a user to switch the display language of the target application to the language of the location of the current position; in response to determining that the time interval is greater than or equal to the preset reminding time interval, displaying reminding information; and in response to detecting a language switching instruction triggered by the user aiming at the reminding information, determining the language used at the current position as the target language to be used by the target application.
In some embodiments, the determining unit is further configured to: determining the default language as the target language to be used by the target application in any of the following cases: the current position information fails to be acquired; or the current location is in a default zone; or the time interval between the current time and the last time of displaying the reminding information is less than the preset reminding time interval; or the language switching instruction triggered by the user aiming at the reminding information is not detected.
In some embodiments, the display unit is further configured to: in response to finding, performing the steps of: storing the target language configuration file into a memory; triggering a text display instruction, wherein the text display instruction comprises a keyword; searching keywords from a target language configuration file in a memory; and returning the text of the target language corresponding to the keywords and displaying the text in the target application.
In a third aspect, an embodiment of the present application provides a terminal device, including: one or more processors; storage means having one or more programs stored thereon which, when executed by one or more processors, cause the one or more processors to implement a method as in any one of the embodiments of the first aspect described above.
In a fourth aspect, the present application provides a computer-readable medium, on which a computer program is stored, which when executed by a processor implements the method according to any one of the embodiments of the first aspect.
According to the file processing method, the file processing device, the terminal device and the computer readable medium, after the terminal device running the iOS system detects that the target application installed on the terminal device is started, the plurality of language configuration files are obtained from the cloud server, then the received language configuration files are stored in the sandbox, the target language to be used by the target application is determined, the target language configuration file of the target language is searched from the sandbox, and therefore the text of the target language can be displayed in the target application on the basis of the target language configuration file searched from the sandbox. Therefore, after the target application is started, the latest language configuration file can be automatically requested from the cloud server, the language configuration file is stored by the sandbox, the executable file (bundle file) of the application does not need to be updated, and a new application version does not need to be released when a new language is added. Thereby, the development cost when adding new language support to iOS applications is reduced.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is a flow diagram of one embodiment of a document processing method according to the present application;
FIG. 2 is a flow diagram of one embodiment of a method of determining a target language according to the present application;
FIG. 3 is a flow diagram of yet another embodiment of a document processing method according to the present application;
FIG. 4 is a schematic block diagram of one embodiment of a document processing apparatus according to the present application;
fig. 5 is a schematic structural diagram of a computer system suitable for implementing a terminal device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that, in the present application, the embodiments and features of the embodiments may be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Referring to FIG. 1, a flow 100 of one embodiment of a document processing method according to the present application is shown. The file processing method can be applied to terminal equipment. In practice, terminal devices include, but are not limited to, smart phones, tablets, laptop portable computers, and the like.
The terminal device may run an iOS operating system and may be installed with a target application (which may be various iOS applications running on the iOS system).
The process 100 may include the following steps:
step 101, in response to detecting that the target application is started, sending a language configuration file acquisition request to the cloud server, and receiving a plurality of language configuration files returned by the cloud server.
In this embodiment, an execution subject of the file processing method (for example, the terminal device described above) may send a language profile acquisition request to the cloud server and receive a plurality of language profiles returned by the cloud server in response to detecting that the target application is started.
The language configuration file may be a file for language support of the target application. The plurality of language profiles may support a plurality of languages. Each language profile may support one language. For example, the plurality of language profiles may include, but are not limited to: chinese configuration files, english configuration files, japanese configuration files, korean configuration files, and the like.
In practice, when the target application is first launched, the language configuration file is not stored in the sandbox. After a language configuration file acquisition request is sent to the cloud server and each language configuration file returned by the cloud server is received, the language configuration files can be stored in the sandbox.
When the target application is started next time, the sandbox stores the language configuration files stored when the target application is started last time. At this time, after the language configuration file acquisition request is sent to the cloud server, if a plurality of language configuration files returned by the cloud server are received, the language configuration files in the sandbox may be updated. For example, the language profiles already stored in the sandbox may be updated in full. Specifically, the language profiles in the sandbox are first deleted, and then the newly received language profiles are stored in the sandbox. As another example, incremental updates may be made to language configuration files already stored in the sandbox. Specifically, the newly received language configuration file may be compared with the language configuration file in the sandbox to determine the newly added language configuration file and the language configuration file to be updated; and then, writing the newly added language configuration file into the sandbox, and correspondingly replacing the language configuration file needing to be updated in the sandbox.
And 102, storing the received language configuration files into a sandbox.
In this embodiment, when a plurality of language configuration files returned by the cloud server are successfully received, the execution subject may store each received language configuration file in a sandbox (sandbox).
In practice, a sandbox is a security mechanism that provides an isolated environment for running programs. Often, the process is used for experimentation purposes as a source of unreliable or uncertain process intent. Sandboxes generally tightly control the resources that programs therein can access. All changes in the sandbox do not cause any loss to the operating system. The sandbox may run the software in a restricted system environment and control the resources (e.g., file descriptors, memory, disk space, etc.) available to the program. Due to the above-mentioned characteristics of the sandbox, the storing of the plurality of language profiles into the sandbox can make the change of the content in the sandbox (e.g. adding a new language profile) not affect the normal use of the target application. And changing the content in the sandbox without involving the version update of the target application. Thus, it is possible to store a new language configuration file or update a language configuration file without updating the version of the target application.
It should be noted that the preset language configuration file may be one or more. When one preset language profile is present, the preset language profile may be a default language profile that provides support for a default language (e.g., chinese). When the preset language configuration file is plural, it may be a plurality of language configuration files providing support for a plurality of languages (for example, chinese, english, japanese, korean, etc.), respectively, and the plural preset language configuration files may include a default language configuration file supporting a default language (for example, chinese).
Step 103, determining a target language to be used by the target application.
In this embodiment, the execution subject may determine the target language to be used by the target application by using various preset rules.
As an example, a default language set by the user for the terminal device may be determined as a target language to be used by the target application.
As yet another example, a location may be first determined, determining a current location; then, the language of the region where the current location is located can be determined as the target language to be used by the target application.
As another example, if the target application is not started for the first time, the language used in the last start may be used as the target language to be used by the target application.
It should be noted that, the manner or rule for determining the target language to be used by the target application may be preset according to needs, and is not limited herein.
And 104, searching a target language configuration file of the target language from the sandbox.
In this embodiment, after determining the target language, the execution subject may search for the target language configuration file of the target language from the sandbox. If so, step 105 may be performed.
In practice, when the target application is started for the first time and does not receive feedback from the cloud server, the target language configuration file cannot be found because no language configuration file is stored in the sandbox. Typically, when a network is not connected or a connected network is unavailable, feedback from the cloud server cannot be received.
In addition, when the target application is not started for the first time and the feedback of the cloud server is not received, although the language configuration file acquired after the last start is stored in the sandbox, if the stored file does not include the target language configuration file for the target language (for example, when the last start is performed, a technician has not developed the target language configuration file for the target language), the target application cannot be found.
In addition, after any starting of the target application (including the first starting and the non-first starting), if the feedback of the cloud server is received, but the content fed back by the cloud server does not include the target language configuration file (for example, a technician does not yet develop the target language configuration file for the target language), the target language configuration file cannot be found from the sandbox.
In some optional implementation manners of this embodiment, if the language configuration file is not found, a preset language configuration file in an executable file (e.g., a bundle file) of the target application may be read, and the preset language configuration file may be stored in the sandbox.
It should be noted that the preset language configuration file may be one or more. When one preset language profile is present, the preset language profile may be a default language profile that provides support for a default language (e.g., chinese). When the preset language configuration file is plural, the preset language configuration files may be a plurality of language configuration files for supporting a plurality of languages (for example, chinese, english, japanese, korean, etc.), respectively, and the plurality of preset language configuration files may include a default language configuration file for supporting a default language (for example, chinese)
In the implementation manner, optionally, after the preset language configuration file is stored in the sandbox, the target language configuration file of the target language may be searched from the sandbox again. If so, continuing to execute step 105; if not, a default language profile for a default language (e.g., chinese) may be looked up from the sandbox to display text in the default language in the target application.
Step 105, in response to finding, displaying the text of the target language in the target application based on the target language configuration file.
In this embodiment, in response to finding the target language profile of the target language from the sandbox, the execution main body may display the text of the target language in the target application based on the target language profile.
Here, the execution subject may search and return the text of the target language from the sandbox in a reading manner customized by a technician in advance, instead of reading the text in a reading manner calling the NSLocalizedString function by default by the iOS operating system. In particular, the interface for reading text can be customized. The interface may be packaged with a method of reading content from a language configuration file. After the interface is called and the keyword and the identifier for representing the target language are input into the interface, the interface can read the content corresponding to the keyword in the language configuration file and return the content.
In some optional implementations of this embodiment, in response to finding the target language profile of the target language from the sandbox, the execution main body may display the text of the target language by:
first, storing the target language configuration file into the memory. Therefore, repeated inquiry is facilitated, and the text reading efficiency is improved.
And secondly, triggering a text display instruction. Wherein, the text display instruction comprises a keyword (key). Here, the text display instruction may be automatically triggered after the target language configuration file is stored in the memory. Text display instructions may be used to indicate the query and display text corresponding to the keywords.
And thirdly, searching the keywords from the target language configuration file in the memory. In practice, the text of the target language corresponding to the keyword can be searched by calling the customized interface.
And fourthly, returning the text of the target language corresponding to the keyword, and displaying the text in the target application.
In the method provided by the embodiment of the application, after the terminal device running the iOS operating system detects that the target application installed on the terminal device is started, the plurality of language configuration files are acquired from the cloud server, then the received language configuration files are stored in the sandbox, then the target language to be used by the target application is determined, and the target language configuration file of the target language is searched from the sandbox, so that the text of the target language can be displayed in the target application based on the target language configuration file searched from the sandbox. Because the sandbox can run the software in a limited system environment, resources available for the program are controlled, and the change of the content in the sandbox (for example, the addition of a new language configuration file) does not affect other codes or functions of the target application, the latest language configuration file can be automatically requested from the cloud server after the target application is started, and the sandbox stores the language configuration file without updating an executable file (a bundle file) of the application, so that a new application version does not need to be released when a new language is added. Thereby, the development cost when adding new language support to iOS applications is reduced.
For the method of determining the target language in step 103, further reference may be made to fig. 2. FIG. 2 presents a flow diagram of one embodiment of a method of determining a target language according to the present application. The process 200 of the method for determining the target language may include the following steps:
step 201, obtaining current position information, default language and default area preset by a user.
In this embodiment, the execution subject may acquire the current location information (for example, longitude and latitude) by positioning, and may acquire a default language and a default region that are set in advance by the user for the terminal device.
Step 202, determining whether the current position information is successfully acquired.
In this embodiment, step 203 may be performed in response to the current location information being successfully obtained. Step 208 may be performed in response to a failure in acquisition of the current location information.
Step 203, in response to the current location information being successfully obtained, determining whether the current location indicated by the current location information is located in a default area.
In this embodiment, in response to determining that the current location information acquisition is successful, the execution subject may determine whether the current location indicated by the current location information is located in a default area.
As an example, if the current location information indicates that the location of the terminal device is a certain street in the hai lake district of beijing, and the default district is beijing, it may be determined that the current location information is successfully obtained.
Here, step 204 may be performed in response to determining that the current location is not located in the default zone. Step 208 may be performed in response to determining that the current location is within the default zone.
And step 204, in response to the fact that the current time and the time interval of the last time of displaying the reminding information are not larger than or equal to the preset reminding time interval, determining whether the current time and the time interval of displaying the reminding information are larger than or equal to the preset reminding time interval.
In this embodiment, in response to determining that the current time is not located in the default region, the execution subject may determine whether the time interval between the current time and the last time that the reminder information is displayed is greater than or equal to a preset reminder time interval (e.g., one day). The reminding information can be used for reminding a user to switch the display language of the target application to the language of the location of the current position. The preset reminding time interval can be preset according to needs, and specific numerical values are not limited herein.
Here, step 205 may be performed in response to determining that the time interval between the current time and the last time the reminder information was displayed is greater than or equal to the preset reminder time interval. In response to determining that the time interval between the current time and the last time the reminder information is displayed is less than the preset reminder time interval, step 208 can be executed.
In response to determining that the time interval is greater than or equal to the preset reminding time interval, displaying the reminding information, step 205.
Step 206, determining whether a language switching instruction triggered by the user for the reminding information is detected.
In this embodiment, the execution main body may detect a language switching instruction triggered by the user for the reminder information. Here, the language switching instruction triggered by the user for the reminder information may be a language switching instruction triggered by the user within a preset time period after the reminder information is displayed. In practice, the language switching instruction may be triggered by a user clicking a "language switching" button or the like.
Here, step 207 may be performed in response to detecting a language switching instruction triggered by the user for the reminder information. In response to not detecting a language switching instruction triggered by the user for the reminder information, step 208 may be performed.
Step 207, in response to detecting the language switching instruction triggered by the user for the reminding information, determining the language used in the location of the current location as the target language to be used by the target application.
Step 208, determining the default language as the target language to be used by the target application under any one of the following conditions: the current position information fails to be acquired; or, the current location is in a default zone; or the time interval between the current time and the last time of displaying the reminding information is less than the preset reminding time interval; or, the language switching instruction triggered by the user for the reminding information is not detected.
In the method provided by the embodiment of the application, the target language to be used by the target application is determined by acquiring the current position information, the default language preset by the user and the default region, and then sequentially detecting whether the current position information is successfully acquired, whether the current position is located in the default region, whether the current time is greater than or equal to the preset reminding time interval with the time interval of the last time of displaying the reminding information, and whether the user triggers the language switching instruction aiming at the reminding information. Therefore, the user can be automatically reminded to modify the language setting according to the user positioning and the language/region setting of the terminal equipment, and the accuracy of the target language and the convenience of target language switching are improved.
With further reference to FIG. 3, a flow 300 of yet another embodiment of a file processing method is shown. The process 300 of the file processing method includes the following steps:
step 301, in response to detecting that the target application is started, sending a language configuration file acquisition request to the cloud server, and receiving a plurality of language configuration files returned by the cloud server.
In this embodiment, an execution subject (for example, the terminal device described above) of the file processing method may send a language profile acquisition request to the cloud server and receive a plurality of language profiles returned by the cloud server in response to detecting that the target application is started.
The language configuration file may be a file for language support of the target application. The plurality of language profiles may support a plurality of languages. Each language profile may support one language. For example, the plurality of language profiles may include, but are not limited to: chinese configuration files, english configuration files, japanese configuration files, korean configuration files, and the like.
Step 302, store the received language configuration files into sandbox.
In this embodiment, in the case of successfully receiving multiple language profiles returned by the cloud server, the execution main body may store the received language profiles in a sandbox.
Step 303, determining a target language to be used by the target application.
In this embodiment, the executing agent may determine the target language to be used by the target application by using the method for determining the target language shown in fig. 2, which is not described herein again.
Step 304, find the target language configuration file of the target language from the sandbox.
In this embodiment, after determining the target language, the execution subject may search for the target language configuration file of the target language from the sandbox. If found, steps 305-308 may be performed. If not, step 309 can be performed.
Step 305, in response to finding, storing the target language configuration file in the memory.
In this embodiment, in response to the search, the execution main body may store the target language configuration file in the memory. Therefore, repeated query is facilitated, and text reading efficiency is improved.
Step 306, triggering a text display instruction.
In this embodiment, the text display instruction includes a keyword (key). Here, the text display instruction may be automatically triggered after the target language configuration file is stored in the memory. Text display instructions may be used to indicate the query and display text corresponding to the keywords.
It should be noted that the above keywords may be localized words corresponding to the text of the target language to be currently displayed. The localized words may be words in a default language set by a technician at the time of development. For example, if the keyword is "confirmation" in chinese and the target language is english, the text in the target language to be displayed may be "done". The localization words and the texts of the target languages have corresponding relations. In practice, the correspondence may be expressed using a key-value pair form. Continuing with the above example, the above English "done" value may be stored in the target language configuration file in the form of key value pairs with the above Chinese "OK" as the key (key).
Step 307, searching for keywords from the target language configuration file located in the memory.
In this embodiment, the execution subject may adopt a reading manner customized by a technician in advance, and search and return the text of the target language from the sandbox, instead of adopting a reading manner that the iOS operating system calls the nslocalized string function by default. In particular, the interface for reading text can be customized. The interface may be packaged with a method of reading content from a language configuration file. After the interface is called and the keyword and the identifier for representing the target language are input into the interface, the interface can read the content corresponding to the keyword in the language configuration file and return the content.
Step 308, returning the text of the target language corresponding to the keywords and displaying the text in the target application.
Step 309, in response to the target application is not found, reading the preset language configuration file in the executable file of the target application, and storing the preset language configuration file in the sandbox.
In this embodiment, in response to that the target language configuration file of the target language is not found in the sandbox, the execution main body may read a preset language configuration file in an executable file (e.g., a bundle file) of the target application, and store the preset language configuration file in the sandbox. And then, searching the target language configuration file of the target language from the sandbox again.
It should be noted that the preset language configuration file may be one or more. When one preset language profile is present, the preset language profile may be a default language profile that provides support for a default language (e.g., chinese). When the preset language configuration file is plural, it may be a plurality of language configuration files providing support for a plurality of languages (for example, chinese, english, japanese, korean, etc.), respectively, and the plural preset language configuration files may include a default language configuration file supporting a default language (for example, chinese).
In step 310, the target language configuration file of the target language is searched again from the sandbox.
In this embodiment, after the target language configuration file of the target language is searched again from the sandbox, if the target language configuration file is found, steps 305-308 may be performed. If the target language configuration file is not found, step 311 may be performed.
And 311, in response to the condition that the language is not found again, finding the default language configuration file from the sandbox, and displaying the text of the default language in the target application based on the default language configuration file.
In this embodiment, the step of displaying the text of the default language based on the default language profile is substantially the same as the step of displaying the text of the target language based on the language profile which is not bought, and thus the detailed description is omitted here.
As can be seen from fig. 3, compared with the embodiment corresponding to fig. 1, the process 300 of the file processing method in this embodiment relates to a step of reading a text corresponding to a keyword by using a customized interface, so that reading a target language configuration file from a sandbox and finding out a text corresponding to the keyword from the target language configuration file can be implemented. Meanwhile, the method relates to a step of storing the target language configuration file into the memory after the target language configuration file is found. Therefore, repeated query of the target language configuration file is facilitated, and text reading efficiency is improved.
With further reference to fig. 4, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of a file processing apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 1, and the apparatus may be specifically applied in a terminal device. The terminal device runs with an iOS operating system and is installed with a target application.
As shown in fig. 4, the document processing apparatus 400 according to this embodiment includes: a sending unit 401 configured to send a language configuration file acquisition request to a cloud server in response to detecting that the target application is started, and receive a plurality of language configuration files returned by the cloud server; a first storing unit 402 configured to store the received language profiles into a sandbox; a determining unit 403 configured to determine a target language to be used by the target application; a searching unit 404 configured to search a target language configuration file of the target language from the sandbox; a display unit 405 configured to display the text of the target language in the target application based on the target language profile in response to the finding.
In some optional implementations of this embodiment, the apparatus further includes: and the second storing unit is configured to respond to the condition that the language configuration file is not found, read the preset language configuration file in the executable file of the target application and store the preset language configuration file into the sandbox.
In some optional implementations of this embodiment, the determining unit is further configured to: acquiring current position information, a default language preset by a user and a default area; determining whether the current position indicated by the current position information is located in the default area or not in response to the success of the current position information acquisition; in response to the fact that the target application is determined not to be located in the default area, determining whether the time interval between the current time and the last time for displaying the reminding information is larger than or equal to a preset reminding time interval, wherein the reminding information is used for reminding a user to switch the display language of the target application to the language of the location of the current position; in response to determining that the time interval is greater than or equal to the preset reminding time interval, displaying the reminding information; and in response to detecting a language switching instruction triggered by the user aiming at the reminding information, determining the language used at the location of the current position as the target language to be used by the target application.
In some optional implementations of this embodiment, the determining unit is further configured to: determining the default language as a target language to be used by the target application in any of the following cases: the current position information fails to be acquired; or said current location is in said default zone; or the time interval between the current time and the last time of displaying the reminding information is less than the preset reminding time interval; or the language switching instruction triggered by the user aiming at the reminding information is not detected.
In some optional implementations of this embodiment, the display unit is further configured to: in response to finding, performing the steps of: storing the target language configuration file into the memory; triggering a text display instruction, wherein the text display instruction comprises a keyword; searching the keyword from the target language configuration file in the memory; and returning the text of the target language corresponding to the keyword, and displaying the text in the target application.
According to the device provided by the embodiment of the application, after the terminal device running the iOS operating system detects that the target application installed on the terminal device is started, the plurality of language configuration files are obtained from the cloud server, then the received language configuration files are stored in the sandbox, then the target language to be used by the target application is determined, and the target language configuration file of the target language is searched from the sandbox, so that the text of the target language can be displayed in the target application based on the target language configuration file searched from the sandbox. Therefore, after the target application is started, the latest language configuration file can be automatically requested from the cloud server, the language configuration file is stored by the sandbox, the executable file (bundle file) of the application does not need to be updated, and a new application version does not need to be released when a new language is added. Thereby, development costs when adding new language support to the iOS application are reduced.
Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use in implementing a terminal device of an embodiment of the present application. The terminal device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU) 501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Liquid Crystal Display (LCD) and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the method of the present application when executed by the Central Processing Unit (CPU) 501. It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The units described may also be provided in a processor, where the names of the units do not in some cases constitute a limitation of the units themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: in response to the detection that the target application is started, sending a language configuration file acquisition request to a cloud server, and receiving a plurality of language configuration files returned by the cloud server; storing the received language configuration files into a sandbox; determining a target language to be used by the target application; searching a target language configuration file of the target language from the sandbox; in response to finding, displaying text in the target language in the target application based on the target language profile.
The foregoing description is only exemplary of the preferred embodiments of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (12)

1. A file processing method is applied to a terminal device which runs an iOS operating system and is provided with a target application, and the method comprises the following steps:
in response to the detection that the target application is started, sending a language configuration file acquisition request to a cloud server, and receiving a plurality of language configuration files returned by the cloud server;
storing the received language configuration files into a sandbox;
after the language configuration file acquisition request is sent to the cloud server, determining a target language to be used by the target application;
searching a target language configuration file of the target language from the sandbox;
in response to finding, displaying text in the target language in the target application based on the target language profile;
wherein the determining a target language to be used by the target application comprises:
determining at least one of a default language preset by a user, a language of a region where current position information is located and a language used for starting the target application last time as a target language to be used by the target application;
the storing the received language configuration files into a sandbox comprises the following steps:
when the target application is started for the first time and the plurality of language configuration files returned by the cloud server are received, storing the plurality of language configuration files into a sandbox;
and when the target application is started next time and the plurality of language configuration files returned by the cloud server are received, updating the language configuration files in the sandbox by adopting the plurality of language configuration files.
2. The method of claim 1, wherein after said finding a target language profile for said target language from said sandbox, said method further comprises:
and in response to the condition that the target application is not found, reading a preset language configuration file in an executable file of the target application, and storing the preset language configuration file into the sandbox.
3. The method according to claim 1, wherein the determining at least one of a default language preset by a user, a language of a region where current location information is located, and a language used for starting the target application last time as the target language to be used by the target application comprises:
acquiring current position information, a default language preset by a user and a default area;
in response to the current position information being successfully acquired, determining whether the current position indicated by the current position information is located in the default region;
in response to the fact that the target application is determined not to be located in the default area, determining whether the time interval between the current time and the last time for displaying the reminding information is larger than or equal to a preset reminding time interval, wherein the reminding information is used for reminding a user to switch the display language of the target application to the language of the location of the current position;
in response to determining that the time interval is greater than or equal to the preset reminding time interval, displaying the reminding information;
and in response to detecting a language switching instruction triggered by the user aiming at the reminding information, determining the language used in the current position as the target language to be used by the target application.
4. The method according to claim 3, wherein the determining at least one of a default language preset by a user, a language of a region where the current location information is located, and a language used when the target application is started last time as the target language to be used by the target application further comprises:
determining the default language as a target language to be used by the target application in any of:
the current position information fails to be acquired; or
The current location is located in the default zone; or
The time interval between the current time and the last time of displaying the reminding information is less than the preset reminding time interval; or
And a language switching instruction triggered by the user aiming at the reminding information is not detected.
5. The method of claim 1, wherein displaying the text in the target language in the target application based on the target language profile in response to finding comprises:
in response to finding, performing the steps of:
storing the target language configuration file into a memory;
triggering a text display instruction, wherein the text display instruction comprises a keyword;
searching the keyword from the target language configuration file in the memory;
and returning the text of the target language corresponding to the keywords, and displaying the text in the target application.
6. A file processing apparatus applied to a terminal device running an iOS operating system and installed with a target application, the apparatus comprising:
a sending unit configured to send a language configuration file acquisition request to a cloud server in response to detecting that the target application is started, and receive a plurality of language configuration files returned by the cloud server;
a first storing unit configured to store the received language profiles into a sandbox;
a determining unit configured to determine a target language to be used by the target application after sending the language profile acquisition request to the cloud server;
a searching unit configured to search the sandbox for a target language configuration file of the target language;
a display unit configured to display text in the target language in the target application based on the target language profile in response to finding;
wherein the determination unit is further configured to: determining at least one of a default language preset by a user, a language of a region where current position information is located and a language used for starting the target application last time as a target language to be used by the target application;
the first logging unit is further configured to: when the target application is started for the first time and the plurality of language configuration files returned by the cloud server are received, storing the plurality of language configuration files into a sandbox; and when the target application is started next time and the plurality of language configuration files returned by the cloud server are received, updating the language configuration files in the sandbox by adopting the plurality of language configuration files.
7. The apparatus of claim 6, further comprising:
a second storing unit configured to read a preset language configuration file in an executable file of the target application in response to not being found, and store the preset language configuration file in the sandbox.
8. The apparatus of claim 6, wherein the determining unit is further configured to:
acquiring current position information, a default language and a default region preset by a user;
in response to the current location information being successfully obtained, determining whether the current location indicated by the current location information is located in the default region;
in response to the fact that the target application is determined not to be located in the default area, determining whether the time interval between the current time and the last time for displaying the reminding information is larger than or equal to a preset reminding time interval, wherein the reminding information is used for reminding a user to switch the display language of the target application to the language of the location of the current position;
in response to determining that the time interval is greater than or equal to the preset reminding time interval, displaying the reminding information;
and in response to detecting a language switching instruction triggered by the user aiming at the reminding information, determining the language used in the location of the current position as the target language to be used by the target application.
9. The apparatus of claim 8, wherein the determining unit is further configured to:
determining the default language as a target language to be used by the target application in any of:
the current position information fails to be acquired; or
The current location is located in the default zone; or
The time interval between the current time and the last time of displaying the reminding information is less than the preset reminding time interval; or
And a language switching instruction triggered by the user aiming at the reminding information is not detected.
10. The apparatus of claim 6, wherein the display unit is further configured to:
in response to finding, performing the steps of:
storing the target language configuration file into a memory;
triggering a text display instruction, wherein the text display instruction comprises a keyword;
searching the keyword from the target language configuration file in the memory;
and returning the text of the target language corresponding to the keywords, and displaying the text in the target application.
11. A terminal device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method recited in any of claims 1-5.
12. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201910620517.3A 2019-07-10 2019-07-10 File processing method and device, terminal equipment and computer readable medium Active CN110457085B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910620517.3A CN110457085B (en) 2019-07-10 2019-07-10 File processing method and device, terminal equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910620517.3A CN110457085B (en) 2019-07-10 2019-07-10 File processing method and device, terminal equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN110457085A CN110457085A (en) 2019-11-15
CN110457085B true CN110457085B (en) 2022-10-21

Family

ID=68482648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910620517.3A Active CN110457085B (en) 2019-07-10 2019-07-10 File processing method and device, terminal equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN110457085B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112835633B (en) * 2020-12-17 2022-11-11 海信视像科技股份有限公司 Display device and control method of display language
CN112817655B (en) * 2021-01-29 2024-05-14 北京达佳互联信息技术有限公司 Document information processing method and device, storage medium and electronic equipment
CN112949252B (en) * 2021-03-23 2023-08-04 上海掌门科技有限公司 Text display method, apparatus and computer readable medium
CN116233298A (en) * 2022-12-05 2023-06-06 湖北星纪时代科技有限公司 Language data packet updating method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101122858A (en) * 2007-09-20 2008-02-13 中兴通讯股份有限公司 Human-machine interface localization method and system
CN101714086A (en) * 2009-12-22 2010-05-26 中兴通讯股份有限公司 Method and device for choosing software interface languages
CN101876907A (en) * 2010-05-18 2010-11-03 杭州海康威视数字技术股份有限公司 Multi-language implementation method and device of human-computer interaction interface
CN103544306A (en) * 2013-11-01 2014-01-29 广东威创视讯科技股份有限公司 Multi-language display supporting method and device of website
CN103595868A (en) * 2013-11-13 2014-02-19 广东欧珀移动通信有限公司 Language extension method and system based on geographic position and applied to handheld device
CN104020991A (en) * 2014-05-16 2014-09-03 可牛网络技术(北京)有限公司 Method and device for multi-language switching of application program
CN108304207A (en) * 2018-03-01 2018-07-20 上海找钢网信息科技股份有限公司 Mix the resource regeneration method and system of APP application programs

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8954958B2 (en) * 2010-01-11 2015-02-10 Code Systems Corporation Method of configuring a virtual application

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101122858A (en) * 2007-09-20 2008-02-13 中兴通讯股份有限公司 Human-machine interface localization method and system
CN101714086A (en) * 2009-12-22 2010-05-26 中兴通讯股份有限公司 Method and device for choosing software interface languages
CN101876907A (en) * 2010-05-18 2010-11-03 杭州海康威视数字技术股份有限公司 Multi-language implementation method and device of human-computer interaction interface
CN103544306A (en) * 2013-11-01 2014-01-29 广东威创视讯科技股份有限公司 Multi-language display supporting method and device of website
CN103595868A (en) * 2013-11-13 2014-02-19 广东欧珀移动通信有限公司 Language extension method and system based on geographic position and applied to handheld device
CN104020991A (en) * 2014-05-16 2014-09-03 可牛网络技术(北京)有限公司 Method and device for multi-language switching of application program
CN108304207A (en) * 2018-03-01 2018-07-20 上海找钢网信息科技股份有限公司 Mix the resource regeneration method and system of APP application programs

Also Published As

Publication number Publication date
CN110457085A (en) 2019-11-15

Similar Documents

Publication Publication Date Title
CN110457085B (en) File processing method and device, terminal equipment and computer readable medium
US20180196665A1 (en) Managing, using, and updating application resources
CN110851209B (en) Data processing method and device, electronic equipment and storage medium
CN107291481B (en) Component updating method, device and system
CN112486552A (en) Server hot update method, device, equipment and storage medium
CN110990346A (en) File data processing method, device, equipment and storage medium based on block chain
JP2022006160A (en) Data processing methods and equipment, electronic devices, storage media and computer programs
US9442719B2 (en) Regression alerts
CN110716956A (en) Data request intercepting method and device
CN111506904B (en) Method and device for online bug repair
CN106156050B (en) Data processing method and device
US20180314683A1 (en) Method and device for processing natural language
CN109032641B (en) Application version updating method and device
CN111124627B (en) Method and device for determining call initiator of application program, terminal and storage medium
US12001458B2 (en) Multi-cloud object store access
CN116804929A (en) Version application analysis method and device, electronic equipment and storage medium
CN115543967A (en) Data migration method and device, electronic equipment and computer readable medium
CN112910855B (en) Sample message processing method and device
CN115080114A (en) Application program transplanting processing method, device and medium
CN110647623B (en) Method and device for updating information
US9477448B2 (en) Screen-oriented computing program refactoring
CN107256170B (en) Method and device for activating input method setting items of terminal equipment
CN113760860B (en) Data reading method and device
CN113127416A (en) Data query method and device
US9230038B2 (en) Content fetching and caching on a mobile device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant