A kind of method, system and device of translating the Application Program Interface on the handheld device
Technical field
The present invention relates to the language conversion field, more particularly, relate to a kind of method, system and device of translating the Application Program Interface on the handheld device.
Background technology
Along with Internet development, the language on the Application Program Interface on the handheld device may be that English also may be Chinese, or even French.Because the difference of user's individuality, the user who has is good at Chinese, the difference of being good at English etc. that has, and a certain Language Application program interface causes certain difficulty must for different users, make have to this application program of the language abandoning being ignorant of of user, and the language on the selection Application Program Interface to be it be familiar with, this is unfavorable for the utmost point popularization of application program.
For these reasons, some translation systems have appearred on the market, a kind of translation system, resolve at interface in its direct application programs, corresponding characters string on the interface is resolved, translate into Chinese after, directly the corresponding word segment with the English interface of application program replaces to Chinese.There is certain problem in this technical scheme, such as because language environment not up and down, when translation, only will need the most frequently used meaning of the literal translated as the meaning of this language, thereby make that the precision of translation is not high, greatly reduce the ease for use of application program.
Therefore, need a kind of method and system of translating the Application Program Interface on the handheld device, can improve the translation precision of the Application Program Interface on the handheld device.
Summary of the invention
The object of the present invention is to provide a kind of method and system of translating the Application Program Interface on the handheld device, be intended to solve in the prior art problems such as the Application Program Interface language conversion on the handheld device is inaccurate.
In order to realize purpose of the present invention, a kind of method of translating the Application Program Interface on the handheld device may further comprise the steps:
The text of the Application Program Interface correspondence on S1, the parsing handheld device comprises figure and literal and position, context of co-text, and described Application Program Interface is presented at the perform region;
The name of S2, the described Application Program Interface of extraction tabulates and the corresponding value of name tabulation, and the value of name tabulation correspondence is presented at the perform region;
S3, the corresponding value of translation name tabulation receive and preserve the user to the correction of target language value, and replace the corresponding value of name tabulation; The corresponding value of name tabulation after the described translation is the target language value, and described target language value is presented in the perform region;
S4, resolve Application Program Interface text on the handheld device again, comprise figure and literal and position, context of co-text, and display application program interface again.
Preferably, the form with form is presented in the perform region side by side in the perform region for the value of described name tabulation correspondence and target language value.
Preferably, described Application Program Interface is presented at the top, perform region, and the value that the name tabulation is corresponding and target language value show the below, perform region.
In above-mentioned arbitrary technical scheme, also comprise S0 after the described step S1 before the step S2, receive source language and target language that the user imports.
Further, described step S3 comprises:
S31, the value that name tabulation is corresponding are translated into target language, get the target language value;
S32, the value that the target language value is corresponding with showing the name tabulation are presented in the perform region side by side;
S33, reception are also preserved the user to the correction of target language value, get name tabulation modified value;
S34, the value that name tabulation in the text is corresponding replace with name tabulation modified value;
The translation state of the value that S35, demonstration and renewal name tabulation are corresponding.
The present invention also comprises a kind of system that translates the Application Program Interface on the handheld device, and it comprises parsing module, source language extraction module and source language translation module;
Described parsing module is used for resolving the Application Program Interface text on the handheld device, comprises figure and literal and position, context of co-text, and the display application program interface;
Described source language extracts, and is used for extracting name tabulation and the corresponding value of name tabulation of described Application Program Interface, and the corresponding value of name tabulation is presented at the perform region;
Described source language translation module is used for the corresponding value of translation name tabulation, receives and preserve the user to the correction of target language value, and replaces the corresponding value of name tabulation; The corresponding value of name tabulation after the described translation is the target language value, and described target language value is presented in the perform region.
Preferably, the form with form is presented in the perform region side by side in the perform region for the value of described name tabulation correspondence and target language value.
Preferably, described Application Program Interface is presented at the top, perform region, and the value that the name tabulation is corresponding and target language value show the below, perform region.
In above-mentioned arbitrary technical scheme, described system also comprises human-computer interaction module, is used for receiving source language and the target language of user's input.
Further, described source language translation module comprises: language conversion unit, display unit, amending unit, text are replaced unit and state updating unit.Wherein: described language conversion unit, be used for the corresponding value of name tabulation is translated into target language, get the target language value; Described display unit is used for the value that the target language value is corresponding with showing the name tabulation and is presented in the perform region side by side; Described amending unit is used for reception and preserves the user to the correction of target language value, gets name tabulation modified value; Described text is replaced the unit, is used for the corresponding value of text name tabulation is replaced with nane tabulation modified value; Described state updating unit is for the translation state that shows and upgrade the corresponding value of name tabulation.
The present invention also comprises a kind of device of translating the Application Program Interface on the handheld device, comprises arbitrary technical scheme of system of the present invention.
Preferably, described device comprises PC, panel computer, mobile phone and TV.
In the technique scheme of the present invention, by the target language value of real-time demonstration translation gained, and receive and preserve the translation content that the user revises, thereby make that the translation gained in the final Application Program Interface that shows is more accurate.Simultaneously, the present invention is the display application program interface side by side, and true visible translation scene is provided, make that technical scheme of the present invention is more easy-to-use, in addition, avoided to determine because of no scene the problem of correct target language value, the precision of translation further is provided.
Description of drawings
Fig. 1 is method flow diagram in one embodiment of the invention.
Fig. 2 is system architecture synoptic diagram in one embodiment of the invention.
Fig. 3 is source language translation modular structure synoptic diagram in one embodiment of the invention.
Fig. 4 is the user interface structure figure of the system of the Application Program Interface on the translation handheld device in one embodiment of the invention.
Fig. 5 is another user interface structure figure of the system of the Application Program Interface on the translation handheld device in one embodiment of the invention.
Embodiment
For make the object of the invention, technical scheme and advantage clearer, understand, below in conjunction with accompanying drawing to describing.
In conjunction with Fig. 1, the present invention proposes first embodiment.A kind of method of translating the Application Program Interface on the handheld device, may further comprise the steps: the text of the Application Program Interface correspondence on p1, the parsing handheld device, comprise figure and literal and position, context of co-text, and described Application Program Interface is presented at the perform region.The name of p2, the described Application Program Interface of extraction tabulates and the corresponding value of name tabulation, and the value of name tabulation correspondence is presented at the perform region; P3, the corresponding value of translation name tabulation receive and preserve the user to the correction of target language value, and replace the corresponding value of name tabulation; The corresponding value of name tabulation after the described translation is the target language value, and described target language value is presented in the perform region; P4, resolve Application Program Interface text on the handheld device again, comprise figure and literal and position, context of co-text, and display application program interface again.
Technical scheme in the present embodiment by the target language value of real-time demonstration translation gained, and receives and preserves the translation content that the user revises, thereby makes that the translation gained in the final Application Program Interface that shows is more accurate.The present invention is the display application program interface side by side, and true visible translation scene is provided, and makes that the interface of translation is more clear, thereby makes that this scheme is more easy-to-use.In addition, also avoided to determine because of no scene the problem of correct target language value, the precision of translation further is provided.
In the technical scheme in above-described embodiment, described step p3 comprises: p31, the value that name tabulation is corresponding are translated into target language, get the target language value; P32, the value that the target language value is corresponding with showing the name tabulation are presented in the perform region side by side; P33, reception are also preserved the user to the correction of target language value in the perform region, get name tabulation modified value; P34, the value that name tabulation in the text is corresponding replace with name tabulation modified value; Translation state in p35, demonstration and the renewal perform region.In the technical program, by the interface after the translation is revised in real time, make it to meet more current interface environments, also can the translation content at interface be set according to user's custom, thereby improve ease for use of the present invention greatly.
In conjunction with as Fig. 2, the present invention proposes second embodiment.A kind of system that translates the Application Program Interface on the handheld device comprises: parsing module, source language extraction module and source language translation module.Wherein: described parsing module, be used for resolving the Application Program Interface text on the handheld device, comprise figure and literal and position, context of co-text, and the display application program interface; Described source language extracts, and is used for extracting name tabulation and the corresponding value of name tabulation of described Application Program Interface, and the corresponding value of name tabulation is presented at the perform region; Described source language translation module is used for the corresponding value of translation name tabulation, receives and preserve the user to the correction of target language value, and replaces the corresponding value of name tabulation; The corresponding value of name tabulation after the described translation is the target language value, and described target language value is presented in the perform region.
Technical scheme in the present embodiment by the target language value of real-time demonstration translation gained, and receives and preserves the translation content that the user revises, thereby makes that the translation gained in the final Application Program Interface that shows is more accurate.The present invention is the display application program interface side by side, and true visible translation scene is provided, and makes that the interface of translation is more clear, thereby makes that this scheme is more easy-to-use.In addition, also avoided to determine because of no scene the problem of correct target language value, the precision of translation further is provided.
In conjunction with Fig. 3 as can be known, the source language translation module in the present embodiment comprises: language conversion unit, display unit, amending unit, text are replaced unit and state updating unit.Wherein: described language conversion unit, be used for the corresponding value of name tabulation is translated into target language, get the target language value; Described display unit is used for the value that the target language value is corresponding with showing the name tabulation and is presented in the perform region side by side; Described amending unit is used for reception and preserves the user to the correction of target language value, gets name tabulation modified value; Described text is replaced the unit, is used for the corresponding value of text name tabulation is replaced with name tabulation modified value; Described state updating unit is for the translation state that shows and upgrade the corresponding value of name tabulation.In the technical program, by the interface after the translation is revised in real time, make it to meet more current interface environments, also can the translation content at interface be set according to user's custom, thereby improve ease for use of the present invention greatly.
Based on second embodiment, the present invention proposes the 3rd embodiment.A kind of device of translating the Application Program Interface on the handheld device, it comprises the system described in arbitrary technical scheme among second embodiment.Preferably, the device described in the present embodiment includes but not limited to PC, panel computer, mobile phone and TV.
Based on above-mentioned arbitrary embodiment, the present invention proposes the 4th embodiment, describes below in conjunction with Fig. 4 and Fig. 5.The corresponding value of described name tabulation is the row at the af-ZA place among Fig. 4 or Fig. 5, and the target language value is the row of en-ET correspondence.The value 2 that described name tabulation is corresponding and target language value 4 are in the display mode particular restriction of perform region, preferably, the form with form is presented in the perform region side by side in the perform region for the value 2 that described name tabulation is corresponding and target language value 4, this technical scheme can make the corresponding value 2 of name tabulation and target language value 4 show clearly in the perform region, make things convenient for relatively corresponding value 2 and the target language value 4 of name tabulation of user, finally determine whether revise goal language value 4, thus the user's that accurately suited translation content.Further, in the present embodiment, Application Program Interface 1 is presented at the top, perform region, and the value 2 that the name tabulation is corresponding and target language value 4 show the below, perform region.Wherein, Fig. 4 is for system of the present invention or the accompanying drawing that obtains after installing resolution file first, the accompanying drawing when Fig. 5 translates the corresponding value 2 of name tabulation for system of the present invention or device.As 4 and Fig. 5 as shown in, when the corresponding value 2 of name tabulation was translated, status bar 3 can real-time update translation states.Need to prove that the text in the zone of target language value 4 correspondences can be revised, as shown in Figure 5, revise or the translation value be name tabulation modified value 4 '.The name tabulation modified value 4 ' language corresponding with Application Program Interface is corresponding one by one, and when name tabulation modified value 4 ' changed, the correspondence variation also took place Application Program Interface 1 corresponding character part, get final product Fig. 5 corresponding application program interface 1 '.The technical scheme of present embodiment makes to be user-friendly to the perform region clear display of system or device, simultaneously, the result who provides the user to revise interpretive language, thus the precision of translation improved greatly.
In order better to understand technique scheme, below provide specific description: the name tabulation among the present invention is the tabulation of the corresponding name of Application Program Interface element, for example in the android system, the country in " android.text=" @string/country " is name.In the present invention, resolve the text of the Application Program Interface correspondence on the handheld device, generally there is specific deposit position the position of described text, for example is positioned at/the res/layout file.Extract name tabulation and the corresponding value of name tabulation of described Application Program Interface, the text of the value that described name tabulation is corresponding generally is positioned at/res/values/.Certainly, described above-mentioned situation is generalized case, and in different systems or device, the position of this document or the analysis mode of name are different, but this is not limited to the present invention.
Should be noted that typical case of the present invention uses the mthods, systems and devices that are not limited among the present invention, in other similar approach, system or the device in field, also can use mthods, systems and devices set forth in the present invention.
Above-mentioned is preferred embodiment of the present invention only, is not limited to the present invention, all any modifications of making within the spirit and principles in the present invention, is equal to substitutions and modifications etc., all should be included within the scope of protection of the invention.