Update ooo320-m1
[ooovba.git] / testautomation / graphics / tools / makeLokaleTxt.bas
blobf2e246ac7dfd7b40350d11809c1352daea063385
1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 '*
5 '* Copyright 2008 by Sun Microsystems, Inc.
6 '*
7 '* OpenOffice.org - a multi-platform office productivity suite
8 '*
9 '* $RCSfile: makeLokaleTxt.bas,v $
11 '* $Revision: 1.1 $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 10:43:17 $
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 : wolfram.garten@sun.com
36 '* short description : Graphics: get language dependant strings
38 '\******************************************************************
40 '/// run this script, if you are testing a new language. ///'
41 '/// it will add all relevant strings to the file qatesttool/graphics/tools/locale_1.txt ///'
42 '/// you just have to make sure, that every language only appears once in the file! ///'
44 public glLocale (15*20) as string
45 public S1 as string
46 public S2 as string
47 public S3 as string
48 public S4 as string
50 sub main
51 use "graphics\tools\id_tools.inc"
52 use "graphics\optional\includes\impress\i_slideshow.inc"
53 use "graphics\optional\includes\impress\i_slideshow2.inc"
54 use "graphics\optional\includes\global\g_stylist.inc" 'format -> stylist
55 use "graphics\optional\includes\global\g_spellcheck.inc" 'tools
57 ' GetOLEDefaultNames
59 if hSetLocaleStrings ( gTesttoolPath + "graphics\tools\locale_1.txt" , glLocale () ) = FALSE then
60 warnlog "Locales file doesn't exist: '" + gTesttoolPath + "graphics\tools\locale_1.txt'"
61 endif
63 'Handouts
64 'Slide
65 'Default
66 'English (USA)
67 'Background
68 'German (Germany)
70 printlog "Current saved strings are: "
71 printlog "O 1: " + glLocale (1) 'Handouts ' im_103.inc::tViewWorkspaceHandoutView
72 printlog "O 2: " + glLocale (2) 'Slide ' impress/slideshow.inc::
73 printlog "O 3: " + glLocale (3) 'Default
74 printlog "O 4: " + glLocale (4) 'English (USA)
75 printlog "O 5: " + glLocale (5) 'Background
76 printlog "O 6: " + glLocale (6) 'German (Germany)
78 '/// LOCALE Slide - 2 ///'
79 S1 = glLocale (2) + " 1"
80 S2 = glLocale (2) + " 2"
81 S3 = glLocale (2) + " 3"
82 S4 = glLocale (2) + " 4"
84 printlog "Strings from current office: "
86 '(1)tViewWorkspaceHandoutView
87 hNewDocument
88 ' hUseMenu
89 ' hMenuSelectNr(3)
90 ' hMenuSelectNr(11)
91 ' printlog hMenuItemGetText (4)
92 ' ViewWorkspaceHandoutView '/// view background handout ///'
93 ' sleep 2
94 ' FormatPage
95 sleep 2
96 glLocale (1) = "Dummy" 'Seitenname.GetText
97 Printlog "L1: '" + glLocale (1) + "'"
98 '3 Seitenlayout.Close
99 ' ViewWorkspaceDrawingView '/// back to view background drawing ///'
101 '(2)tSlideShowInteraction/fGetSlideName
102 Kontext "Navigator"
103 if NOT Navigator.exists then
104 hTypeKeys "<SHIFT MOD1 F5>"
105 endif
106 Kontext "NavigatorDraw"
107 if NavigatorDraw.exists (5) then
108 sleep 3
109 glLocale (2) = left(Liste.GetSelText, len(Liste.GetSelText)-2)
110 printlog "L2: '" + glLocale (2) + "'"
111 else
112 warnlog "Navigator not open!"
113 endif
114 Kontext "Navigator"
115 if Navigator.Exists then
116 Navigator.Close
117 endif
119 hCloseDocument
121 '(3)tFormatStylistTemplateSelect 'stylist.inc::tFormatStylistTemplateSelect
122 gApplication = "WRITER"
123 hNewDocument
124 kontext "Gestalter"
125 if NOT Gestalter.Exists then
126 FormatStylesFormatting
127 sleep 1
128 endif
129 glLocale (3) = Vorlagenliste.getSelText ' HID_STYLE_LISTBOX ' get "Default"
130 printlog "L3: '" + glLocale (3) + "'"
131 hCloseDocument
132 gApplication = "IMPRESS"
134 '(4)ASIANONLY tiToolsSpellcheckError
135 ' no need to exclude eurtopean!
136 ' this entry will get English (USA)
137 ' spellbook language as alternative for not existijng asians one
138 ' tiToolsSpellcheckError
139 gApplication = "DRAW"
140 hDateiOeffnen (convertPath(gTesttoolpath + "graphics/required/input/recht_1.sxd"))
141 sleep 5
142 hTypeKeys "<Tab><F2><Mod1 Home><Shift End>"
143 sleep 5
144 FormatCharacter
145 sleep 1
146 Kontext
147 Messagebox.SetPage TabFont
148 kontext "TabFont"
149 sleep 1
151 glLocale (4) = LanguageWest.getSelText
152 printlog "L4: '" + glLocale (4) + "'"
153 catch
154 glLocale (4) = Language.getSelText
155 printlog "L4: '" + glLocale (4) + "'"
156 endcatch
157 TabFont.Ok
158 sleep 5
159 Call hCloseDocument
160 gApplication = "IMPRESS"
162 '(5)tFormatStylistBackground
163 ' stylist only one tabpage area!
164 Dim i as Integer : Dim AlterWert as String : Dim NeuerWert as String : Dim rightentry as Integer : Dim qd as Integer : Dim numberofentries as Integer
165 hNewDocument
167 kontext "DocumentImpress"
168 if iSprache <> "36" then
169 Kontext "Gestalter"
170 if NOT Gestalter.Exists(1) then
171 hTypeKeys "<F11>"
172 Kontext "Gestalter"
173 endif
174 Praesentationsvorlagen.Click
175 sleep (2)
176 for qd = 1 to Vorlagenliste.GetItemCount
177 Kontext "Gestalter"
178 Vorlagenliste.Select qd
179 Vorlagenliste.OpenContextMenu
180 hMenuSelectNr (1)
181 kontext "TabArea"
182 if TabArea.exists then
183 rightentry = qd
184 TabArea.Close
185 else
186 kontext "TabVerwalten"
187 if TabVerwalten.Exists(1) then
188 TabVerwalten.Close
189 endif
190 kontext "TabLinie"
191 if TabLinie.Exists(1) then
192 TabLinie.Close
193 endif
194 kontext "TabSchatten"
195 if TabSchatten.Exists(1) then
196 TabSchatten.Close
197 endif
198 kontext "TabTransparenz"
199 if TabTransparenz.Exists(1) then
200 TabTransparenz.Close
201 endif
202 kontext "TabFont"
203 if TabFont.Exists(1) then
204 TabFont.Close
205 endif
206 kontext "TabFontEffects"
207 if TabFontEffects.Exists(1) then
208 TabFontEffects.Close
209 endif
210 kontext "TabEinzuegeUndAbstaende"
211 if TabEinzuegeUndAbstaende.Exists(1) then
212 TabEinzuegeUndAbstaende.Close
213 endif
214 kontext "TabAusrichtungAbsatz"
215 if TabAusrichtungAbsatz.Exists(1) then
216 TabAusrichtungAbsatz.Close
217 endif
218 kontext "TabTabulator"
219 if TabTabulator.Exists(1) then
220 TabTabulator.Close
221 endif
222 kontext "TabBullet"
223 if TabBullet.Exists(1) then
224 TabBullet.Close
225 endif
226 kontext "TabNumerierungsart"
227 if TabNumerierungsart.Exists(1) then
228 TabNumerierungsart.Close
229 endif
230 kontext "TabGrafiken"
231 if TabGrafiken.Exists(1) then
232 TabGrafiken.Close
233 endif
234 kontext "TabOptionenNumerierung"
235 if TabOptionenNumerierung.Exists(1) then
236 TabOptionenNumerierung.Close
237 endif
238 endif
239 Kontext "Gestalter"
240 next qd
242 dim stringname as string
243 Vorlagenliste.Select rightentry
244 stringname = Vorlagenliste.GetSelText '(1) 'SelText 'MenuGetItemText(MenugetItemid(1)) '8
245 glLocale (5) = stringname ' "dummy" 'right(stringname, len(stringname)-1)
246 printlog "L5: '" + glLocale (5) + "'"
247 endif
249 '(6)
250 ' this entry will get German (Germany)
251 gApplication = "DRAW"
252 hDateiOeffnen (convertPath(gTesttoolpath + "graphics/required/input/recht_49.sxd"))
253 sleep 5
254 hTypeKeys "<Tab><F2><Mod1 Home><Shift End>"
255 sleep 5
256 FormatCharacter
257 sleep 1
258 Kontext
259 Messagebox.SetPage TabFont
260 kontext "TabFont"
261 sleep 1
263 glLocale (6) = LanguageWest.getSelText
264 printlog "L6: '" + glLocale (6) + "'"
265 catch
266 glLocale (6) = Language.getSelText
267 printlog "L6: '" + glLocale (6) + "'"
268 endcatch
269 TabFont.Ok
270 sleep 5
271 Call hCloseDocument
273 gApplication = "IMPRESS"
275 dim lLocale (15*20) as string ' list, where file gets loaded into
276 dim flocale as string
278 flocale = convertPath (gTesttoolPath + "graphics\tools\locale_1.txt")
279 ListRead (lLocale (), fLocale, "UTF8" )
280 ListAppend(lLocale (), iSprache)
281 for i = 1 to 6
282 ListAppend(lLocale (), glLocale (i))
283 next i
284 ListWrite (lLocale (), fLocale, "UTF8" )
286 hCloseDocument
288 end sub
290 sub LoadIncludeFiles
291 use "global\system\includes\master.inc"
292 use "global\system\includes\gvariabl.inc"
293 'use "global\tools\includes\optional\t_ole.inc"
294 gApplication = "IMPRESS"
295 Call GetUseFiles
296 end sub