CN107357568A - A kind of original language replacement method based on multi-lingual label - Google Patents

A kind of original language replacement method based on multi-lingual label Download PDF

Info

Publication number
CN107357568A
CN107357568A CN201710438565.1A CN201710438565A CN107357568A CN 107357568 A CN107357568 A CN 107357568A CN 201710438565 A CN201710438565 A CN 201710438565A CN 107357568 A CN107357568 A CN 107357568A
Authority
CN
China
Prior art keywords
interface display
language
character string
file
original language
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.)
Pending
Application number
CN201710438565.1A
Other languages
Chinese (zh)
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 Tongtai Tianjian Technology Co Ltd
Original Assignee
Beijing Tongtai Tianjian 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 Tongtai Tianjian Technology Co Ltd filed Critical Beijing Tongtai Tianjian Technology Co Ltd
Priority to CN201710438565.1A priority Critical patent/CN107357568A/en
Publication of CN107357568A publication Critical patent/CN107357568A/en
Pending legal-status Critical Current

Links

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/451Execution arrangements for user interfaces
    • G06F9/454Multi-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)
  • Document Processing Apparatus (AREA)

Abstract

The present invention provides a kind of original language replacement method based on multi-lingual label, comprises the following steps:The interface display text in application software or web page source code median surface display file is extracted, generates multi-language resource data;Export and show the multi-language resource data, to be audited and to be corrected to it;Translation corresponding with least one object language will be translated into corresponding to interface display text in the multi-language resource data;According to target language resource file corresponding to object language generation;The language environment that automatic detection user uses, using replacement function, the translation interface display text being substituted in the target language resource file corresponding with the language environment that user uses.Compared to traditional by way of writing extra replacement function and the original language character string in source code file is replaced with into object language, the original language replacement method provided by the invention based on multi-lingual label, substitute mode is simple and more efficient.

Description

A kind of original language replacement method based on multi-lingual label
Technical field
The present invention relates to computer software fields, more particularly to a kind of original language replacement method based on multi-lingual label.
Background technology
In the case of current International Software, issue of supporting multilanguage is more and more prominent, so-called multilingual support, is The display interface for referring to the online webpage that user is wanted to the application software shown with original language for using oneself or browsed turns Change oneself usual language into be read or checked, be easy to the easier operation of user oneself.However, from country variant User, usual category of language may also differ, such as English, Japanese and French.Being capable of root therefore, it is necessary to provide one kind According to the language needs using user, by the display of user's application software shown with original language used or the online webpage browsed Display interface of the critical transition into the usual language of user.
However, in the prior art, conventional method is the replacement function by calling manual compiling, by source code file The middle original language character string maps as interface display text to corresponding KEY values, then mapped to again by KEY values corresponding to The translation of object language.In the case where data volume is more, replace less efficient.
The content of the invention
The present invention provides a kind of original language replacement method based on multi-lingual label, it is characterised in that comprises the following steps: S1:The interface display text in application software or web page source code median surface display file is extracted, generates multi-language resource data; S2:Export and show the multi-language resource data, to be audited and to be corrected to it;S3:By the multi-language resource number Translation corresponding with least one object language is translated into corresponding to interface display text in;S4:According to the target language Target language resource file corresponding to speech generation;S5:The interface display text is replaced with into multi-lingual label;S6:According to The language environment that family uses, the loading target language resource file corresponding with the language environment that user uses.
Preferably, the step S1 further comprises:A1:Screened from the All Files of application software or web page source code Go out interface display file;A2:According to default screening rule, the interface display text in the interface display file is filtered out; A3:The punctuation mark that the interface display text tundish contains is detected, the interface is split according to the position of the punctuation mark Show text;A4:KEY values, and corresponding generation multi-language resource data are distributed for each interface display text.
Preferably, in the step A1:Application software or the suffix name of the All Files of web page source code are carried out certainly Dynamic scanning, the file for meeting the suffix name of prerequisite are just opened and are scanned line by line.
Preferably, the suffix name for meeting prerequisite refers to associated with the interface display of application software or webpage Interface display file.
Preferably, in the step A2:The content in the scanning interface display file word for word, caching are continuous line by line Original language character string, and detect whether the original language character string belongs to interface display text.
Preferably, if the original language character string is non-interface display text, the original language character string is emptied Caching, chooses next place's content in the interface display file and restarts word for word to be judged line by line;If the primitive Speech character string is interface display text, then takes out and preserve the interface display text.
Preferably, in the step A2, the screening rule includes:According to default regular expression, conduct is filtered out The original language character string inquired about in the condition options of data.
Preferably, in the step A2, the screening rule includes:According to whether including before and after original language character string Specific character or character string, judge whether the original language character string is annotated code.
Preferably, in the step A2, the screening rule includes:According to logic judgment symbol, original language word is judged Whether symbol string is non-interface display text as logic judgment condition.
Preferably, in the step A3:It is determined as among the original language character string of interface display text and whether includes There is punctuation mark:If the original language character string tundish contains punctuation mark, torn open according to the position of the punctuation mark Then point original language character string transcoding and is deposited until no longer include punctuation mark inside original language character string after splitting All character strings after storage fractionation;If not including among the original language character string has punctuation mark, direct transcoding and deposit Store up the original language character string.
Preferably, in the step A4, the KEY values are for its automatic distribution when storing the interface display text Identifier, and each described KEY value uniquely mark one interface display text.
Preferably, in the step S2:The multi-language resource data are shown in a manner of editable operation interface, And edit operation is carried out to the multi-language resource data.
Preferably, the edit operation includes increase data, modification data, deletes data, merging data and split data.
Preferably, in the step S4, by calling network interface, directly visited in a manner of online network access request Online network translation resource is asked, the interface display text in the multi-language resource data is translated.
Preferably, in the step S5:The interface display text is replaced with to the mode of multi-lingual label to be included entirely Portion replaces to be replaced with local, and described all replace is that all interface display texts that will be included in source code file are disposably whole Multi-lingual label corresponding to replacing with;Local replace is only to replace owning on the display interface that user is being currently used Interface display text, and the interface display text on the interface not being shown to other is not replaced temporarily then.
Compared with prior art, a kind of original language replacement method based on multi-lingual label provided by the invention, compared to biography System by way of writing extra replacement function and the original language character string in source code file replaced with into object language, replace It is simple and more efficient to change mode.
Brief description of the drawings
Fig. 1 is a kind of step flow of the original language replacement method based on multi-lingual label provided in an embodiment of the present invention Figure;
Fig. 2 is the processing step flow chart of step S101 in Fig. 1;
Fig. 3 (a) is the example of the drop-down selection control of interface display;
Fig. 3 (b) be and the interface display shown in Fig. 3 (a) drop-down selection control corresponding to source code file in part generation Code sentence example;
Fig. 4 (a) (b) (c) corresponds to three kinds of various forms of annotated code examples respectively;
Fig. 4 (d) is the partial code for the screening rule of three kinds of various forms of annotated codes shown in Fig. 4 (a) (b) (c) Example;
Fig. 5 is partial code example of the original language character string as service logic Rule of judgment.
Embodiment
Hereinafter, the exemplary embodiment of the present invention is described in detail with reference to the attached drawings.By referring to below to exemplary implementation Example and accompanying drawing detailed description, advantages of the present invention and feature can be more readily understood that and realize advantages of the present invention and The method of feature.However, it is possible to which a variety of forms realize the present invention, and the present invention should not be construed as being limited to herein The exemplary embodiment of elaboration.Further it is provided that these embodiments thorough and complete and will fully will send out this so as to the disclosure Bright design is communicated to those skilled in the art, and present invention is only defined by the following claims.Throughout the specification, it is identical Label instruction identical part.
It will be described in detail with reference to the accompanying drawings the exemplary embodiment of the present invention.The present invention can be used for numerous general or special purpose meters Calculate in system environments or configuration, such as including various types of computer equipments.
Fig. 1 is a kind of step flow of the original language replacement method based on multi-lingual label provided in an embodiment of the present invention Figure." original language " alleged by the present invention refers to that the source code median surface of application software or webpage shows that the interface display in file is literary Language used in this, such as:The original language of Chinese software is Chinese.
As shown in figure 1, step S101, extracts the interface in the source code median surface display file of application software or webpage Text is shown, generates multi-language resource data.
The original language changed is needed herein, in the application software or the display interface of the webpage browsed that usually user uses The character string of display(Hereinafter referred to as interface display text).
In above-mentioned steps, automatically scanning is carried out to the suffix name of All Files in application software or web page source code, according to The secondary file to meeting the file suffixes name of prerequisite in above-mentioned All Files progressively scans, by the filename of scanning and Adjacent original language text string extracting comes out and stored in the file content of scanning.Wherein, the prerequisite of meeting The file of file suffixes name, refer to the file associated with the interface display of application software or webpage(Hereinafter referred to as interface shows Show file).
Because the file of some suffix names in source code need not scan or can not possibly be scanned, such as the money of system Source file and configuration file.Simultaneously as present invention is mainly applied in the multilingual processing of application software or webpage, so The original language character string for needing to change is primarily directed to interface display text.But in fact, application software and web page source code In All Files might not all be original language character string in interface display file, and all interface display files not One to establish a capital be interface display text, therefore, in order to avoid unnecessary scanning, improves the efficiency of scanning, it is necessary to first from source code All Files in filter out interface display file, then just further extract interface from the interface display file filtered out Show text.
Fig. 2 is the processing step flow chart of step S101 in Fig. 1.
As shown in Fig. 2 step S201, filters out interface display text from the All Files of application software or web page source code Part.
Specifically, the filename of All Files and file suffixes name in above-mentioned source code are obtained successively, and one by one in judgement State file suffixes name and whether belong to the suffix name of interface display file, if belonging to the suffix name of interface display file, open The interface display file simultaneously progressively scans to content therein;If being not belonging to the suffix name of interface display file, skip This document suffix name, continue to judge next file suffixes name.
Judge whether above-mentioned file suffixes name belongs to the process of the suffix name of interface display file, it is specific as follows:In advance will The configuration that all kinds of possible file suffixes names for needing to scan are concentrated is in file suffixes name allocation list and stores this document suffix Name allocation list, wherein this document suffix name allocation list can enter style of writing according to the needs of application software or the programming language environment of webpage The addition or deletion of part suffix name;The file suffixes name of acquisition is compared with above-mentioned file suffixes name allocation list, if upper The file suffixes name that acquisition is can not find in file suffixes name allocation list is stated, then the file suffixes name of the acquisition is not belonging to interface display The suffix name of file;If the file suffixes of acquisition, the text of the acquisition can be found in above-mentioned file suffixes name allocation list Part suffix belongs to the suffix name of interface display file.
Step S202, according to default screening rule, filter out the interface display text in interface display file.
Due to can be non-interface display text in the presence of some original language character strings in interface display file, be need not by for Change, such as:Inquire about data condition options in original language character string, original language code annotation, as service logic judge The original language character string of condition, and log recording etc., if these also include the category being replaced, without any substantial Meaning and the workload for increasing post-processing, it is therefore desirable to above-mentioned screening step.
Original language character string to be replaced is not required to for above-mentioned, the content in interface display file is swept line by line When retouching, the original language character string included in source code is word for word detected line by line, and continuous original language character string is cached, so Whether the original language character string for judging above-mentioned caching according to screening rule afterwards belongs to interface display text.If the original of above-mentioned caching Language character string is not belonging to interface display text, then empties the original language character string of above-mentioned caching, chooses in interface display file Next place restart word for word to be judged line by line;If the original language character string of above-mentioned caching is interface display text, Take out and store the interface display text.
Wherein, whether the original language character string for judging above-mentioned caching according to screening rule belongs to the step of interface display text Suddenly, it is exemplary to enumerate several types:
When non-interface display text for original language character string in the condition options of inquiry data when, using original language be Chinese as Example, such as Fig. 3(a)And Fig. 3(b)It is shown.Fig. 3(a)With 3(b)The respectively drop-down selection control and corresponding of interface display The partial code sentence included in source code file.Fig. 3(b)In<Option value=" normal ">Normally</option>Code Second " normal " corresponds to Fig. 3 in sentence(a)Shown in drop-down selection control in " available " that shows, be that interface display is literary This, and it is value attributes that first is " normal ", is to carry out data query as condition, is non-interface display text, therefore Screening rule is needed to filter out second " normal " in above-mentioned code statement.Specific screening rule is regular expression: (u'.*>*<'), above-mentioned regular expression represents to filter out above-mentioned code statement<Option value=" normal ">Normally</ option>In to the right angle brackets ">" and to the left angle brackets "<" between all content, that is, filter out second " normal ".
When non-interface display text is the original language character string in annotated code, so that original language is Chinese as an example, such as Fig. 4 (a)(b)(c)It is shown, the exemplary representation for listing three kinds of annotated codes respectively.For annotated code, the screening Rule is to look for whether including some specific characters or character string before and after original language character string, specific such as Fig. 4(d)It is shown, lead to Cross and search specific character or character string to be screened, such as:Slash "/", asterisk " * ", middle strigula "-" etc..If Include the above-mentioned symbol enumerated in temp, then would not give result assignment, above-mentioned original language character string would not be filtered out.
When non-interface display text is the original language character string in service logic Rule of judgment, using original language be Chinese as Example, as shown in figure 5, exemplary illustrates partial code sentence of the original language character string as service logic Rule of judgment. In Fig. 5, " applicant's request slip caveat " in code statement is the original language character string of logic judgment condition.For upper The original language character string as logic judgment condition is stated, screening rule is according to the logic judgment symbol before logic judgment condition Judged, i.e., in Figure 5, the logic judgment symbol be not equal to "!=", if existed before original language character string above-mentioned Logic judgment symbol, then it is non-interface display text to illustrate the original language character string.
Step S203, the punctuation mark that the interface display text tundish contains is detected, according to the position of the punctuation mark Put and split the interface display text.
After interface display text is filtered out, it is also necessary to judge as being among the original language character string of interface display text It is no to include punctuation mark:If including punctuation mark, need according to the location of punctuation mark to the original language Character string is split, and no longer includes punctuation mark inside the original language character string after fractionation, then to above-mentioned fractionation After the completion of original language character string carry out transcoding and storage respectively;If not comprising there is punctuation mark, need not be split, Directly carry out transcoding and storage.Because in some interface display texts, the position of punctuation mark is the ground of original language punctuate Side, front and rear original language implication of making pauses in reading unpunctuated ancient writings and the original language implication being combined of not making pauses in reading unpunctuated ancient writings, often have any different, to avoid above-mentioned contain The difference of justice causes later stage translation error, thus needs the punctuation mark that further identification original language character string tundish contains and root Original language character string is split according to punctuation mark.
Specifically, so that original language is Chinese as an example, the code statement such as on the warning prompt of operation failure can be: Alert (" deletes failure, please retry!"), " deleting failure, please retry in the code statement!" representation page operates successfully shape The bullet frame of state is reminded, and is interface display text, it is necessary first to the punctuation mark in above-mentioned original language character string is detected, this The specific detection code statement in place is such as:line.find(',') >0, find out original language character string and " delete failure, please weigh Examination!" in comma, ";Then according to comma, " where position the original language character string " is deleted and failed, please retried!” 2 original language character strings are split as, are respectively:" deleting failure " and " please retry ", specifically split original language character string herein Code statement such as:Strn=line.split (', '), the original language character string after traversal is each split again after the completion of fractionation Such as " deleting failure " and " please retry ", the judgement of other punctuation marks and fractionation are carried out to it successively, until the primitive after splitting No longer include any punctuation mark in speech character string;Transcoding finally is carried out simultaneously successively to each original language character string after fractionation Storage, the code statement of its transit code is such as:temp=line.decode("utf8").
Step S204, KEY values, and corresponding generation multi-language resource data are distributed for each interface display text.
The identifier that it is its distribution automatically when storing the interface display text that the KEY values, which are, and described in each KEY values uniquely identify an interface display text.The type of KEY values is usually to be distributed in the form of character string correspondingly Each interface display text, and KEY values naming method can arbitrarily be named according to personal habits, such as shown in table 1 below:
Table 1 is so that original language is Chinese as an example, the interface display text and the corresponding relation of KEY values that are included in source code file.
The filename one of all interface display texts for being preserved in step S203 and its respective interface display file at place Corresponding preservation is played, generates multi-language resource data corresponding with the interface display text, the multi-language resource data can be The data file of multiple format form, such as:Xml, database, txt or excel etc., wherein database form are as follows State shown in table 2, above-mentioned various forms causes the more convenient operations such as follow-up input or statistical analysis.
Table 2 in the form of database exemplified by multi-language resource data structure.
Space, numeral for continuous original language intercharacter are considered as a part for original language.When in interface display file Content all scanning complete when, the scanning process of the interface display file is terminated.All texts in source code is traveled through successively After part, above-mentioned scanning process terminates.
Step S102, export and show the multi-language resource data, to be audited and to be corrected to it.
In order to further improve the accuracy of above-mentioned multi-language resource data, integrality is, it is necessary to the multi-lingual of above-mentioned generation Speech resource data, which is increased, deleted, changed, merged, split etc., to be operated, and can eliminate the redundancy of above-mentioned multi-language resource data Partly, increase lack part in above-mentioned multi-language resource data or correct error section in above-mentioned multi-language resource data.
Specifically, above-mentioned multi-language resource data are shown in a manner of editable operation interface, and manually examination one by one, example Such as:The table structure corresponding to original language character string that above-mentioned multi-language resource data filling can be omitted;It can delete above-mentioned The table structure corresponding to original language character string repeated in multi-language resource data;Can be by the original of above-mentioned multi-language resource data The data in table structure corresponding to language character string are modified, and such as change KEY values;Can be by above-mentioned multi-language resource data Original language character string similar in middle implication or the semantic original language character string repeated merge, using original language be Chinese as Example, such as " Chinese display " and " Chinese display " can be merged into one " Chinese display ";The original language character longer to some String, can be split as multinomial shorter original language character string.
Step S103, the interface display text in the multi-language resource data is translated into and at least one object language Corresponding translation.
In above-mentioned steps, the levels of precision that is needed according to client, the mode of translation can have following two:One kind is pin The user being strict with to translation, can be exported above-mentioned multi-language resource data in the form of form document as shown in table 1, And above-mentioned derived file is given to the translator of specialty, translator is to the interface display text in above-mentioned derived file Human translation is carried out, original language character string is translated into the character string corresponding to the object language of user's needs, such as English item by item Character string and/or Japanese character string etc., by original language character string in the character string write table 1 corresponding to the object language translated Lower section is corresponded in column, and then the file that above-mentioned translation is completed is imported into database again and carries out multi-language resource data more Newly;Another kind is the user not being strict with for translation, can be by calling network interface, with online network access request Mode directly access online network translation resource, the original language character string that is included in above-mentioned multi-language resource data is carried out Translation, such as calls the api interface of Baidu's translation to be translated to access Baidu, then corresponds to the multi-language resource data after preserving translation .
Step S104, according to target language resource file corresponding to object language generation.
In above-mentioned steps, according to the design method of programming language and program used by application software or webpage, according to Object language in the multi-language resource data, generates corresponding application software or the every kind of translation of correspondence that webpage can load The target language resource file of language, and be stored under a certain path.When object language only has it is a kind of when, corresponding generation and the mesh A target language resource file and an original language resource file corresponding to poster speech, such as:User is needed Chinese interface When translating into English, i.e., object language is English, and original language is Chinese, and the English resource file of its corresponding generation can be named as Message.en, and the Chinese resource file of generation is message.ch;When object language includes it is a variety of when, corresponding difference Multiple target language resource files and an original language resource file are generated, and the multiple target language resource file is right respectively A kind of object language is answered, such as:When object language includes two kinds of English and Japanese, corresponding a English resource file of generation Message.en, a Japanese resource file message.jp and a original language resource file.Generate original language resource file Effect be:After the original language display interface of user is converted into the interface that object language is shown, pass through the primitive of above-mentioned reservation Resource file is sayed, original language interface can also be returned to from the critical transition that object language is shown.
In addition, the content in each target language resource file, including the translation of the object language of interface display text and The KEY values of the interface display text.Such as:When object language is English, in English resource file message.en, boundary Face shows the English translation of text and the corresponding relation of the KEY values of the interface display text, is exemplified below and states shown in table 3:
Table 3 is KEY values and the corresponding relation of the English translation of interface display text in English resource file.
Step S105, the interface display text is replaced with into multi-lingual label.
Interface display text in source code file is replaced by multi-lingual label, will the interface display text replacement Into corresponding KEY values, the code statement of the multi-lingual label is specially:<fmt:Message key=" interface displays text Key values originally "/>, the example specifically replaced is as follows:The code statement of some interface display text is included in source code file For:<p>Welcome:<br /></p >, become after interface display text " welcome " therein is replaced with into multi-lingual label<p>< fmt:message key="main.welcome"/>:<br /></p >, wherein main.welcome is interface display text The KEY values of " welcome ".Interface display text is substituted for the benefit of corresponding multi-lingual label herein is:In subsequent step, KEY values can directly correspond to the translation of the interface display text in each target language resource file, need to only be indexed by KEY values Translation with regard to corresponding interface display text in each target language resource file can be quickly found, and and do not need artificial volume The outer replacement write replacement function and be used for interface display text.
In addition, the mode that the interface display text is replaced with into multi-lingual label can have two kinds:One kind is all to replace Change, i.e., all interface display texts included in source code file are disposably all replaced with into corresponding multi-lingual label;Separately One kind is local replacement, i.e., only replaces all interface display texts on the display interface that user is being currently used, and to it Interface display text on the interface that he is not shown is not replaced temporarily then, only when user clicks to enter another by mouse During display interface, fed back according to the click of user, the corresponding interface display text by another described display interface is replaced Into multi-lingual label.
Step S106, the language environment used according to user, the loading target corresponding with the language environment that user uses Language resource file.
Determine that the language environment that user uses there can be two ways:A kind of is the target language for making user oneself selection required Speech, specific manifestation form can be the selection control by interface display, select to there are plurality of target language, user in control One of which object language can be selected in the option of selection control according to the needs of oneself;Another kind is that automatic detection is used The language environment that family uses, determine object language, the browser or other forms file such as used by detecting user.
For the mode of the object language needed for user oneself selection, its code statement is exemplary to be:
<fmt:setLocale value="${sessionScope.LOCALE}"/>;
<fmt:bundle basename="message">;
First in above-mentioned code statement represents to obtain the object language that user is set, and wherein LOCALE variables represent that user sets The object language put;Second scope for representing to specify the target language resource file to be found.
The object language set according to user, find and load and user in the target language resource file of specified range The corresponding target language resource file of the object language of setting.
The mode of the language environment used for automatic detection user, such as the language environment for the browser that user uses, its Code statement is exemplary to be:
<fmt:setLocale value="${request.getLocale()}"/>;
<fmt:bundle basename="message">;
First in the above-mentioned code statement language environment for representing the browser that detection user uses, wherein request are represented Network request.
The language environment for the browser that user uses is obtained, finds and adds in the target language resource file of specified range Carry the target language resource file corresponding with the language environment for the browser that user uses.
When user runs webpage or application software, according to the KEY values in the multi-lingual label inserted in step S105, read Take and show translation corresponding with the KEY values in the above-mentioned target language resource file specified.
Original language replacement method provided by the invention based on multi-lingual label, compared to traditional by writing extra replace Exchange the letters number replaces with the original language character string in source code file the mode of object language, and substitute mode is more efficient.
Those skilled in the art will readily occur to the present invention its after considering specification and putting into practice invention disclosed herein Its embodiment.The application be intended to the present invention any modification, purposes or adaptations, these modifications, purposes or Person's adaptations follow the general principle of the present invention and including undocumented common knowledges or usual in the art Technological means.Description and embodiments be considered only as it is exemplary, true scope and spirit of the invention by following right will Ask and point out.
It should be appreciated that the invention is not limited in the precision architecture for being described above and being shown in the drawings, and And various modifications and changes can be being carried out without departing from the scope.The scope of the present invention is only limited by appended claim.

