By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,773 Members | 2,583 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,773 IT Pros & Developers. It's quick & easy.

Translate into Cyrillic Script

PhilOfWalton
Expert 100+
P: 1,430
I am trying to translate all the captions on form labels from German to Russian

This code works for say German to French, because French is in Latin Script.

Expand|Select|Wrap|Line Numbers
  1. Function Translate(InputStr, OutLanguage As String, Optional InLanguage As String) As String
  2. '? Translate("Liste ‹bersetzer", "ru", "de")  DOES NOT WORK
  3. '? Translate("Liste ‹bersetzer", "fr", "de")  WORKS
  4.  
  5.     Dim IE As Object, i As Long
  6.     Dim OutputStr As String
  7.  
  8.     On Error GoTo Translate_Err
  9.  
  10. Translate_Start:
  11.     Set IE = CreateObject("InternetExplorer.Application")
  12.  
  13.     ' TO CHOOSE INPUT LANGUAGE
  14.     If Nz(InLanguage) = "" Then
  15.         InLanguage = "auto"
  16.     End If
  17.  
  18.     'Open website
  19.     IE.Visible = False
  20.     IE.Navigate "http://translate.google.com/#" & InLanguage & "/" & OutLanguage & "/" & InputStr
  21.  
  22.     Do Until IE.ReadyState = 4
  23.         apWait 0.05, False                      '  Wait half .05 seconds
  24.         DoEvents
  25.     Loop
  26.  
  27.     OutputStr = Replace(IE.Document.getElementById("result_box").innerHTML, "<span>", "")   ' Get rid of the HTML "<span>"
  28.     OutputStr = Replace(OutputStr, "</span>", "")                                           ' Get rid of the HTML "</span>"
  29.  
  30.     IE.Quit
  31.     Translate = OutputStr
  32.  
  33. Translate_Exit:
  34.     Exit Function
  35.  
  36. Translate_Err:
  37. Stop
  38.     If Err = 1234 Then                      ' To be sorted ibn case website crashes
  39.         Resume Translate_Start
  40.     Else
  41.         MsgBox Err & "   " & Err.Description
  42.     End If
  43.  
  44. End Function
  45.  
  46. Function apWait(ByVal SecondsToWait As Single, Hrglass As Boolean)
  47. ' Waits n seconds (or fraction)
  48.  
  49.     Dim SngStart As Single
  50.  
  51.     If Hrglass = True Then
  52.         DoCmd.Hourglass True        'Change cursor
  53.     End If
  54.  
  55.     SngStart = Timer                ' Set start time.
  56.     Do While Timer < SngStart + (SecondsToWait)
  57.         DoEvents                    ' Yield to other processes.
  58.     Loop
  59.  
  60.     DoCmd.Hourglass False
  61.  
  62. End Function
  63.  
However, when I try the Russian version I just get ?????????

If I paste
Expand|Select|Wrap|Line Numbers
  1. http://translate.google.com/#de/ru/Liste ‹bersetzer
  2.  
directly into Google, I get the (presumably) correct Russian translation Список переводчиков

Any ideas please

Phil
Aug 25 '17 #1
Share this Question
Share on Google+
1 Reply


PhilOfWalton
Expert 100+
P: 1,430
I should add that I have enabled Russian in the Windows Language options.

I have created a table that holds the label Captions in different languages, and if I past the Russian Translation into the table it shows up correctly in Cyrillic.

Phil
Aug 25 '17 #2

Post your reply

Sign in to post your reply or Sign up for a free account.