1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: w_fields7.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:27:37 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : helge.delfs@sun.com
36 '* short description : Fields - L10N test
38 '\***********************************************************************
42 Call tL10NtestAboveBelow
48 '-----------------------------------------------------------------
50 testcase tL10NtestAboveBelow
53 QaErrorLog "Currently no any other language than English. Aborting."
57 Dim sTestFile as String
58 Dim sAbove() as String
59 Dim sBelow() as String
60 Dim iCountry() as Integer
64 Dim sUILanguage as integer, sLocale as integer
65 Dim sCurrency as integer, sWestern as integer, sAsian as integer, sCTL as integer
66 Dim sAsiancb as boolean, sCTLcb as boolean
67 Dim sAsiancbChecked as boolean, sCTLcbChecked as boolean
69 if iSprache <> 01 then
70 QAErrorlog "This is a English-only testcase"
74 ' Get current settings on language tabpage and remember
76 Call hToolsOptions("LANGUAGESETTINGS","LANGUAGES")
77 sUILanguage = UILanguage.GetSelIndex
78 sLocale = Gebietsschema.GetSelIndex
79 sCurrency = StandardWaehrung.GetSelIndex
80 sWestern = Westlich.GetSelIndex
81 if Asiatisch.IsEnabled then sAsian = Asiatisch.GetSelIndex
82 if LanguageComplexScript.IsEnabled then sCTL = LanguageComplexScript.GetSelIndex
83 sAsiancb = Aktivieren.IsEnabled
84 sCTLcb = ComplexScriptEnabled.IsEnabled
85 sAsiancbChecked = Aktivieren.IsChecked
86 sCTLcbChecked = ComplexScriptEnabled.IsChecked
87 Kontext "ExtrasOptionenDlg"
88 ExtrasOptionenDlg.Cancel
91 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\fields\AboveBelow.sxw")
119 iCountry = Array ( 1 , 33 , 34 , 39 , 46 , 49 , _
120 55, 81 , 82 , 86 , 88 )
122 printlog "L10N test - above/below"
123 '/// <b> L10N test - above/below </b>
127 '/// Open test file AboveBelow.sxw
128 Call hFileOpen(sTestFile)
129 Call sMakeReadOnlyDocumentEditable
131 '/// Check if reference above/below is changed after language is changed
135 Call wTypeKeys "<MOD1 Home>"
136 fSetLocale(fGetLanguageName(iCountry(i)))
137 if iCountry(i) < 80 then
138 fSetWestern(fGetLanguageName(iCountry(i)))
142 fSetAsian(fGetLanguageName(iCountry(i)))
145 Call wTypeKeys "<F9>"
146 Call wTypeKeys "<Shift Right>"
147 if fGetFieldContent() <> sBelow(i) then
148 Warnlog "Should get " & sBelow(i) & " but get " & fGetFieldContent()
150 Call wTypeKeys "<MOD1 End>"
151 Call wTypeKeys "<Shift Left>"
152 if fGetFieldContent() <> sAbove(i) then
153 Warnlog i & " - Should get " & sAbove(i) & " but get " & fGetFieldContent()
157 ' set back language tabpage values
159 Call hToolsOptions("LANGUAGESETTINGS","LANGUAGES")
160 UILanguage.Select sUILanguage
161 Gebietsschema.Select sLocale
162 StandardWaehrung.Select sCurrency
163 Westlich.Select sWestern
164 if sAsiancb = true then
165 if sAsiancbChecked = true then Aktivieren.IsChecked
168 if sCTLcb = true then
169 if sCTLcbChecked = true then ComplexScriptEnabled.IsChecked
172 if Asiatisch.IsEnabled and sAsian > 0 then Asiatisch.Select sAsian
173 if LanguageComplexScript.IsEnabled and sCTL > 0 then LanguageComplexScript.Select sCTL
175 Kontext "ExtrasOptionenDlg"
182 '-----------------------------------------------------------------
184 testcase tL10NtestDate
185 if iSprache <> 1 then
186 QaErrorLog "Currently no any other language than English. Aborting."
190 Dim sTestFile as String
191 Dim sDate() as String
192 Dim iCountry() as Integer
195 Dim sUILanguage as integer, sLocale as integer
196 Dim sCurrency as integer, sWestern as integer, sAsian as integer, sCTL as integer
197 Dim sAsiancb as boolean, sCTLcb as boolean
198 Dim sAsiancbChecked as boolean, sCTLcbChecked as boolean
200 if iSprache <> 01 then
201 QAErrorlog "This is a English-only testcase"
205 ' Get current settings on language tabpage and remember
207 Call hToolsOptions("LANGUAGESETTINGS","LANGUAGES")
208 sUILanguage = UILanguage.GetSelIndex
209 sLocale = Gebietsschema.GetSelIndex
210 sCurrency = StandardWaehrung.GetSelIndex
211 sWestern = Westlich.GetSelIndex
212 if Asiatisch.IsEnabled then sAsian = Asiatisch.GetSelIndex
213 if LanguageComplexScript.IsEnabled then sCTL = LanguageComplexScript.GetSelIndex
214 sAsiancb = Aktivieren.IsEnabled
215 sCTLcb = ComplexScriptEnabled.IsEnabled
216 sAsiancbChecked = Aktivieren.IsChecked
217 sCTLcbChecked = ComplexScriptEnabled.IsChecked
218 Kontext "ExtrasOptionenDlg"
219 ExtrasOptionenDlg.Cancel
222 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\fields\Date.sxw")
225 "Tuesday, August 3, 2004" , _
226 "mardi 3 août 2004" , _
227 "martes, 3 de agosto de 2004" , _
228 "martedì 3 agosto 2004" , _
229 "tisdag 3 augusti 2004" , _
230 "Dienstag, 3. August 2004" , _
231 "Terça-feira, 3 de Agosto de 2004" , _
235 "中華民國93年8月3日 星期二" , _
237 iCountry = Array ( 1 , 33 , 34 , 39 , 46 , 49 , _
238 55, 81 , 82 , 86 , 88 )
240 printlog "L10N test - Date"
241 '/// <b> L10N test - Date </b>
245 '/// Open test file Date.sxw
246 Call hFileOpen(sTestFile)
247 Call sMakeReadOnlyDocumentEditable
249 '/// Check if Date is changed after language is changed
252 Call wTypeKeys "<MOD1 Home>"
253 fSetLocale(fGetLanguageName(iCountry(i)))
254 if iCountry(i) < 80 then
255 fSetWestern(fGetLanguageName(iCountry(i)))
259 fSetAsian(fGetLanguageName(iCountry(i)))
262 Call wTypeKeys "<F9>"
263 Call wTypeKeys "<Shift Right>"
264 if fGetFieldContent() <> sDate(i) then
265 Warnlog i & " - Should get " & sDate(i) & " but get " & fGetFieldContent()
269 ' set back language tabpage values
271 Call hToolsOptions("LANGUAGESETTINGS","LANGUAGES")
272 UILanguage.Select sUILanguage
273 Gebietsschema.Select sLocale
274 StandardWaehrung.Select sCurrency
275 Westlich.Select sWestern
276 if sAsiancb = true then
277 if sAsiancbChecked = true then Aktivieren.IsChecked
280 if sCTLcb = true then
281 if sCTLcbChecked = true then ComplexScriptEnabled.IsChecked
284 if Asiatisch.IsEnabled and sAsian > 0 then Asiatisch.Select sAsian
285 if LanguageComplexScript.IsEnabled and sCTL > 0 then LanguageComplexScript.Select sCTL
287 Kontext "ExtrasOptionenDlg"
294 '-----------------------------------------------------------------
296 testcase tL10NtestTime
297 if iSprache <> 1 then
298 QaErrorLog "Currently no any other language than English. Aborting."
302 Dim sTestFile as String
303 Dim sTime() as String
304 Dim iCountry() as Integer
308 Dim sUILanguage as integer, sLocale as integer
309 Dim sCurrency as integer, sWestern as integer, sAsian as integer, sCTL as integer
310 Dim sAsiancb as boolean, sCTLcb as boolean
311 Dim sAsiancbChecked as boolean, sCTLcbChecked as boolean
313 if iSprache <> 01 then
314 QAErrorlog "This is a English-only testcase"
318 ' Get current settings on language tabpage and remember
320 Call hToolsOptions("LANGUAGESETTINGS","LANGUAGES")
321 sUILanguage = UILanguage.GetSelIndex
322 sLocale = Gebietsschema.GetSelIndex
323 sCurrency = StandardWaehrung.GetSelIndex
324 sWestern = Westlich.GetSelIndex
325 if Asiatisch.IsEnabled then sAsian = Asiatisch.GetSelIndex
326 if LanguageComplexScript.IsEnabled then sCTL = LanguageComplexScript.GetSelIndex
327 sAsiancb = Aktivieren.IsEnabled
328 sCTLcb = ComplexScriptEnabled.IsEnabled
329 sAsiancbChecked = Aktivieren.IsChecked
330 sCTLcbChecked = ComplexScriptEnabled.IsChecked
331 Kontext "ExtrasOptionenDlg"
332 ExtrasOptionenDlg.Cancel
335 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\fields\Time.sxw")
343 "04:46:08 nachm." , _
350 iCountry = Array ( 1 , 33 , 34 , 39 , 46 , 49 , _
351 55, 81 , 82 , 86 , 88 )
353 printlog "L10N test - time"
354 '/// <b> L10N test - time </b>
358 '/// Open test file Time.sxw
359 Call hFileOpen(sTestFile)
360 Call sMakeReadOnlyDocumentEditable
362 '/// Check if time is changed after language is changed
365 Call wTypeKeys "<MOD1 Home>"
366 fSetLocale(fGetLanguageName(iCountry(i)))
367 if iCountry(i) < 80 then
368 fSetWestern(fGetLanguageName(iCountry(i)))
372 fSetAsian(fGetLanguageName(iCountry(i)))
375 Call wTypeKeys "<F9>"
376 Call wTypeKeys "<Shift Right>"
377 if fGetFieldContent() <> sTime(i) then
378 Warnlog i & " - Should get " & sTime(i) & " but get " & fGetFieldContent()
382 ' set back language tabpage values
384 Call hToolsOptions("LANGUAGESETTINGS","LANGUAGES")
385 UILanguage.Select sUILanguage
386 Gebietsschema.Select sLocale
387 StandardWaehrung.Select sCurrency
388 Westlich.Select sWestern
389 if sAsiancb = true then
390 if sAsiancbChecked = true then Aktivieren.IsChecked
393 if sCTLcb = true then
394 if sCTLcbChecked = true then ComplexScriptEnabled.IsChecked
397 if Asiatisch.IsEnabled and sAsian > 0 then Asiatisch.Select sAsian
398 if LanguageComplexScript.IsEnabled and sCTL > 0 then LanguageComplexScript.Select sCTL
400 Kontext "ExtrasOptionenDlg"
407 '-----------------------------------------------------------------