CN111158813B - Language configuration method and device, computer readable storage medium and server - Google Patents
Language configuration method and device, computer readable storage medium and server Download PDFInfo
- Publication number
- CN111158813B CN111158813B CN201911307271.0A CN201911307271A CN111158813B CN 111158813 B CN111158813 B CN 111158813B CN 201911307271 A CN201911307271 A CN 201911307271A CN 111158813 B CN111158813 B CN 111158813B
- Authority
- CN
- China
- Prior art keywords
- language
- text
- resource file
- entry
- filling
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
- G06F9/454—Multi-language systems; Localisation; Internationalisation
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Machine Translation (AREA)
Abstract
The present application belongs to the field of computer technologies, and in particular, to a language configuration method and apparatus, a computer-readable storage medium, and a server. The method comprises the steps of receiving a language configuration instruction, and extracting a language set and a text set to be configured from the language configuration instruction; generating first resource files respectively corresponding to various languages in the language set according to a preset resource file template; generating filling entry sets respectively corresponding to various languages in the language sets according to the text sets; and filling each filling entry set into each corresponding first resource file respectively to obtain each second resource file corresponding to each language in the language set, so that the configuration efficiency is greatly improved.
Description
Technical Field
The present application belongs to the field of computer technologies, and in particular, to a language configuration method and apparatus, a computer-readable storage medium, and a server.
Background
When an Application (App) expands the overseas market, it is necessary to support multiple languages, which is convenient for users in multiple countries to use. In Android development, app supports multiple languages, mainly for internationalization of resource files, under a default condition, a default value folder is arranged under an Android src/main/res/directory, and in order to support multiple languages, the resource files of the multiple languages need to be configured under the folder. At present, developers need to manually configure resource files one by configuring the resource files in multiple languages, and the efficiency is extremely low.
Disclosure of Invention
In view of this, embodiments of the present application provide a language configuration method, a language configuration device, a computer-readable storage medium, and a server, so as to solve the problem that the existing language configuration method is extremely inefficient.
A first aspect of an embodiment of the present application provides a language configuration method, which may include:
receiving a language configuration instruction, and extracting a language set and a text set to be configured from the language configuration instruction;
generating first resource files respectively corresponding to various languages in the language set according to a preset resource file template;
generating filling entry sets respectively corresponding to various languages in the language sets according to the text sets;
and filling each filling entry set into each corresponding first resource file respectively to obtain each second resource file corresponding to each language in the language set respectively.
A second aspect of an embodiment of the present application provides a language configuration apparatus, which may include:
the instruction information extraction module is used for receiving a language configuration instruction and extracting a language set and a text set to be configured from the language configuration instruction;
the first resource file generation module is used for generating each first resource file corresponding to each language in the language set according to a preset resource file template;
a filling entry set generating module, configured to generate, according to the text set, each filling entry set corresponding to each language in the language set;
and the second resource file filling module is used for respectively filling each filling entry set into each corresponding first resource file to obtain each second resource file respectively corresponding to each language in the language set.
A third aspect of embodiments of the present application provides a computer-readable storage medium storing computer-readable instructions, which when executed by a processor implement the steps of any one of the above-mentioned language configuration methods.
Receiving a language configuration instruction, and extracting a language set and a text set to be configured from the language configuration instruction;
generating first resource files respectively corresponding to various languages in the language set according to a preset resource file template;
generating filling entry sets respectively corresponding to various languages in the language sets according to the text sets;
and filling each filling entry set into each corresponding first resource file respectively to obtain each second resource file corresponding to each language in the language set respectively.
A fourth aspect of embodiments of the present application provides a server, including a memory, a processor, and computer readable instructions stored in the memory and executable on the processor, where the processor implements the steps of any one of the above language configuration methods when executing the computer readable instructions.
Receiving a language configuration instruction, and extracting a language set and a text set to be configured from the language configuration instruction;
generating first resource files respectively corresponding to various languages in the language set according to a preset resource file template;
generating filling entry sets respectively corresponding to various languages in the language sets according to the text sets;
and filling each filling entry set into each corresponding first resource file respectively to obtain each second resource file corresponding to each language in the language set respectively.
Compared with the prior art, the embodiment of the application has the advantages that: the method includes the steps of firstly receiving a language configuration instruction, extracting a language set to be configured and a text set from the language configuration instruction, then generating first resource files corresponding to various languages in the language set according to a preset resource file template, generating filling entry sets corresponding to the various languages in the language set according to the text set, and finally filling the filling entry sets into the corresponding first resource files respectively to obtain second resource files corresponding to the various languages in the language set respectively, namely the configured resource files are completed. According to the embodiment of the application, when a developer needs to perform language configuration, only a language configuration instruction needs to be issued to the server according to actual requirements to indicate a language set and a text set to be configured, the server automatically generates an initial resource file (namely the first resource file) according to a preset resource file template, generates filling entry sets corresponding to various languages in the language set respectively according to the text set, fills the resource file, completes the configuration of the resource file, and greatly improves the configuration efficiency.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flow chart of an embodiment of a language configuration method in an embodiment of the present application;
FIG. 2 is a schematic flow chart of generating first resource files corresponding to respective languages in a language set according to a preset resource file template;
FIG. 3 is a schematic diagram of generating resource files corresponding to various languages in a language set under a storage path;
FIG. 4 is a schematic flow diagram of generating respective sets of fill entries from a text set that respectively correspond to respective languages in a language set;
FIG. 5 is a schematic flow chart of sending an application installation package including resource files to a terminal device;
FIG. 6 is a block diagram of an embodiment of a language configuration apparatus according to an embodiment of the present application;
fig. 7 is a schematic block diagram of a server in an embodiment of the present application.
Detailed Description
In order to make the objects, features and advantages of the present invention more apparent and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the embodiments described below are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, an embodiment of a voice configuration method in an embodiment of the present application may include:
step S101, receiving a language configuration instruction, and extracting a language set and a text set to be configured from the language configuration instruction.
A developer can issue a language configuration instruction to a server through a specified human-computer interaction interface, wherein the language configuration instruction comprises a language set to be configured and a text set.
In a specific implementation of the present application, the server may present all selectable languages to the developer through the human-computer interaction interface, preferably, in order to facilitate the developer to select, all languages are sorted according to the use frequency of historical statistics, specifically, languages configured in the past APP development process may be queried from the history record, the use frequencies of the languages are respectively counted, and then the languages are presented to the developer in the order from high use frequency to low use frequency for selection. The developer selects the language of the required configuration according to the actual situation of the current APP (namely, the APP needs to be used in which language environments specifically), and the languages selected by the developer constitute the language set.
The text set is set by a developer in advance according to the actual situation of the current APP, wherein all texts used in the APP and needing multi-language conversion are included and displayed in the form of character strings of a default language, and the default language can be set into simplified Chinese, traditional Chinese, english and the like according to the actual situation. For example, if the current default language is english, and three text entries "Begin", "Wait", and "End" are commonly referred to in APP, the three text entries may constitute the text set.
And after the server receives the language configuration instruction, the language set and the text set can be extracted from the language configuration instruction.
Step S102, generating each first resource file corresponding to each language in the language set according to a preset resource file template.
As shown in fig. 2, step S102 may specifically include the following processes:
and step S1021, determining a storage path corresponding to the nth language in the language set.
Wherein N is more than or equal to 1 and less than or equal to N, and N is the total number of various languages in the language set. The storage path corresponding to the nth language in the language set is as follows: src/main/res/values/RelRoute _ n. Wherein RelRoute _ n is different for different languages. If the language set comprises 4 languages including English, japanese, simplified Chinese and traditional Chinese (i.e. N = 4), the corresponding RelRoute _ N is 4 folders including value-en-rUS, value-ja-rJP, value-zh-rCN and value-zh-rTW.
Step S1022, generating a blank resource file corresponding to the nth language in the language set under the storage path.
That is, a blank xml file is generated under the storage path of src/main/res/values/RelRoute _ n, and the file is generally named strings uniformly, as shown in FIG. 3.
And S1023, filling the blank resource file according to the resource file template to generate a first resource file corresponding to the nth language in the language set.
The first resource file comprises M text lines, each text line corresponds to one text entry in the text set, each text line comprises a reserved filling position, and M is the total number of the text entries in the text set.
If there are 3 (i.e. M = 3) text entries in the text set, which are "Begin", "Wait", and "End", respectively, after the blank resource file is filled, the following first resource file may be obtained:
and step S103, generating filling entry sets respectively corresponding to various languages in the language sets according to the text sets.
As shown in fig. 4, step S103 may specifically include the following processes:
and step S1031, generating a blank filling entry set corresponding to the nth language in the language set.
Step S1032, the mth text entry in the text set is extracted, and the mth text entry in the text set is translated into a filling entry corresponding to the nth language in the language set.
In this embodiment, the multilingual language mapping table of the text configured in the past APP development process may be stored in the server in advance. Firstly, searching the mth text entry in the text set in the language comparison table, wherein M is more than or equal to 1 and less than or equal to M. If the language is found, translating the mth text entry in the text set according to the language comparison table to obtain a filling entry corresponding to the nth language in the language set; if the language set is not searched, a preset translation thread is started to process the mth text entry in the text set, and a filling entry corresponding to the nth language in the language set is obtained. The translation thread may be a thread that triggers the specified language translation software.
Step S1033, add the padding entry to the padding entry set.
And traversing each text entry in the text set, and respectively executing the process shown in fig. 4 to obtain a final filled entry set.
If the language set contains 4 languages including english, japanese, simplified chinese and traditional chinese, and the text set contains 3 text entries including "Begin", "Wait" and "End", the filling entry set corresponding to english is: { "Begin", "Wait", "End" }, the set of filled entries corresponding to japanese is: { "open-open", "waiting for \12388", "32066: { "start", "wait", "end" }, the set of filled entries corresponding to traditional Chinese is: { "open start", "wait", "JI bundle" }.
And step S104, filling each filling entry set into each corresponding first resource file respectively to obtain each second resource file corresponding to each language in the language set respectively.
And the second resource file is the resource file after the configuration is completed. If the language set contains 4 languages including english, japanese, simplified chinese, and traditional chinese, and the text set contains 3 text entries including "Begin", "Wait", and "End", the second resource file corresponding to english is:
the second resource file corresponding to japanese is:
the second resource file corresponding to simplified Chinese is:
the second resource file corresponding to traditional Chinese is:
it should be noted that the process shown in fig. 1 is a process for initially configuring a resource file, and in a subsequent development process, if a requirement changes, a developer may also update the resource file.
For example, when a new language and/or text entry is required, a developer may issue a new configuration instruction to the server through the human-computer interaction interface. The new configuration instruction comprises a new language set and/or a new text set. After receiving the new configuration instruction, the server firstly queries whether each language in the new language set has a corresponding configured resource file, and if so, the server indicates that the language has been configured before, and the configuration is not performed at this time so as to avoid repetition. If not, the language is the added language, the resource file is generated again according to the process, and the resource file is filled according to the existing text entry. And then inquiring whether each text entry in the newly added text set has a corresponding text line in the resource file, if so, indicating that the text entry has been configured before, and not configuring the text entry at this time so as to avoid repetition. If not, the new text entry is indicated, and the corresponding text entries are filled in all the resource files again according to the process.
For another example, when a language and/or a text needs to be deleted, a developer may issue a delete configuration instruction to a server through the human-computer interaction interface. The deleted configuration instruction includes a deleted language set and/or a deleted text set. After receiving the configuration deleting instruction, the server firstly queries whether each language in the deleted language set has a corresponding configured resource file, if so, deletes the language set, and if not, does not perform operation. And then inquiring whether each text entry in the deleted text set has a corresponding text line in the resource file, if so, deleting the text entry, and if not, not operating.
Further, after obtaining each second resource file corresponding to each language in the language set, the files may be packaged into an application Package (Android Package, APK) for downloading by a user. However, considering that most users usually use the same language all the time, not all resource files are needed, and these files will occupy the storage space of the user terminal. This can be optimized in this embodiment by the process as shown in fig. 5:
step S501, generating each application installation package corresponding to each language in the language set.
And the nth application program installation package comprises a second resource file corresponding to the nth language in the language set. That is, when packaging APKs, APKs in various language versions are generated, each version retaining only strings.xml files in one language, while deleting other languages.
Step S502, after receiving an application program installation package downloading request sent by the terminal equipment, acquiring the language used by the terminal equipment.
Firstly, whether the terminal equipment is provided with the SIM card or not is judged. Generally, a terminal device must be equipped with a SIM card for normal communication, and the SIM card stores Subscriber information of a digital mobile phone through a computer chip. When the terminal equipment is started for the first time, the terminal system is activated, and the system automatically detects whether the terminal equipment is provided with the SIM card, for example, in an Android system, whether the terminal equipment is provided with the SIM card can be judged through an SIM _ STATE _ ABSENT attribute item of a TelephonManager type.
If the terminal equipment is not provided with the SIM card, the position information of the terminal equipment is obtained, the language area where the terminal equipment is located is determined according to the position information, and finally the language corresponding to the language area is determined as the language used by the terminal equipment. For example, the location information of the terminal device may be acquired by a GPS, and if the acquired location information is located in china, chinese is determined as the language used by the terminal device.
If the terminal equipment is provided with the SIM card, firstly, an address list and short message information are obtained from the SIM card. For example, in the android system, the address book information in the SIM card, such as the name, phone number, remark information, etc. of a contact person, can be obtained through the getContentResolver () function and the "content:// icc/adn" parameter or the "content:// SIM/adn" parameter, and the sms information corresponding to the contact person in the SIM card can be read through the getContentResolver () function and the "content:// sms/" parameter, the "content:// sms/inbox" parameter, the "content:// sms/send" parameter.
And if the address list and the short message information are not empty, determining the language used in the address list and the short message information as the language used by the terminal equipment. For example, the name "zhang san" is searched in the record information of the contact, the system obtains the language corresponding to the code as the Chinese language by identifying the code information of the text content "zhang san", and then judges that the language type of the contact is the Chinese language. If the text content read in the short message of the contact is "Don't get to lock the door where you leave", and the system recognizes that the language corresponding to the coded information is english, it determines that the language type of the contact is english. When the language type is acquired according to the telephone number, after the terminal device inquires the telephone number, the terminal device inquires the number attribution information of the number acquired by inquiring an inquiry interface of a third party attribution inquiry server erected by a server or an operator, namely the language type can be set according to the attribution information. For example, the terminal device reads a telephone number of +1 to 7654321111, inquires from the server that the international code of the number is 1, and the attribution is the united states, that is, the language used by the terminal device is english.
And if the address list and the short message information are empty, acquiring the attribution of the SIM card, and determining the language corresponding to the attribution as the language used by the terminal equipment. Specifically, the IMSI (International Mobile Subscriber identity Number) indicated by the preset field in the SIM card may be read. The IMSI includes an MCC (Mobile Country Code) consisting of 3 digits and used to uniquely identify the Country to which the SIM card belongs, such as: when the MCC is 460, it represents that the country to which the SIM card belongs is china, and the language used by the terminal device is chinese.
And step S503, sending the preferred installation package to the terminal equipment.
The preferred installation package is an application installation package corresponding to the language used by the terminal device.
By the method, the occupation of the application program installation package on the storage space of the user terminal equipment is greatly reduced, and the time and network resources consumed by downloading the application program installation package are also reduced.
To sum up, in the embodiment of the present application, a language configuration instruction is first received, a language set to be configured and a text set are extracted from the language configuration instruction, then, first resource files corresponding to various languages in the language set are generated according to a preset resource file template, filling entry sets corresponding to the various languages in the language set are generated according to the text set, and finally, the filling entry sets are respectively filled into the corresponding first resource files to obtain second resource files corresponding to the various languages in the language set, that is, the configured resource files are completed. According to the embodiment of the application, when a developer needs to perform language configuration, only a language configuration instruction needs to be issued to the server according to actual requirements to indicate a language set and a text set to be configured, the server automatically generates an initial resource file (namely the first resource file) according to a preset resource file template, generates filling entry sets respectively corresponding to various languages in the language set according to the text set, fills the resource file, completes configuration of the resource file, and greatly improves configuration efficiency.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 6 is a block diagram of an embodiment of a language configuration apparatus according to an embodiment of the present application, which corresponds to a language configuration method described in the foregoing embodiment.
In this embodiment, a language configuration apparatus may include:
the instruction information extraction module 601 is configured to receive a language configuration instruction, and extract a language set and a text set to be configured from the language configuration instruction;
a first resource file generating module 602, configured to generate, according to a preset resource file template, each first resource file corresponding to each language in the language set;
a filling entry set generating module 603, configured to generate, according to the text set, filling entry sets corresponding to the languages in the language set respectively;
a second resource file filling module 604, configured to fill each filling entry set into each corresponding first resource file, so as to obtain each second resource file corresponding to each language in the language set.
Further, the first resource file generation module may include:
the storage path determining unit is used for determining a storage path corresponding to the nth language in the language set, wherein N is more than or equal to 1 and less than or equal to N, and N is the total number of various languages in the language set;
a blank resource file generating unit, configured to generate a blank resource file corresponding to the nth language in the language set under the storage path;
a first resource file generating unit, configured to fill the blank resource file according to the resource file template, and generate a first resource file corresponding to an nth language in the language set, where the first resource file includes M text lines, each text line corresponds to a text entry in the text set, and each text line includes a reserved filling position, and M is a total number of the text entries in the text set.
Further, the fill entry set generation module may include:
a blank set generating unit, configured to generate a blank set of filling entries corresponding to an nth language in the language set;
the text entry translation unit is used for extracting the mth text entry in the text set and translating the mth text entry in the text set into a filling entry corresponding to the nth language in the language set, wherein M is more than or equal to 1 and less than or equal to M;
an entry filling unit, configured to add the filling entry to the filling entry set.
Further, the text entry translation unit may include:
the text entry searching subunit is used for searching the mth text entry in the text set in a preset language comparison table;
the first processing subunit is configured to, if the language matching table is found, translate the mth text entry in the text set according to the language matching table to obtain a filling entry corresponding to the nth language in the language set;
and the second processing subunit is used for starting a preset translation thread to process the mth text entry in the text set if the search cannot be performed, so as to obtain a filling entry corresponding to the nth language in the language set.
Further, the language configuration device may further include:
the installation package generation module is used for generating each application installation package corresponding to each language in the language set, wherein the nth application installation package comprises second resource files corresponding to the nth language in the language set;
the language acquisition module is used for acquiring the language used by the terminal equipment after receiving an application program installation package downloading request sent by the terminal equipment;
and the installation package sending module is used for sending the preferred installation package to the terminal equipment, wherein the preferred installation package is an application installation package corresponding to the language used by the terminal equipment.
Optionally, the language acquisition module may include:
the SIM card information acquisition unit is used for acquiring an address list and short message information from the SIM card if the terminal equipment is provided with the SIM card;
the first language determining unit is used for determining the language used in the address list and the short message information as the language used by the terminal equipment if the address list and the short message information are not empty;
and the second language determining unit is used for acquiring the attribution of the SIM card if the address list and the short message information are empty, and determining the language corresponding to the attribution as the language used by the terminal equipment.
Optionally, the language acquisition module may include:
a location information obtaining unit, configured to obtain location information of the terminal device if an SIM card is not installed in the terminal device;
a language region determining unit, configured to determine a language region where the terminal device is located according to the location information;
and a third language determination unit, configured to determine a language corresponding to the language area as the language used by the terminal device.
It can be clearly understood by those skilled in the art that, for convenience and simplicity of description, the specific working processes of the above-described devices, modules and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Fig. 7 shows a schematic block diagram of a server provided in the embodiment of the present application, and for convenience of description, only the portions related to the embodiment of the present application are shown.
In this embodiment, the server 7 may include: a processor 70, a memory 71, and computer readable instructions 72 stored in the memory 71 and executable on the processor 70, such as computer readable instructions to perform the voice configuration method described above. The processor 70, when executing the computer readable instructions 72, implements the steps in the various speech configuration method embodiments described above, such as steps S101-S104 shown in fig. 1. Alternatively, the processor 70, when executing the computer readable instructions 72, implements the functions of the modules/units in the above-described device embodiments, such as the functions of the modules 601 to 604 shown in fig. 6.
Illustratively, the computer-readable instructions 72 may be partitioned into one or more modules/units, which are stored in the memory 71 and executed by the processor 70 to accomplish the present application. The one or more modules/units may be a series of computer-readable instruction segments capable of performing specific functions, which are used to describe the execution of the computer-readable instructions 72 in the server 7.
The Processor 70 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 71 may be an internal storage unit of the server 7, such as a hard disk or a memory of the server 7. The memory 71 may also be an external storage device of the server 7, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the server 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the server 7. The memory 71 is used to store the computer readable instructions and other instructions and data required by the server 7. The memory 71 may also be used to temporarily store data that has been output or is to be output.
Each functional unit in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes a plurality of computer readable instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and the like, which can store computer readable instructions.
The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present application.
Claims (9)
1. A method for configuring a language, comprising:
receiving a language configuration instruction, and extracting a language set and a text set to be configured from the language configuration instruction;
determining a storage path corresponding to the nth language in the language set, wherein N is more than or equal to 1 and less than or equal to N, and N is the total number of various languages in the language set; generating a blank resource file corresponding to the nth language in the language set under the storage path; filling the blank resource file according to a preset resource file template to generate a first resource file corresponding to the nth language in the language set, wherein the first resource file comprises M text lines, each text line corresponds to one text entry in the text set, each text line comprises a reserved filling position, and M is the total number of the text entries in the text set;
generating filling entry sets respectively corresponding to various languages in the language sets according to the text sets;
and filling each filling entry set into each corresponding first resource file respectively to obtain each second resource file corresponding to each language in the language set respectively.
2. The method according to claim 1, wherein the generating respective sets of fill entries corresponding to respective ones of the languages from the text set comprises:
generating a set of blank fill entries corresponding to an nth language of the set of languages;
extracting the mth text entry in the text set, and translating the mth text entry in the text set into a filling entry corresponding to the nth language in the language set, wherein M is more than or equal to 1 and less than or equal to M;
adding the fill entry to the set of fill entries.
3. The language configuration method of claim 2, wherein said translating an mth text entry in the set of texts into a filler entry corresponding to an nth language in the set of languages comprises:
searching the mth text entry in the text set in a preset language comparison table;
if the language is found, translating the mth text entry in the text set according to the language comparison table to obtain a filling entry corresponding to the nth language in the language set;
and if the search is not successful, starting a preset translation thread to process the mth text entry in the text set to obtain a filling entry corresponding to the nth language in the language set.
4. The language configuration method according to any one of claims 1 to 3, further comprising, after obtaining respective second resource files corresponding to respective languages in the language set:
generating application program installation packages corresponding to various languages in the language set respectively, wherein the nth application program installation package comprises a second resource file corresponding to the nth language in the language set;
after receiving an application program installation package downloading request sent by terminal equipment, acquiring a language used by the terminal equipment;
and sending a preferred installation package to the terminal equipment, wherein the preferred installation package is an application installation package corresponding to the language used by the terminal equipment.
5. The language configuration method according to claim 4, wherein the obtaining the language used by the terminal device comprises:
if the terminal equipment is provided with an SIM card, acquiring an address list and short message information from the SIM card;
if the address list and the short message information are not empty, determining the language used in the address list and the short message information as the language used by the terminal equipment;
and if the address list and the short message information are empty, acquiring the attribution of the SIM card, and determining the language corresponding to the attribution as the language used by the terminal equipment.
6. The language configuration method according to claim 4, wherein the obtaining the language used by the terminal device comprises:
if the terminal equipment is not provided with the SIM card, acquiring the position information of the terminal equipment;
determining a language area where the terminal equipment is located according to the position information;
and determining the language corresponding to the language area as the language used by the terminal equipment.
7. A language configuration apparatus, comprising:
the instruction information extraction module is used for receiving a language configuration instruction and extracting a language set and a text set to be configured from the language configuration instruction;
the first resource file generation module is used for determining a storage path corresponding to the nth language in the language set, wherein N is more than or equal to 1 and less than or equal to N, and N is the total number of various languages in the language set; generating a blank resource file corresponding to the nth language in the language set under the storage path; filling the blank resource file according to a preset resource file template to generate a first resource file corresponding to the nth language in the language set, wherein the first resource file comprises M text lines, each text line corresponds to one text entry in the text set, each text line comprises a reserved filling position, and M is the total number of the text entries in the text set;
a filling entry set generating module, configured to generate, according to the text set, filling entry sets corresponding to the languages in the language set respectively;
and the second resource file filling module is used for filling each filling entry set into each corresponding first resource file to obtain each second resource file corresponding to each language in the language set.
8. A computer readable storage medium storing computer readable instructions, which when executed by a processor implement the steps of the language configuration method of any one of claims 1 to 6.
9. A server comprising a memory, a processor and computer readable instructions stored in the memory and executable on the processor, characterized in that the processor, when executing the computer readable instructions, implements the steps of the language configuration method according to any of claims 1 to 6.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911307271.0A CN111158813B (en) | 2019-12-18 | 2019-12-18 | Language configuration method and device, computer readable storage medium and server |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911307271.0A CN111158813B (en) | 2019-12-18 | 2019-12-18 | Language configuration method and device, computer readable storage medium and server |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111158813A CN111158813A (en) | 2020-05-15 |
| CN111158813B true CN111158813B (en) | 2023-04-07 |
Family
ID=70557635
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201911307271.0A Active CN111158813B (en) | 2019-12-18 | 2019-12-18 | Language configuration method and device, computer readable storage medium and server |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111158813B (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115480776A (en) * | 2022-09-15 | 2022-12-16 | 平安银行股份有限公司 | Front-end project simple and traditional file packaging method, device, electronic equipment and storage medium |
| CN116821070A (en) * | 2023-06-30 | 2023-09-29 | 广州商研网络科技有限公司 | Multilingual file generation method and device, electronic equipment and storage medium |
| CN119473479B (en) * | 2024-10-31 | 2025-11-25 | 武汉精臣智慧标识科技有限公司 | A multilingual dynamic update method and apparatus |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106843986A (en) * | 2017-02-15 | 2017-06-13 | 福建天晴在线互动科技有限公司 | The language collocation method and system of a kind of mobile terminal |
| CN108255555A (en) * | 2017-12-26 | 2018-07-06 | 平安科技(深圳)有限公司 | A kind of system language switching method and terminal device |
| CN110399187A (en) * | 2018-04-25 | 2019-11-01 | 北京京东尚科信息技术有限公司 | A kind for the treatment of method and apparatus of language resource |
| CN110554893A (en) * | 2018-05-31 | 2019-12-10 | 马上消费金融股份有限公司 | Multi-language adaptation method, device and equipment for software system and readable storage medium |
-
2019
- 2019-12-18 CN CN201911307271.0A patent/CN111158813B/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106843986A (en) * | 2017-02-15 | 2017-06-13 | 福建天晴在线互动科技有限公司 | The language collocation method and system of a kind of mobile terminal |
| CN108255555A (en) * | 2017-12-26 | 2018-07-06 | 平安科技(深圳)有限公司 | A kind of system language switching method and terminal device |
| CN110399187A (en) * | 2018-04-25 | 2019-11-01 | 北京京东尚科信息技术有限公司 | A kind for the treatment of method and apparatus of language resource |
| CN110554893A (en) * | 2018-05-31 | 2019-12-10 | 马上消费金融股份有限公司 | Multi-language adaptation method, device and equipment for software system and readable storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111158813A (en) | 2020-05-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10212563B2 (en) | Updating web resources | |
| CN111158813B (en) | Language configuration method and device, computer readable storage medium and server | |
| CN111427641A (en) | Multilingual adaptation method, device, system, computer equipment and storage medium | |
| CN101986739A (en) | Method for setting language by mobile terminal and mobile terminal | |
| CN109685417B (en) | Sending information determining method and device | |
| CN110688201B (en) | Log management method and related equipment | |
| US20160092441A1 (en) | File Acquiring Method and Device | |
| CN108415998A (en) | Using dependence update method, terminal, equipment and storage medium | |
| CN111729313A (en) | Language configuration method and device, storage medium, and electronic device | |
| CN105227736A (en) | A kind of update method, Apparatus and system of reserved phone number | |
| US8966108B2 (en) | Portable data carrier comprising a CAT interpreter | |
| CN105407202A (en) | Method and terminal for remote query of contact information | |
| WO2019233255A1 (en) | Text message grouping method and device, and computer-readable storage medium | |
| CN111459911A (en) | Service data processing method and device | |
| CN102014374A (en) | Processing method of default file and mobile terminal | |
| CN108920246B (en) | Form draft component sharing method and device, terminal device and readable storage medium | |
| CN109246280B (en) | Address book cloud processing method and device, computer equipment and readable storage medium | |
| CN115348254A (en) | File packaging and downloading method and device, electronic equipment and storage medium | |
| CN112905871B (en) | Hot keyword recommendation method, device, terminal and storage medium | |
| US20220050811A1 (en) | Method and apparatus for synchronizing file | |
| EP3020217A1 (en) | Automaticac detection of a network operator for a mobile network device | |
| CN115795544B (en) | File security attribute storage method and related device | |
| CN115114240A (en) | Data processing method and device | |
| US10699059B2 (en) | Character updating method and apparatus | |
| CN113627129B (en) | Text copying method, device, electronic device and readable storage medium |
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 | ||
| TA01 | Transfer of patent application right |
Effective date of registration: 20210128 Address after: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.) Applicant after: Shenzhen saiante Technology Service Co.,Ltd. Address before: 1-34 / F, Qianhai free trade building, 3048 Xinghai Avenue, Mawan, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong 518000 Applicant before: Ping An International Smart City Technology Co.,Ltd. |
|
| TA01 | Transfer of patent application right | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |