none
LitDev Translator RRS feed

  • Question

  • hi im trying to use lit dev translator but i am failing. what languages does it support. and yes i do know there is an array but for example Russian is ru in quotes but when i try translating a word from english to russian, it doesnt work ,all i get are question marks meaning the letter type is not found. what  type of russian is used because the one my computer supports doesnt work i guess.

    this is the code

    'your computer must be able to support the language that you are supporting
    textwindow.WriteLine(LDTranslate.Languages())
    word = TextWindow.Read()
    start:
    translatedword = LDTranslate.Translate(word,"en","ru")

    TextWindow.WriteLine(translatedword)

    thanks, 

    RussianBrain


    • Edited by RussianBrain Thursday, March 31, 2016 5:58 PM
    • Moved by Just Karl Friday, April 1, 2016 1:53 PM Looking for the correct forum.
    • Moved by Dave PatrickMVP Sunday, April 3, 2016 2:29 AM
    Thursday, March 31, 2016 5:57 PM

Answers

  • Hi RussianBrain - glad you got moved to this forum - thanks to those who helped.

    I don't speak russian, but Google translate gives me this translation for "help" -> Помогите.

    Next I run your test program and print the actual characters returned.

    textwindow.WriteLine(LDTranslate.Languages())

    word = TextWindow.Read()

    start:

    translatedword = LDTranslate.Translate(word,"en","ru")

     

    TextWindow.WriteLine(translatedword)

     

    For i = 1 To Text.GetLength(translatedword)

      char = Text.GetSubText(translatedword,i,1)

      TextWindow.WriteLine(char+" : "+Text.GetCharacterCode(char))

    EndFor

    This gives me:

    ? : 1057

    ? : 1087

    ? : 1088

    ? : 1072

    ? : 1074

    ? : 1082

    ? : 1072

    It is 7 characters long, so doesn't seem to be Помогите, but also it is something.

    Using this unicode site:

    1057 is C Cyrillic Capital Letter Es

    1087 is п Cyrillic Small Letter Pe

    1088 is р Cyrillic Small Letter Er

    1072 is a Cyrillic Small Letter A

    1074 is в Cyrillic Small Letter Ve

    1082 is к Cyrillic Small Letter Ka

    1072 is a Cyrillic Small Letter A

    So it looks like a Cyrillic character set, Bing transplator gives me Справка, which matches my translator.

    So it is certainly a Cyrillic unicode translation.  Perhaps TextWindow is limited and cannot handle Cyrillic unicode, so I try using GraphicsWindow.

    textwindow.WriteLine(LDTranslate.Languages())

    word = TextWindow.Read()

    start:

    translatedword = LDTranslate.Translate(word,"en","ru")

     

    GraphicsWindow.DrawText(20,20,translatedword)

    Success!

    A bit rambling reply, but I wrote it as I tested.

    EDIT
    It may be possible to allow unicode in TextWindow with an extension.

    http://stackoverflow.com/questions/5750203/how-to-write-unicode-chars-to-console

    EDIT2

    I uploaded a beta version of LitDev extension with this, which works in TextWindow.

    word = "Help"
    translatedword = LDTranslate.Translate(word,"en","ru")
    LDTextWindow.Encoding = "Unicode"
    TextWindow.WriteLine(translatedword)

    Sunday, April 3, 2016 10:55 AM
    Moderator