Claims (15)

1. a kind of original language replacement method based on multi-lingual label, it is characterised in that comprise the following steps:
S1:The interface display text in application software or web page source code median surface display file is extracted, generates multi-language resource Data;
S2:Export and show the multi-language resource data, to be audited and to be corrected to it;
S3:It is corresponding with least one object language by being translated into corresponding to the interface display text in the multi-language resource data Translation;
S4:According to target language resource file corresponding to object language generation;
S5:The interface display text is replaced with into multi-lingual label;
S6:The language environment used according to user, the loading target language resource text corresponding with the language environment that user uses Part.
2. according to the method for claim 1, it is characterised in that the step S1 further comprises:
A1:Interface display file is filtered out from the All Files of application software or web page source code;
A2:According to default screening rule, the interface display text in the interface display file is filtered out;
A3:The punctuation mark that the interface display text tundish contains is detected, according to being split the position of the punctuation mark Interface display text;
A4:KEY values, and corresponding generation multi-language resource data are distributed for each interface display text.
3. according to the method for claim 2, it is characterised in that in the step A1:
Automatically scanning is carried out to application software or the suffix name of the All Files of web page source code, meets the suffix name of prerequisite File be just opened and be scanned line by line.
4. according to the method for claim 3, it is characterised in that the suffix name for meeting prerequisite refer to apply it is soft The associated interface display file of the interface display of part or webpage.
5. according to the method for claim 2, it is characterised in that in the step A2:The scanning circle line by line word for word Face shows the content in file, caches continuous original language character string, and detect whether the original language character string belongs to interface Show text.
6. according to the method for claim 5, it is characterised in that:If the original language character string is non-interface display text This, then empty the caching of the original language character string, choose next place's content in the interface display file restart by Row is word for word judged;If the original language character string is interface display text, takes out and preserve the interface display text This.
7. according to the method for claim 2, it is characterised in that in the step A2, the screening rule includes:According to Default regular expression, filter out the original language character string in the condition options as inquiry data.
8. according to the method for claim 2, it is characterised in that in the step A2, the screening rule includes:According to Whether include specific character or character string before and after original language character string, judge whether the original language character string is annotation generation Code.
9. according to the method for claim 2, it is characterised in that in the step A2, the screening rule includes:According to Logic judgment symbol, judge whether original language character string is non-interface display text as logic judgment condition.
10. according to the method for claim 2, it is characterised in that in the step A3:
It is determined as among the original language character string of interface display text and whether includes punctuation mark:If the original language word Symbol string tundish contains punctuation mark, then after splitting the original language character string until splitting according to the position of the punctuation mark Original language character string inside no longer include punctuation mark, then transcoding and storage split after all character strings;If institute State not including among original language character string and have punctuation mark, then direct transcoding and the storage original language character string.
11. according to the method for claim 2, it is characterised in that in the step A4, the KEY values are in storage institute It is the identifier that it is distributed automatically when stating interface display text, and each described KEY value uniquely identifies an interface Show text.
12. according to the method for claim 1, it is characterised in that in the step S2:With editable operation interface Mode shows the multi-language resource data, and carries out edit operation to the multi-language resource data.
13. according to the method for claim 12, it is characterised in that:The edit operation include increase data, modification data, Delete data, merging data and split data.
14. according to the method for claim 1, it is characterised in that in the step S4, by calling network interface, with The mode of online network access request directly accesses online network translation resource, to the interface in the multi-language resource data Display text is translated.
15. according to the method for claim 1, it is characterised in that in the step S5:The interface display text is replaced Being changed to the mode of multi-lingual label will include including all replacing with local replacement, described all replace in source code file All interface display texts disposably all replace with corresponding multi-lingual label;Local replace is that only replacement user is current All interface display texts on the display interface being used, and the interface display text on the interface not being shown to other Do not replace temporarily then.
CN201710438565.1A 2017-06-12 2017-06-12 A kind of original language replacement method based on multi-lingual label Pending CN107357568A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710438565.1A CN107357568A (en) 2017-06-12 2017-06-12 A kind of original language replacement method based on multi-lingual label

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710438565.1A CN107357568A (en) 2017-06-12 2017-06-12 A kind of original language replacement method based on multi-lingual label

Publications (1)

Publication Number Publication Date
CN107357568A true CN107357568A (en) 2017-11-17

Family

ID=60273721

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710438565.1A Pending CN107357568A (en) 2017-06-12 2017-06-12 A kind of original language replacement method based on multi-lingual label

Country Status (1)

Country Link
CN (1) CN107357568A (en)

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108021423A (en) * 2017-12-15 2018-05-11 语联网(武汉)信息技术有限公司 A kind of Multilingual website generating method, system and computer-readable recording medium
CN108427672A (en) * 2018-02-07 2018-08-21 平安科技(深圳)有限公司 The method and terminal device of character translation
CN108491398A (en) * 2018-03-26 2018-09-04 深圳市元征科技股份有限公司 A kind of method that newer software text is translated and electronic equipment
CN108776639A (en) * 2018-04-26 2018-11-09 福建天泉教育科技有限公司 Language check test method and computer readable storage medium
CN109783579A (en) * 2019-01-22 2019-05-21 南京焦点领动云计算技术有限公司 A kind of method of quick copy and translation web site
WO2019144259A1 (en) * 2018-01-23 2019-08-01 Oracle International Corporation Transformation of resource files using mapped keys for tracking content location
CN110347429A (en) * 2019-06-12 2019-10-18 苏州浪潮智能科技有限公司 A kind of file test method, device and computer readable storage medium
CN110413574A (en) * 2019-07-30 2019-11-05 深圳市携众通科技有限公司 A kind of method of automatic code generating internationalized resources
CN110414010A (en) * 2018-04-27 2019-11-05 福建天晴数码有限公司 The processing method of internationalized resources file translation text, readable storage medium storing program for executing
CN110968709A (en) * 2018-09-30 2020-04-07 北京国双科技有限公司 Data transmission method and related system
CN110990105A (en) * 2019-12-10 2020-04-10 北京小米移动软件有限公司 Interface display method and device, electronic equipment and storage medium
CN111144135A (en) * 2019-11-19 2020-05-12 珠海格力电器股份有限公司 Entry conversion method, device, equipment and readable medium
CN111274420A (en) * 2020-02-07 2020-06-12 京东数字科技控股有限公司 Data processing method and device, electronic equipment and storage medium
CN111729313A (en) * 2020-05-06 2020-10-02 完美世界(北京)软件科技发展有限公司 Language configuration method and device, storage medium and electronic device
CN112364667A (en) * 2020-11-10 2021-02-12 成都安易迅科技有限公司 Character checking method and device, computer equipment and computer readable storage medium
CN112486623A (en) * 2020-12-16 2021-03-12 恩亿科(北京)数据科技有限公司 Development method, system and electronic equipment for automatically supporting multiple languages based on interface
CN113010244A (en) * 2021-02-24 2021-06-22 上海莉莉丝网络科技有限公司 Language resource database, language resource management platform and language resource management system
CN113157354A (en) * 2020-01-07 2021-07-23 北京京东振世信息技术有限公司 Method, device, equipment and computer readable medium for processing data
CN113918254A (en) * 2021-09-27 2022-01-11 腾讯科技(深圳)有限公司 Language text management method and device, storage medium and electronic equipment
TWI810513B (en) * 2021-01-14 2023-08-01 首岳資訊網路股份有限公司 Automatic translation generated system for website and method thereof
CN117709362A (en) * 2023-11-22 2024-03-15 赛力斯汽车有限公司 Method, device, computer equipment and storage medium for modifying multilingual resources
CN113918254B (en) * 2021-09-27 2024-07-12 腾讯科技(深圳)有限公司 Language text management method and device, storage medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101120339A (en) * 2005-02-16 2008-02-06 三星电子株式会社 Multiple language support system and method for application
CN101667118A (en) * 2008-09-02 2010-03-10 华为技术有限公司 Method and device for multi-language version development and replacement
CN104978394A (en) * 2015-05-08 2015-10-14 安徽机电职业技术学院 Webpage tag data organization and update method for multi-language display
CN106776584A (en) * 2016-11-24 2017-05-31 网易(杭州)网络有限公司 Character displaying method, translation table generating method, document translation method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101120339A (en) * 2005-02-16 2008-02-06 三星电子株式会社 Multiple language support system and method for application
CN101667118A (en) * 2008-09-02 2010-03-10 华为技术有限公司 Method and device for multi-language version development and replacement
CN104978394A (en) * 2015-05-08 2015-10-14 安徽机电职业技术学院 Webpage tag data organization and update method for multi-language display
CN106776584A (en) * 2016-11-24 2017-05-31 网易(杭州)网络有限公司 Character displaying method, translation table generating method, document translation method and device

