Index: trunk/testing/installer/settings_handler.py |
— | — | @@ -72,6 +72,11 @@ |
73 | 73 | |
74 | 74 | dbname_prefix="" |
75 | 75 | |
| 76 | + |
| 77 | +# default language code for the wiki. |
| 78 | + |
| 79 | +wgLanguageCode="en" |
| 80 | + |
76 | 81 | # what mysql commands should be used. (Who us? Use horrible hacks?) |
77 | 82 | |
78 | 83 | userpart="" |
Index: trunk/testing/installer/installation_system.py |
— | — | @@ -32,6 +32,7 @@ |
33 | 33 | self.as_alias=None |
34 | 34 | self.revision=None |
35 | 35 | self.tag=None |
| 36 | + self.language=None |
36 | 37 | if instance: |
37 | 38 | self.set_instance(instance) |
38 | 39 | |
Index: trunk/testing/installer/LocalSettings.php |
— | — | @@ -101,8 +101,6 @@ |
102 | 102 | |
103 | 103 | $wgLocalInterwiki = $wgSitename; |
104 | 104 | |
105 | | -$wgLanguageCode = "en"; |
106 | | - |
107 | 105 | $wgProxyKey = "eeedfbcf7f4e6238a2db7959e50e5e19d0e0c1a6500dbfaa5d38f6dabe801c76"; |
108 | 106 | |
109 | 107 | ## Default skin: you can change the default skin. Use the internal symbolic |
Index: trunk/testing/installer/installers.py |
— | — | @@ -205,6 +205,8 @@ |
206 | 206 | system.revision=ppath["revision"] |
207 | 207 | if ppath["tag"]: |
208 | 208 | system.tag=ppath["tag"] |
| 209 | + if ppath["language"]: |
| 210 | + system.language=ppath["language"] |
209 | 211 | |
210 | 212 | try: |
211 | 213 | success=system.install(ppath["installer"]) |
— | — | @@ -294,18 +296,18 @@ |
295 | 297 | """parses a path of the form |
296 | 298 | [ai.][system:]installer [in iii] [as aaa] [revision rrr] [tag ttt] [limit n] |
297 | 299 | |
298 | | - where: |
299 | | - ai:=<available|installed|revisions|tags> |
300 | | - system:=< (see the systems constant, defined near end of file) > |
301 | | - installer is some name of a script to install an item or the item name to be installed (depends on system) |
302 | | - in where to install things *in* (typically used with the extension installer) |
303 | | - as give something a name or alias |
304 | | - install mediawiki:REL1_13_3 as my_mediawiki_example |
305 | | - creates a new mediawiki instance (release 1.13.3) with the name my_mediawiki_example |
306 | | - revision use a particular (svn) revision number |
307 | | - tag use a particular (svn) tag |
308 | | - limit n limits output to at most n items (analogous to the sql command of same name) (useful with ls) |
309 | | - """ |
| 300 | + where: |
| 301 | + ai:=<available|installed|revisions|tags> |
| 302 | + system:=< (see the systems constant, defined near end of file) > |
| 303 | + installer is some name of a script to install an item or the item name to be installed (depends on system) |
| 304 | + in where to install things *in* (typically used with the extension installer) |
| 305 | + as give something a name or alias |
| 306 | + install mediawiki:REL1_13_3 as my_mediawiki_example |
| 307 | + creates a new mediawiki instance (release 1.13.3) with the name my_mediawiki_example |
| 308 | + revision use a particular (svn) revision number |
| 309 | + tag use a particular (svn) tag |
| 310 | + limit n limits output to at most n items (analogous to the sql command of same name) (useful with ls) |
| 311 | + """ |
310 | 312 | |
311 | 313 | ai=None # available, installed (and now revisions and tags and test too) |
312 | 314 | system=None # installation system |
— | — | @@ -315,6 +317,7 @@ |
316 | 318 | revision=None # revision number, if any |
317 | 319 | tag=None # tag, if any |
318 | 320 | limit=None # limit output from list commands to n lines. |
| 321 | + language=None # default language code for wikis |
319 | 322 | |
320 | 323 | #partial components |
321 | 324 | whence=None # eg. 'available.mediawiki:' |
— | — | @@ -364,7 +367,7 @@ |
365 | 368 | # right side (inpath) :_______________ |
366 | 369 | if inpath: |
367 | 370 | l=inpath.split() |
368 | | - if l[0] not in ['in', 'as', 'revision', 'tag','limit']: |
| 371 | + if l[0] not in ['in', 'as', 'revision', 'tag','limit','language']: |
369 | 372 | installer=l[0] |
370 | 373 | |
371 | 374 | in_installer=_ppath_find(l,"in") |
— | — | @@ -375,6 +378,7 @@ |
376 | 379 | limit=int(_ppath_find(l,'limit')) |
377 | 380 | except Exception: |
378 | 381 | pass |
| 382 | + language=_ppath_find(l,'language') |
379 | 383 | |
380 | 384 | # Ok, we have our basic return value now |
381 | 385 | ppath={ |
— | — | @@ -385,7 +389,8 @@ |
386 | 390 | "as_alias":as_alias, |
387 | 391 | "revision":revision, |
388 | 392 | "tag":tag, |
389 | | - "limit":limit} |
| 393 | + "limit":limit, |
| 394 | + "language":language} |
390 | 395 | |
391 | 396 | # maybe we can assume some useful defaults (saves typing) |
392 | 397 | if defaults: |
Index: trunk/testing/installer/mediawiki_installer.py |
— | — | @@ -86,7 +86,7 @@ |
87 | 87 | |
88 | 88 | name=as_alias or self.as_alias or installer_name |
89 | 89 | |
90 | | - install(installer_name, name, self.revision) |
| 90 | + install(installer_name, name, self.revision, self.language) |
91 | 91 | return self.is_installed(name) |
92 | 92 | |
93 | 93 | #download is unused, but leave for future expansion |
— | — | @@ -178,7 +178,7 @@ |
179 | 179 | |
180 | 180 | |
181 | 181 | |
182 | | -def install(target, option_as, revision): |
| 182 | +def install(target, option_as, revision, language=None): |
183 | 183 | """implement install command. Installs a mediawiki version""" |
184 | 184 | target=clean_target(target) |
185 | 185 | |
— | — | @@ -210,7 +210,7 @@ |
211 | 211 | |
212 | 212 | print "Copying LocalSettings.php,creating unique settings..." |
213 | 213 | localsettings(name) |
214 | | - uniquesettings(name) |
| 214 | + uniquesettings(name,language) |
215 | 215 | print "Copy logo..." |
216 | 216 | logo(name) |
217 | 217 | print "Setting up database..." |
— | — | @@ -275,13 +275,17 @@ |
276 | 276 | subdir=os.path.join(settings.instancesdir,target,"LocalSettings") |
277 | 277 | os.mkdir(subdir) |
278 | 278 | |
279 | | -def uniquesettings(target): |
| 279 | +def uniquesettings(target,language=None): |
| 280 | + """Set up settings that are unique to one particular wiki (in the file InstallerUniqueSettings.php)""" |
280 | 281 | uniquesettings=settings.instancesdir+"/"+target+"/InstallerUniqueSettings.php" |
281 | 282 | unique=file(uniquesettings,"w") |
282 | 283 | unique.write('<?php\n') |
283 | 284 | unique.write('$wgSitename = "'+target+'";\n') |
284 | 285 | unique.write('$wgScriptPath = "'+settings.base_scriptpath+target+'";\n') |
285 | 286 | unique.write('$wgDBname = "'+dbname(target)+'";\n') |
| 287 | + |
| 288 | + use_language=language or settings.wgLanguageCode |
| 289 | + unique.write('$wgLanguageCode = "'+use_language+'";\n'); |
286 | 290 | unique.write('?>\n') |
287 | 291 | |
288 | 292 | unique.close() |