A kind of method, system and device of the Application Program Interface translated in handheld device
Technical field
The present invention relates to language conversion field, more particularly, it relates to the method, system and device of a kind of Application Program Interface translated in handheld device.
Background technology
Along with the development of internet, the language on Application Program Interface on a handheld device is probably English and is also likely to be Chinese, even French.Due to the difference that user is individual, some users are good at Chinese, the difference being good at English etc. having, and the Application Program Interface of a certain language causes certain difficulty necessarily to different users, make this application program of the language that user has to abandon be ignorant of, and selecting the language on Application Program Interface is that it is familiar with, pole is unfavorable for the popularization of application program by this.
For these reasons, market occurs in that some translation systems, a kind of translation system, interface in application program is directly resolved by it, character string corresponding on interface is resolved, after translating into Chinese, directly the corresponding word segment of the English interface of application program is replaced to Chinese.There is certain problem in this technical scheme, such as due to do not have upper and lower language environment, when translation, only using the most frequently used the looking like as the meaning of this language of the word needing translation, so that the precision of translation is the highest, greatly reduces the ease for use of application program.
Accordingly, it would be desirable to the method and system of a kind of Application Program Interface translated in handheld device, it is possible to increase the translation precision of the Application Program Interface in handheld device.
Summary of the invention
It is an object of the invention to provide the method and system of a kind of Application Program Interface translated in handheld device, it is intended to the problems such as the Application Program Interface language conversion that solves in prior art in handheld device is inaccurate.
In order to realize the purpose of the present invention, a kind of method of Application Program Interface translated in handheld device comprises the following steps:
S1, the text that the Application Program Interface resolved in handheld device is corresponding, including figure and word and position, context of co-text, and show described Application Program Interface in working region;
S2, extract the value that the name column table of described Application Program Interface is corresponding with name column table, and value corresponding for name column table is shown in working region;
S3, the value that translation name column table is corresponding, receive and preserve user's correction to object language value, and replace the value that name column table is corresponding;The value that name column table after described translation is corresponding is object language value, and described object language value shows in working region;
S4, again resolve the Application Program Interface text in handheld device, including figure and word and position, context of co-text, and again show Application Program Interface.
Preferably, described name column table is corresponding value and object language value show in working region the most side by side in working region.
Preferably, described Application Program Interface shows above working region, and value and object language value that name column table is corresponding show below working region.
In any of the above-described technical scheme, after described step S1, before step S2, also include S0, the original language receiving user's input and object language.
Further, described step S3 includes:
S31, value corresponding for name column table is translated into object language, obtain object language value;
S32, object language value is shown in working region side by side with display value corresponding to name column table;
S33, receive and preserve user's correction to object language value, obtain name column table correction value;
S34, value corresponding for name column table in text is replaced with name column table correction value;
S35, show and update the translation state of value corresponding to name column table.
Present invention additionally comprises the system of a kind of Application Program Interface translated in handheld device, it includes parsing module, original language extraction module and source language translation module;
Described parsing module, for resolving the Application Program Interface text in handheld device, including figure and word and position, context of co-text, and shows Application Program Interface;
Described original language extracts, and for extracting the value that the name column table of described Application Program Interface is corresponding with name column table, and shows value corresponding for name column table in working region;
Described source language translation module, for translating the value that name column table is corresponding, receives and preserves user's correction to object language value, and replace the value that name column table is corresponding;The value that name column table after described translation is corresponding is object language value, and described object language value shows in working region.
Preferably, described name column table is corresponding value and object language value show in working region the most side by side in working region.
Preferably, described Application Program Interface shows above working region, and value and object language value that name column table is corresponding show below working region.
In any of the above-described technical scheme, described system also includes human-computer interaction module, for receiving original language and the object language of user's input.
Further, described source language translation module includes: language conversion unit, display unit, amending unit, text replacement unit and state updating unit.Wherein: described language conversion unit, for value corresponding for name column table is translated into object language, object language value is obtained;Described display unit, for showing the value that object language value is corresponding with display name column table side by side in working region;Described amending unit, for receiving and preserve user's correction to object language value, obtains name column table correction value;Described text replacement unit, for replacing with nane list correction value by value corresponding for name column table in text;Described state updating unit, for showing and update the translation state of value corresponding to name column table.
Present invention additionally comprises the device of a kind of Application Program Interface translated in handheld device, including arbitrary technical scheme of system of the present invention.
Preferably, described device includes PC, panel computer, mobile phone and TV.
In the technique scheme of the present invention, by the object language value of the gained of display translation in real time, and receive and preserve the translation content that user revises, so that the translation gained in the Application Program Interface of final display is more accurate.Meanwhile, the present invention can show Application Program Interface side by side, it is provided that true visible translation scene, technical scheme is made to be more easy to use, it addition, avoid the problem because cannot determine correct object language value without scene, it is further provided the precision of translation.
Accompanying drawing explanation
Fig. 1 is method flow diagram in one embodiment of the invention.
Fig. 2 is system architecture schematic diagram in one embodiment of the invention.
Fig. 3 is source language translation modular structure schematic diagram in one embodiment of the invention.
Fig. 4 is the user interface structure figure of the system translating the Application Program Interface in handheld device in one embodiment of the invention.
Fig. 5 is another user interface structure figure of the system translating the Application Program Interface in handheld device in one embodiment of the invention.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer, clear, below in conjunction with accompanying drawing to illustrating.
In conjunction with Fig. 1, the present invention proposes first embodiment.A kind of method of the Application Program Interface translated in handheld device, comprise the following steps: p1, the text that the Application Program Interface resolved in handheld device is corresponding, including figure and word and position, context of co-text, and described Application Program Interface is shown in working region.P2, extract the value that the name column table of described Application Program Interface is corresponding with name column table, and value corresponding for name column table is shown in working region;P3, the value that translation name column table is corresponding, receive and preserve user's correction to object language value, and replace the value that name column table is corresponding;The value that name column table after described translation is corresponding is object language value, and described object language value shows in working region;P4, again resolve the Application Program Interface text in handheld device, including figure and word and position, context of co-text, and again show Application Program Interface.
Technical scheme in the present embodiment, by the object language value of the gained of display translation in real time, and receives and preserves the translation content that user revises, so that the translation gained in the Application Program Interface of final display is more accurate.The present invention can show Application Program Interface side by side, it is provided that true visible translation scene so that the interface of translation becomes apparent from, so that the program is more easy to use.It addition, it also avoid the problem because cannot determine correct object language value without scene, it is further provided the precision of translation.
In technical scheme in above-described embodiment, described step p3 includes: p31, value corresponding for name column table is translated into object language, obtains object language value;P32, object language value is shown in working region side by side with display value corresponding to name column table;P33, receive and preserve user to the correction of object language value in working region, obtain name column table correction value;P34, value corresponding for name column table in text is replaced with name column table correction value;P35, the translation state showing and updating in working region.In the technical program, by the interface after translation is revised in real time, it is allowed to more conform to current interface environments, the translation content at interface also can be set according to user habit, thus substantially increase the ease for use of the present invention.
In conjunction with such as Fig. 2, the present invention proposes the second embodiment.A kind of system of the Application Program Interface translated in handheld device, including: parsing module, original language extraction module and source language translation module.Wherein: described parsing module, for resolving the Application Program Interface text in handheld device, including figure and word and position, context of co-text, and show Application Program Interface;Described original language extracts, and for extracting the value that the name column table of described Application Program Interface is corresponding with name column table, and shows value corresponding for name column table in working region;Described source language translation module, for translating the value that name column table is corresponding, receives and preserves user's correction to object language value, and replace the value that name column table is corresponding;The value that name column table after described translation is corresponding is object language value, and described object language value shows in working region.
Technical scheme in the present embodiment, by the object language value of the gained of display translation in real time, and receives and preserves the translation content that user revises, so that the translation gained in the Application Program Interface of final display is more accurate.The present invention can show Application Program Interface side by side, it is provided that true visible translation scene so that the interface of translation becomes apparent from, so that the program is more easy to use.It addition, it also avoid the problem because cannot determine correct object language value without scene, it is further provided the precision of translation.
Understanding in conjunction with Fig. 3, the source language translation module in the present embodiment includes: language conversion unit, display unit, amending unit, text replacement unit and state updating unit.Wherein: described language conversion unit, for value corresponding for name column table is translated into object language, object language value is obtained;Described display unit, for showing the value that object language value is corresponding with display name column table side by side in working region;Described amending unit, for receiving and preserve user's correction to object language value, obtains name column table correction value;Described text replacement unit, for replacing with name column table correction value by value corresponding for name column table in text;Described state updating unit, for showing and update the translation state of value corresponding to name column table.In the technical program, by the interface after translation is revised in real time, it is allowed to more conform to current interface environments, the translation content at interface also can be set according to user habit, thus substantially increase the ease for use of the present invention.
Based on the second embodiment, the present invention proposes the 3rd embodiment.The device of a kind of Application Program Interface translated in handheld device, it includes the system described in arbitrary technical scheme in the second embodiment.Preferably, the device described in the present embodiment includes but not limited to PC, panel computer, mobile phone and TV.
Based on any of the above-described embodiment, the present invention proposes the 4th embodiment, illustrates below in conjunction with Fig. 4 and Fig. 5.The value that described name column table is corresponding is the row at the af-ZA place in Fig. 4 or Fig. 5, and object language value is the row that en-ET is corresponding.Value 2 and the object language value 4 display mode in working region that described name column table is corresponding are specifically limited, preferably, value 2 and object language value 4 that described name column table is corresponding show in working region the most side by side in working region, this technical scheme can make value 2 that name column table is corresponding and object language value 4 clearly indicate in working region, user is facilitated to compare value corresponding to name column table 2 and object language value 4, finally determine whether to revise object language value 4, thus obtain the translation content of accurate appropriate user.Further, in the present embodiment, Application Program Interface 1 shows above working region, and value 2 and object language value 4 that name column table is corresponding show below working region.Wherein, Fig. 4 is the accompanying drawing obtained after the system of the present invention or device resolution file first, accompanying drawing when Fig. 5 is the system of the present invention or device translates the value 2 that name column table is corresponding.As shown in 4 and Fig. 5, when the value 2 that name column table is corresponding is translated, status bar 3 can real-time update translation state.It should be noted that the text in the region of object language value 4 correspondence can be modified, as shown in Figure 5, revise or translation value be name column table correction value 4 '.The language one_to_one corresponding that name column table correction value 4 ' is corresponding with Application Program Interface, when name column table correction value 4 ' changes, also there is corresponding change in the word segment of Application Program Interface 1 correspondence, Application Program Interface 1 ' corresponding for Fig. 5.The technical scheme of the present embodiment so that the working region of system or device shows clearly, is user-friendly to, simultaneously, it is provided that user revises the result of interpreter language, thus substantially increases the precision of translation.
In order to be better understood from technique scheme, specific description given below: the name column table in the present invention is the list of Application Program Interface element correspondence name, such as in Android system, " android.text="@string/country " in country be name.In the present invention, resolving the text that the Application Program Interface in handheld device is corresponding, typically there is specific deposit position the position of described text, such as, be positioned at/res/layout file.Extracting the value that the name column table of described Application Program Interface is corresponding with name column table, the text of the value that described name column table is corresponding is normally at/res/values/.Certainly, described above-mentioned situation is ordinary circumstance, 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.
It should be noted that, the mthods, systems and devices that typical case's application of the present invention is not limited in the present invention, other similar approach, system or the device in field can also use mthods, systems and devices set forth in the present invention.
Above are only presently preferred embodiments of the present invention, be not limited to the present invention, all made within the spirit and principles in the present invention any amendment, equivalent alterations and modifications etc., within should be included in the scope of protection of the invention.