Cited By (35)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108021423A (en) * 2017-12-15 2018-05-11 语联网(武汉)信息技术有限公司 A kind of Multilingual website generating method, system and computer-readable recording medium
CN108021423B (en) * 2017-12-15 2021-05-04 语联网(武汉)信息技术有限公司 Multilingual website generation method and system and computer readable storage medium
WO2019144259A1 (en) * 2018-01-23 2019-08-01 Oracle International Corporation Transformation of resource files using mapped keys for tracking content location
US11853685B2 (en) 2018-01-23 2023-12-26 Oracle International Corporation Transformation of resource files using mapped keys for tracking content location
CN108427672A (en) * 2018-02-07 2018-08-21 平安科技(深圳)有限公司 The method and terminal device of character translation
CN108427672B (en) * 2018-02-07 2019-05-07 平安科技(深圳)有限公司 Method, terminal device and the computer readable storage medium of character translation
CN108491398B (en) * 2018-03-26 2021-09-07 深圳市元征科技股份有限公司 Method for translating updated software text and electronic equipment
CN108491398A (en) * 2018-03-26 2018-09-04 深圳市元征科技股份有限公司 A kind of method that newer software text is translated and electronic equipment
CN108776639A (en) * 2018-04-26 2018-11-09 福建天泉教育科技有限公司 Language check test method and computer readable storage medium
CN110414010B (en) * 2018-04-27 2023-05-02 福建天晴数码有限公司 Processing method of internationalized resource file translation text and readable storage medium
CN110414010A (en) * 2018-04-27 2019-11-05 福建天晴数码有限公司 The processing method of internationalized resources file translation text, readable storage medium storing program for executing
CN110968709A (en) * 2018-09-30 2020-04-07 北京国双科技有限公司 Data transmission method and related system
CN110968709B (en) * 2018-09-30 2023-04-07 北京国双科技有限公司 Data transmission method and related system
CN109783579A (en) * 2019-01-22 2019-05-21 南京焦点领动云计算技术有限公司 A kind of method of quick copy and translation web site
CN109783579B (en) * 2019-01-22 2020-06-02 南京焦点领动云计算技术有限公司 Method for quickly copying and translating website
CN110347429B (en) * 2019-06-12 2022-09-20 苏州浪潮智能科技有限公司 File detection method and device and computer readable storage medium
CN110347429A (en) * 2019-06-12 2019-10-18 苏州浪潮智能科技有限公司 A kind of file test method, device and computer readable storage medium
CN110413574A (en) * 2019-07-30 2019-11-05 深圳市携众通科技有限公司 A kind of method of automatic code generating internationalized resources
CN111144135A (en) * 2019-11-19 2020-05-12 珠海格力电器股份有限公司 Entry conversion method, device, equipment and readable medium
CN110990105B (en) * 2019-12-10 2024-04-23 北京小米移动软件有限公司 Interface display method and device, electronic equipment and storage medium
CN110990105A (en) * 2019-12-10 2020-04-10 北京小米移动软件有限公司 Interface display method and device, electronic equipment and storage medium
CN113157354A (en) * 2020-01-07 2021-07-23 北京京东振世信息技术有限公司 Method, device, equipment and computer readable medium for processing data
CN113157354B (en) * 2020-01-07 2023-11-03 北京京东振世信息技术有限公司 Method, apparatus, device and computer readable medium for processing data
CN111274420A (en) * 2020-02-07 2020-06-12 京东数字科技控股有限公司 Data processing method and device, electronic equipment and storage medium
CN111274420B (en) * 2020-02-07 2023-09-26 京东科技控股股份有限公司 Data processing method, device, electronic equipment and storage medium
CN111729313A (en) * 2020-05-06 2020-10-02 完美世界(北京)软件科技发展有限公司 Language configuration method and device, storage medium and electronic device
CN112364667A (en) * 2020-11-10 2021-02-12 成都安易迅科技有限公司 Character checking method and device, computer equipment and computer readable storage medium
CN112364667B (en) * 2020-11-10 2023-03-24 成都安易迅科技有限公司 Character checking method and device, computer equipment and computer readable storage medium
CN112486623A (en) * 2020-12-16 2021-03-12 恩亿科(北京)数据科技有限公司 Development method, system and electronic equipment for automatically supporting multiple languages based on interface
TWI810513B (en) * 2021-01-14 2023-08-01 首岳資訊網路股份有限公司 Automatic translation generated system for website and method thereof
CN113010244B (en) * 2021-02-24 2023-05-26 上海莉莉丝网络科技有限公司 Language resource database, language resource management platform and language resource management system
CN113010244A (en) * 2021-02-24 2021-06-22 上海莉莉丝网络科技有限公司 Language resource database, language resource management platform and language resource management system
CN113918254A (en) * 2021-09-27 2022-01-11 腾讯科技(深圳)有限公司 Language text management method and device, storage medium and electronic equipment
CN113918254B (en) * 2021-09-27 2024-07-12 腾讯科技(深圳)有限公司 Language text management method and device, storage medium and electronic equipment
CN117709362A (en) * 2023-11-22 2024-03-15 赛力斯汽车有限公司 Method, device, computer equipment and storage medium for modifying multilingual resources

Similar Documents

Publication Publication Date Title
CN107357568A (en) A kind of original language replacement method based on multi-lingual label
US11294968B2 (en) Combining website characteristics in an automatically generated website
US7447624B2 (en) Generation of localized software applications
US8468494B2 (en) In-line editor
US20070233456A1 (en) Document localization
KR101114189B1 (en) Label system-translation of text and multi-language support at runtime and design
US20110144972A1 (en) Method and System for Generating a Localized Software Product
US20030009323A1 (en) Application platform for developing mono-lingual and multi-lingual systems and generating user presentations
CN101667118A (en) Method and device for multi-language version development and replacement
US20040268256A1 (en) Program, character inputting and editing method, apparatus and storage medium
JPH04505227A (en) Document generation device and method
US20170109442A1 (en) Customizing a website string content specific to an industry
US20040267803A1 (en) File translation
US7415405B2 (en) Database script translation tool
WO2020039729A1 (en) Document creation assistance system
US7711548B2 (en) Method and structures to enable national language support for dynamic data
US20110307243A1 (en) Multilingual runtime rendering of metadata
CN109947711B (en) Automatic multi-language file management method in IOS project development process
AU2007200384B2 (en) Definitions in master documents
JP2007157123A (en) Improved chinese to english translation tool
CN101196883A (en) Internet information natural language translation general method and system
JP6056489B2 (en) Translation support program, method, and apparatus
JP6602994B1 (en) Document creation support system
JP2021197130A (en) Information processing device
Greulich Indexing with Excel, Part 2. Checking indexing data

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20171117