02-26-2016, 10:37 PM
Hi all. I'm hoping somebody out there can be of some help to me.
I'm trying to enhance my existing scripts, which were written and work in English, to work with Simplified Chinese. The scripts are used to create a basic case and the only pieces that need to be translated is the drop down values. The lists do not have all of the same values and sort order for each language. So, for example, the English list could have A, B, C, and D and the Chinese list could have B, C, F, and G. We have been able to successfully adapt and run these scripts in Spanish, French, German, and Italian.
The method we have used for the other languages is to store all of the values in a local CSV file and do a lookup in the file of the English word when a translation is needed. Below is the code on how we declare in the CSV file and a snip of a row in the CSV file.
My problem is when the Chinese values are read into UFT (v12.02) from the CSV file, they do not match; therefore, no value is selected. In the CSV file snippet, you can see the characters for China are displayed as "中国" but "涓浗" is what I see in UFT.
Anybody have any thoughts?
Thanks,
Harry
I'm trying to enhance my existing scripts, which were written and work in English, to work with Simplified Chinese. The scripts are used to create a basic case and the only pieces that need to be translated is the drop down values. The lists do not have all of the same values and sort order for each language. So, for example, the English list could have A, B, C, and D and the Chinese list could have B, C, F, and G. We have been able to successfully adapt and run these scripts in Spanish, French, German, and Italian.
The method we have used for the other languages is to store all of the values in a local CSV file and do a lookup in the file of the English word when a translation is needed. Below is the code on how we declare in the CSV file and a snip of a row in the CSV file.
My problem is when the Chinese values are read into UFT (v12.02) from the CSV file, they do not match; therefore, no value is selected. In the CSV file snippet, you can see the characters for China are displayed as "中国" but "涓浗" is what I see in UFT.
Anybody have any thoughts?
Thanks,
Harry
Code:
' Define connection and recordset and read table
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
strPathtoTextFile = "D:\UPSData\QTP\Input Data\"
strFileName = "ECM_LOV_TranslationDecode.csv"
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strPathtoTextFile & ";" & _
"Extended Properties=""text;HDR=YES;FMT=Delimited"""
Code:
COUNTRY,Country,CN,China,China,Cina,Chine,China,中国,