terça-feira, 25 de novembro de 2008

OpenOffice.org/qa/qatesttool/writer/level1/inc/chinesetranslate/w_chinesetranslate1.inc

OpenOffice.org/qa/qatesttool/writer/level1/inc/chinesetranslate/w_chinesetranslate1.inc


The LXR Cross Referencer

[ source navigation ]
[ diff markup ]
[ identifier search ]
[ general search ]
Architecture: [ i386 ]
Version: [ HEAD ]

001 'encoding UTF-8  Do not remove or change this line!
002 '*************************************************************************
003 '*
004 '* OpenOffice.org - a multi-platform office productivity suite
005 '*
006 '* $RCSfile: w_chinesetranslate1.inc,v $
007 '*
008 '* $Revision: 1.5 $
009 '*
010 '* last change: $Author: tbo $ $Date: 2005/09/27 15:21:35 $
011 '*
012 '* The Contents of this file are made available subject to
013 '* the terms of GNU Lesser General Public License Version 2.1.
014 '*
015 '*
016 '* GNU Lesser General Public License Version 2.1
017 '* =============================================
018 '* Copyright 2005 by Sun Microsystems, Inc.
019 '* 901 San Antonio Road, Palo Alto, CA 94303, USA
020 '*
021 '* This library is free software; you can redistribute it and/or
022 '* modify it under the terms of the GNU Lesser General Public
023 '* License version 2.1, as published by the Free Software Foundation.
024 '*
025 '* This library is distributed in the hope that it will be useful,
026 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
027 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
028 '* Lesser General Public License for more details.
029 '*
030 '* You should have received a copy of the GNU Lesser General Public
031 '* License along with this library; if not, write to the Free Software
032 '* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
033 '* MA 02111-1307 USA
034 '*
035 '/************************************************************************
036 '*
037 '* owner : helge.delfs@sun.com
038 '*
039 '* short description : Chinese Translation test
040 '*
041 '************************************************************************
042 '*
043 ' #1 tDefaultSetting_1 'Default settings for different Chinese language
044 ' #1 tDefaultSetting_2 'Default settings
045 ' #1 tDefaultSetting_3 'Cursor's position
046 ' #1 tChineseTranslate_1 'Translation for selected text
047 ' #1 tChineseTranslate_2 'Translation for NO-selected document
048 ' #1 tChineseTranslate_3 'Translation direction : T Chinese to S Chinese
049 ' #1 tChineseTranslate_4 'Translation direction : S Chinese to T Chinese
050 ' #1 tChineseTranslate_5 ''Use Taiwan , Hongkong SAR...'s statue
051 ' #0 fSetAsian
052 '*
053 '\***********************************************************************
054
055 testcase tDefaultSetting_1
056
057 printlog "Default settings for different Chinese language"
058 '/// Default settings for different Chinese language
059
060 Call hNewDocument
061
062 '/// Set default language(asian) for document is "Simplified Chinese"
063 fSetAsian(fGetLanguageName(86))
064
065 '/// Tools/language / Chinese translation
066 ToolsLanguageChineseTranslation
067 Kontext "ChineseTranslation"
068
069 '/// "Traditional Chinese to Simplified Chinese" should be Checked by default
070 if NOT TChineseToSChinese.IsChecked then
071 Warnlog "'Traditional Chinese to Simplified Chinese' should be Checked by default !"
072 end if
073 ChineseTranslation.Cancel
074
075 '/// Set default language(asian) for document is "Traditional Chinese"
076 fSetAsian(fGetLanguageName(88))
077
078 '/// Tools/language / Chinese translation
079 ToolsLanguageChineseTranslation
080 Kontext "ChineseTranslation"
081
082 '/// "Simplified Chinese to Traditional Chinese" should be Checked by default
083 if NOT SChineseToTChinese.IsChecked then
084 Warnlog "'Simplified Chinese to Traditional Chinese' should be Checked by default !"
085 end if
086 ChineseTranslation.Cancel
087
088 Call hCloseDocument
089
090 endcase
091
092 '-----------------------------------------------------------------
093
094 testcase tDefaultSetting_2
095
096 printlog "Default settings "
097 '/// Default settings
098
099 Call hNewDocument
100
101 fSetAsian(fGetLanguageName(86))
102
103 '/// Tools/language / Chinese translation
104 ToolsLanguageChineseTranslation
105 Kontext "ChineseTranslation"
106
107 ' '/// "Use Taiwan,Hongkong SAR , and Macao SAR character variants"
108 ' '/// + should NOT be Checked by default
109 ' if UseSARCharacter.IsChecked then
110 ' Warnlog "'Use Taiwan,Hongkong SAR , and Macao SAR character variants' should NOT be Checked by default !"
111 ' end if
112
113 '/// "Common Terms" should NOT be Checked by default
114 if TranslateCommonTerms.IsChecked then
115 Warnlog "'Common Terms' should NOT be Checked by default !"
116 end if
117
118 '/// Click 'Edit terms' button
119 EditTerms.Click
120 Kontext "ChineseDictionary"
121
122 '/// "Traditional Chinese to Simplified Chinese" should be Checked by default
123 if NOT TChineseToSChinese.IsChecked then
124 Warnlog "'Traditional Chinese to Simplified Chinese' should be Checked by default !"
125 end if
126
127 '/// "Reverse mapping" should NOT be Checked by default
128 if ReverseMapping.IsChecked then
129 Warnlog "'Reverse mapping' should NOT be Checked by default !"
130 end if
131
132 '/// "Property" should be "other" by default
133 if Property.GetSelIndex <> 1 then
134 Warnlog "'Property' should be 'Other' by default !"
135 end if
136 ChineseDictionary.Cancel
137
138 Kontext "ChineseTranslation"
139 ChineseTranslation.Cancel
140
141 Call hCloseDocument
142
143 endcase
144
145 '-----------------------------------------------------------------
146
147 testcase tDefaultSetting_3
148
149 Dim sChinese , sExpect as String
150
151 sChinese = "红上蓝国"
152 sExpect = "ç´…"
153
154 printlog "Cursor position"
155 '/// Cursor position
156
157 Call hNewDocument
158
159 fSetAsian(fGetLanguageName(86))
160
161 '/// Input some chinese and set cursor in the beginning
162 Call wDokSchreiben sChinese
163 Call wDokSchreiben ""
164
165 '/// Tools/language / Chinese translation , check
166 '/// + "Simplified Chinese to Traditional Chinese" , press OK
167 ToolsLanguageChineseTranslation
168 Kontext "ChineseTranslation"
169 SChineseToTChinese.Check
170 ChineseTranslation.OK
171
172 '/// Check if the cursor's position is changed -- Should NOT
173 Call wDokSchreiben ""
174 try
175 EditCopy
176 if GetClipboardText <> sExpect then
177 Warnlog "Hope to get " & sExpect & " but get " & GetClipboardText
178 end if
179 catch
180 Warnlog "Cursor's position is changed - 117787"
181 endcatch
182
183 Call hCloseDocument
184
185 endcase
186
187 '-----------------------------------------------------------------
188
189 testcase tChineseTranslate_1
190
191 Dim sChinese , sExpect as String
192
193 sChinese = "红上蓝国"
194 sExpect = "紅上蓝国"
195
196 printlog "Translation for selected text"
197 '/// Translation for selected text
198
199 Call hNewDocument
200
201 fSetAsian(fGetLanguageName(86))
202
203 '/// Input some chinese and select part of input
204 Call wDokSchreiben sChinese
205 Call wDokSchreiben ""
206 Call wDokSchreiben "" , 2
207
208 '/// Tools/language / Chinese translation , check
209 '/// + "Simplified Chinese to Traditional Chinese" , press OK
210 ToolsLanguageChineseTranslation
211 Kontext "ChineseTranslation"
212 SChineseToTChinese.Check
213 ChineseTranslation.OK
214
215 '/// Check if the only selected text is translated -- Should
216 Call wDokSchreiben ""
217 Call wDokSchreiben ""
218 EditCopy
219 if GetClipboardText <> sExpect then
220 Warnlog "Hope to get " & sExpect & " but get " & GetClipboardText
221 end if
222
223 Call hCloseDocument
224
225 endcase
226
227 '-----------------------------------------------------------------
228
229 testcase tChineseTranslate_2
230
231 Dim sChinese , sExpect as String
232
233 sChinese = "红上蓝国"
234 sExpect = "紅上藍國"
235
236 printlog "Translation for NO-selected document"
237 '/// Translation for NO-selected document
238
239 Call hNewDocument
240
241 fSetAsian(fGetLanguageName(86))
242
243 '/// Input some chinese
244 Call wDokSchreiben sChinese
245
246 '/// Tools/language / Chinese translation , check
247 '/// + "Simplified Chinese to Traditional Chinese" , press OK
248 ToolsLanguageChineseTranslation
249 Kontext "ChineseTranslation"
250 SChineseToTChinese.Check
251 ChineseTranslation.OK
252
253 '/// Check if all document is translated -- Should
254 Call wDokSchreiben ""
255 Call wDokSchreiben ""
256 EditCopy
257 if GetClipboardText <> sExpect then
258 Warnlog "Hope to get " & sExpect & " but get " & GetClipboardText
259 end if
260
261 Call hCloseDocument
262
263 endcase
264
265 '-----------------------------------------------------------------
266
267 testcase tChineseTranslate_3
268
269 Dim sChinese , sExpect as String
270
271 sChinese = "红上藍國"
272 sExpect = "红上蓝国"
273
274 printlog "Translation direction : T Chinese to S Chinese"
275 '/// Translation direction : T Chinese to S Chinese
276
277 Call hNewDocument
278
279 fSetAsian(fGetLanguageName(88))
280
281 '/// Input some chinese , include some
282 '/// + tradition chinese and simplified chinese
283 Call wDokSchreiben sChinese
284
285 '/// Tools/language / Chinese translation , check
286 '/// + "Traditional Chinese to Simplified Chinese" , press OK
287 ToolsLanguageChineseTranslation
288 Kontext "ChineseTranslation"
289 TChineseToSChinese.Check
290 ChineseTranslation.OK
291
292 '/// Check if only traditional chinese is translated -- Should
293 Call wDokSchreiben ""
294 Call wDokSchreiben ""
295 EditCopy
296 if GetClipboardText <> sExpect then
297 Warnlog "Hope to get " & sExpect & " but get " & GetClipboardText
298 end if
299
300 Call hCloseDocument
301
302 endcase
303
304 '-----------------------------------------------------------------
305
306 testcase tChineseTranslate_4
307
308 Dim sChinese , sExpect as String
309
310 sChinese = "红上藍國"
311 sExpect = "紅上藍國"
312
313 printlog "Translation direction : S Chinese to T Chinese"
314 '/// Translation direction : S Chinese to T Chinese
315
316 Call hNewDocument
317
318 fSetAsian(fGetLanguageName(86))
319
320 '/// Input some chinese , include some
321 '/// + tradition chinese and simplified chinese
322 Call wDokSchreiben sChinese
323
324 '/// Tools/language / Chinese translation , check
325 '/// + "Simplified Chinese to Traditional Chinese" , press OK
326 ToolsLanguageChineseTranslation
327 Kontext "ChineseTranslation"
328 SChineseToTChinese.Check
329 ChineseTranslation.OK
330
331 '/// Check if only simplified chinese is translated -- Should
332 Call wDokSchreiben ""
333 Call wDokSchreiben ""
334 EditCopy
335 if GetClipboardText <> sExpect then
336 Warnlog "Hope to get " & sExpect & " but get " & GetClipboardText
337 end if
338
339 Call hCloseDocument
340
341 endcase
342
343 '-----------------------------------------------------------------
344
345 testcase tChineseTranslate_5
346
347 printlog "'Use Taiwan , Hongkong SAR...'s statue"
348 '/// 'Use Taiwan , Hongkong SAR...'s statue
349
350 Call hNewDocument
351
352 fSetAsian(fGetLanguageName(88))
353
354 '/// Tools/language / Chinese translation ,
355 '/// Check "Traditional Chinese to Simplified Chinese"
356 '/// + "Use Taiwan , Hongkong SAR..." should be disable
357 ToolsLanguageChineseTranslation
358 Kontext "ChineseTranslation"
359 TChineseToSChinese.Check
360 try
361 UseSARCharacter.Check
362 Warnlog "'Use Taiwan , Hongkong SAR and ...' should be disable !"
363 catch
364 endcatch
365
366 '/// Check "Simplified Chinese to Traditional Chinese"
367 '/// + "Use Taiwan , Hongkong SAR..." should be enabled
368 SChineseToTChinese.Check
369 try
370 UseSARCharacter.Check
371 catch
372 Warnlog "'Use Taiwan , Hongkong SAR and ...' should be enabled !"
373 endcatch
374
375 '/// UnCheck "Use Taiwan , Hongkong SAR..."
376 UseSARCharacter.UnCheck
377
378 '/// Check "Translate Common Terms"
379 TranslateCommonTerms.Check
380
381 '/// "Use Taiwan , Hongkong SAR..." should be checked automatically
382 if NOT UseSARCharacter.IsChecked then
383 Warnlog "'Use Taiwan , Hongkong SAR and ...' should be checked !"
384 end if
385 ChineseTranslation.OK
386
387 '/// Close the dialog and reopen it
388 '/// "Use Taiwan , Hongkong SAR..." and "Translate Common Terms"
389 '/// + should be checked
390 ToolsLanguageChineseTranslation
391 Kontext "ChineseTranslation"
392 if NOT UseSARCharacter.IsChecked then
393 Warnlog "'Use Taiwan , Hongkong SAR and ...' should be checked ! - 117802 "
394 end if
395 if NOT TranslateCommonTerms.IsChecked then
396 Warnlog "'Translate common terms' should be checked ! - 117802 "
397 end if
398 ChineseTranslation.Cancel
399
400 Call hCloseDocument
401
402 endcase
403
404 '-----------------------------------------------------------------
405
406 function fSetAsian(sAsian as String) as String
407
408 'This function is set CJK language in Tools/Options/Language Settings / Languages
409 ToolsOptions
410 Call hToolsOptions("LANGUAGESETTINGS","LANGUAGES")
411 fSetAsian = Asiatisch.GetSelText
412 if sAsian = "Null" then
413 Asiatisch.Select 1
414 goto GoON
415 else
416 Asiatisch.Select sAsian
417 end if
418
419 GoON:
420 Kontext "ExtrasOptionenDlg"
421 ExtrasOptionenDlg.OK
422
423 end function
424

[ source navigation ] [ diff markup ] [ identifier search ] [ general search ]

This page was automatically generated by the LXR engine.
The LXR team
Valid HTML 4.01!

Nenhum comentário: