Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Translate the specific controls in the dialog one by one
#6
@Gintaras

Worked well, thanks very much

I just implemented a similar feature in QM2, PS: May not be perfect, welcome to correct

QM2 is really like a legend, I can understand the code  Tongue   QM setting hotkeys is more convenient, Faster startup and execution

but for Uiscripter, it is still difficult to understand, maybe I need to learn more programming knowledge


Macro Macro14
Trigger F4     Help - how to add the trigger to the macro
Code:
Copy      Help
Acc ac = acc(mouse)
_s = ac.Name
if (empty(_s))
,int h = child(mouse)
,if h=0
,,h = win(mouse)
,_s.getwintext(h)

ARRAY(str) tl
sub.GetTranslation(_s "en" "zh_cn" tl)
str d=tl

OnScreenDisplay d.trim 1 0.5 0.5 "" 36 0xFF0000 4

#sub GetTranslation
function ~sourceText ~sourceLang ~targetLang ARRAY(str)&tl

sourceText.escape(11)
str s
IntGetFile F"https://translate.googleapis.com/translate_a/single?client=gtx&sl={sourceLang}&tl={targetLang}&dt=t&q={sourceText}" s
IXml x=JsonToXml(s)
IXmlNode r=x.RootElement
ARRAY(IXmlNode) a; r.Path("item/item/item[@type='string']" a 1)
for(int'i 0 a.len)
,,if(!(i&1))
,,,tl[]=a[i].Value

I found a problem, the flag 4 didn't work

4 click to hide

OnScreenDisplay d.trim 1 0.5 0.5 "" 36 0xFF0000 4


Messages In This Thread
RE: Translate the specific controls in the dialog one by one - by Davider - 07-26-2022, 11:51 PM

Forum Jump:


Users browsing this thread: 7 Guest(s)