All replies

  • Hello,

    The MSDN, TechNet and Expression Library Feedback forum is to "Help improve the Library Experience in MSDN, TechNet and Expression by providing feedback on features, bugs, look and feel or by just providing suggestions". This is not a support forum.

    As it's off-topic here, I am moving the question to the Where is the forum for... forum.

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join('6D73646E5F6B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

    Friday, April 1, 2016 1:40 PM
  • Hello,

    If you are asking about the Small Basic LitDev extension, I can move this to the Small Basic forum.

    Otherwise, I'd ask in the Translator Technical Forum on User Voice.

    As the User Voice forums are on a different platform, we cannot move the question for you.

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join('6D73646E5F6B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

    Friday, April 1, 2016 1:52 PM
  • Yes hi, thanks for the replies, yes if you can move this to the small basic forum, do so, it is also about the lit dev extensions. 

    thanks,

    RussianBrain.

    Sunday, April 3, 2016 1:07 AM
  • Hi RussianBrain - glad you got moved to this forum - thanks to those who helped.

    I don't speak russian, but Google translate gives me this translation for "help" -> Помогите.

    Next I run your test program and print the actual characters returned.

    textwindow.WriteLine(LDTranslate.Languages())

    word = TextWindow.Read()

    start:

    translatedword = LDTranslate.Translate(word,"en","ru")

     

    TextWindow.WriteLine(translatedword)

     

    For i = 1 To Text.GetLength(translatedword)

      char = Text.GetSubText(translatedword,i,1)

      TextWindow.WriteLine(char+" : "+Text.GetCharacterCode(char))

    EndFor

    This gives me:

    ? : 1057

    ? : 1087

    ? : 1088

    ? : 1072

    ? : 1074

    ? : 1082

    ? : 1072

    It is 7 characters long, so doesn't seem to be Помогите, but also it is something.

    Using this unicode site:

    1057 is C Cyrillic Capital Letter Es

    1087 is п Cyrillic Small Letter Pe

    1088 is р Cyrillic Small Letter Er

    1072 is a Cyrillic Small Letter A

    1074 is в Cyrillic Small Letter Ve

    1082 is к Cyrillic Small Letter Ka

    1072 is a Cyrillic Small Letter A

    So it looks like a Cyrillic character set, Bing transplator gives me Справка, which matches my translator.

    So it is certainly a Cyrillic unicode translation.  Perhaps TextWindow is limited and cannot handle Cyrillic unicode, so I try using GraphicsWindow.

    textwindow.WriteLine(LDTranslate.Languages())

    word = TextWindow.Read()

    start:

    translatedword = LDTranslate.Translate(word,"en","ru")

     

    GraphicsWindow.DrawText(20,20,translatedword)

    Success!

    A bit rambling reply, but I wrote it as I tested.

    EDIT
    It may be possible to allow unicode in TextWindow with an extension.

    http://stackoverflow.com/questions/5750203/how-to-write-unicode-chars-to-console

    EDIT2

    I uploaded a beta version of LitDev extension with this, which works in TextWindow.

    word = "Help"
    translatedword = LDTranslate.Translate(word,"en","ru")
    LDTextWindow.Encoding = "Unicode"
    TextWindow.WriteLine(translatedword)

    Sunday, April 3, 2016 10:55 AM
    Moderator
  • Thank you Litdev adding  LDTextWindow.Encoding .  but    my PC translate well  XD).

    arr= LDTranslate.Languages()
    translatedword = LDTranslate.Translate(arr,"ja","en") '  Japanes to English
    textwindow.WriteLine(translatedword)
    TextWindow.WriteLine(" ")
    word = " Hi RussianBrain. my PC can translate words from  english to russian. "
    TextWindow.WriteLine(word)
    translatedword = LDTranslate.Translate(word,"en","ru") '  English to  Russian
    TextWindow.WriteLine(translatedword)
    LDClipboard.SetText(translatedword)  '  use this data on google translator
    TextWindow.WriteLine(" ")
    word = "справка"
    translatedword = LDTranslate.Translate(word,"ru","ja") '  to Japanese
    TextWindow.WriteLine(word + " = "+translatedword+ " = Help")

    Left: Russian     Right: English


    Sunday, April 3, 2016 12:43 PM
    Answerer
  • German Umlauts work for my de OS and codepage 1252 (eg. spice <-> Gewürz for en <-> de)

    SBConTrans.exe spice en de
    Gewürz

    SBConTrans.exe Gewürz de en
    Spice

    * Check the active set Codepage from the Commandline with  'chcp /?'  eg.:

    chcp
    Aktive Codepage: 1252.    (here 1252  works for german, default was 850)

    or

    reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage" | FIND /I "OEMCP"

    ' returns   OEMCP    REG_SZ    1252     (for my german OS)

    * To set active Codepage to 65001  (which should work for russian, chinese, greek, arabic) use

    chcp 65001

    This works till next OS restart.

    To set a well working codepage permanently to eg. 65001:

    1. backup regkey 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage'

    and/or rename current OEMCP string (REG_SZ) entry to eg. OEMCP_Orig.

    2. Use a reghack like following .reg file:

    -------------  snip -------------------------

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage]
    "OEMCP"="65001"

    -------------  snap ------------------------


    Sunday, April 3, 2016 1:45 PM
    Answerer
  • lol, we are not that tech savy. so all that looks like chinese to me Lapub. but cool, to all you other people. never new that.

    Matthew

    Friday, April 8, 2016 2:32 AM