Merge lp:~alexharrington/xibo/1.1-fix-translations into lp:~dangarner/xibo/translate-xibo

Proposed by Alex Harrington
Status: Merged
Approved by: Dan Garner
Approved revision: 53
Merged at revision: not available
Proposed branch: lp:~alexharrington/xibo/1.1-fix-translations
Merge into: lp:~dangarner/xibo/translate-xibo
Diff against target: None lines
To merge this branch: bzr merge lp:~alexharrington/xibo/1.1-fix-translations
Reviewer Review Type Date Requested Status
Dan Garner Approve
Review via email: mp+5905@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Dan Garner (dangarner) wrote :

Looks fine to me, will merge

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'server/config/config.class.php'
2--- server/config/config.class.php 2009-04-05 19:44:26 +0000
3+++ server/config/config.class.php 2009-04-26 15:11:53 +0000
4@@ -120,182 +120,149 @@
5 $output .= '<div class="checks">';
6
7 // Check for PHP version
8- $message = 'PHP Version 5.0.2 or later';
9+ $message = __('PHP Version 5.0.2 or later');
10
11 if ($this->CheckPHP())
12 {
13- $output .= $imgGood.$message.'<br />';
14+ $output .= $imgGood.' '.$message.'<br />';
15 }
16 else
17 {
18 $this->envFault = true;
19
20- $output .= $imgBad.$message.'<br />';
21- $output .= <<<END
22- <div class="check_explain">
23- <p>Xibo requires PHP version 5.0.2 or later.</p>
24- </div>
25-END;
26+ $output .= $imgBad.' '.$message.'<br />';
27+ $output .= '<div class="check_explain"> <p>' . __("Xibo requires PHP version 5.0.2 or later.") . '</p></div>';
28 }
29
30 // Check for file system permissions
31- $message = 'Filesystem Permissions';
32+ $message = __('Filesystem Permissions');
33
34 if ($this->CheckFsPermissions())
35 {
36- $output .= $imgGood.$message.'<br />';
37+ $output .= $imgGood.' '.$message.'<br />';
38 }
39 else
40 {
41 $this->envFault = true;
42
43- $output .= $imgBad.$message.'<br />';
44+ $output .= $imgBad.' '.$message.'<br />';
45+ $output .= '<div class="check_explain"><p>' . __("Xibo needs to be able to write to the following:");
46 $output .= <<<END
47- <div class="check_explain">
48- <p>Xibo needs to be able to write to the following
49 <ul>
50 <li> settings.php
51 <li> install.php
52- <li> upgrade.php
53+ <li> upgrade.php
54 </ul>
55- Please fix this, and retest.</p>
56- </div>
57 END;
58+ $output .= __('Please fix this, and retest.') . '</p></div>';
59 }
60
61 // Check for MySQL
62- $message = 'MySQL';
63+ $message = __('MySQL Extension');
64
65 if ($this->CheckMySQL())
66 {
67- $output .= $imgGood.$message.'<br />';
68+ $output .= $imgGood.' '.$message.'<br />';
69 }
70 else
71 {
72 $this->envFault = true;
73
74- $output .= $imgBad.$message.'<br />';
75- $output .= <<<END
76- <div class="check_explain">
77- <p>Xibo requires a MySQL database.</p>
78- </div>
79-END;
80+ $output .= $imgBad.' '.$message.'<br />';
81+ $output .= '<div class="check_explain"><p>' . __('Xibo requires a MySQL database. Ensure PHP MySQL client extension is installed') . '</p></div>';
82 }
83
84 // Check for JSON
85- $message = 'JSON Extension';
86+ $message = __('JSON Extension');
87
88 if ($this->CheckJson())
89 {
90- $output .= $imgGood.$message.'<br />';
91+ $output .= $imgGood.' '.$message.'<br />';
92 }
93 else
94 {
95 $this->envFault = true;
96
97- $output .= $imgBad.$message.'<br />';
98- $output .= <<<END
99- <div class="check_explain">
100- <p>Xibo needs the PHP JSON extension to function.</p>
101- </div>
102-END;
103+ $output .= $imgBad.' '.$message.'<br />';
104+ $output .= '<div class="check_explain"><p>' . __('Xibo needs the PHP JSON extension to function.') . '</p></div>';
105 }
106
107 // Check for GD (graphics)
108- $message = 'GD Extension';
109+ $message = __('GD Extension');
110
111 if ($this->CheckGd())
112 {
113- $output .= $imgGood.$message.'<br />';
114+ $output .= $imgGood.' '.$message.'<br />';
115 }
116 else
117 {
118 $this->envFault = true;
119
120- $output .= $imgBad.$message.'<br />';
121- $output .= <<<END
122- <div class="check_explain">
123- <p>Xibo needs the PHP GD extension to function.</p>
124- </div>
125-END;
126+ $output .= $imgBad.' '.$message.'<br />';
127+ $output .= '<div class="check_explain"><p>' . __('Xibo needs the PHP GD extension to function.') . '</p></div>';
128 }
129
130
131 // Check for Calendar
132- $message = 'Calendar Extension';
133+ $message = __('Calendar Extension');
134
135 if ($this->CheckCal())
136 {
137- $output .= $imgGood.$message.'<br />';
138+ $output .= $imgGood.' '.$message.'<br />';
139 }
140 else
141 {
142 $this->envFault = true;
143
144- $output .= $imgBad.$message.'<br />';
145- $output .= <<<END
146- <div class="check_explain">
147- <p>Xibo needs the PHP Calendar extension to function.</p>
148- </div>
149-END;
150+ $output .= $imgBad.' '.$message.'<br />';
151+ $output .= '<div class="check_explain"><p>' . __('Xibo needs the PHP Calendar extension to function.') . '</p></div>';
152 }
153
154 // Check for DOM
155- $message = 'DOM Extension';
156+ $message = __('DOM Extension');
157
158 if ($this->CheckDom())
159 {
160- $output .= $imgGood.$message.'<br />';
161+ $output .= $imgGood.' '.$message.'<br />';
162 }
163 else
164 {
165 $this->envFault = true;
166
167- $output .= $imgBad.$message.'<br />';
168- $output .= <<<END
169- <div class="check_explain">
170- <p>Xibo needs the PHP DOM core functionality enabled.</p>
171- </div>
172-END;
173+ $output .= $imgBad.' '.$message.'<br />';
174+ $output .= '<div class="check_explain"><p>' . __('Xibo needs the PHP DOM core functionality enabled.') . '</p></div>';
175 }
176
177 // Check for DOM XML
178- $message = 'DOM XML Extension';
179+ $message = __('DOM XML Extension');
180
181 if ($this->CheckDomXml())
182 {
183- $output .= $imgGood.$message.'<br />';
184+ $output .= $imgGood.' '.$message.'<br />';
185 }
186 else
187 {
188 $this->envFault = true;
189
190- $output .= $imgBad.$message.'<br />';
191- $output .= <<<END
192- <div class="check_explain">
193- <p>Xibo needs the PHP DOM XML extension to function.</p>
194- </div>
195-END;
196+ $output .= $imgBad.' '.$message.'<br />';
197+ $output .= '<div class="check_explain"><p>' . __('Xibo needs the PHP DOM XML extension to function.') . '</p></div>';
198 }
199
200- // Check to see if we are allowed to open remote URL's (homecall will not work otherwise)
201- $message = 'Allow PHP to open external URL\'s';
202+ // Check to see if we are allowed to open remote URLs (homecall will not work otherwise)
203+ $message = __("Allow PHP to open external URLs");
204
205 if (ini_get('allow_url_fopen'))
206 {
207- $output .= $imgGood.$message.'<br />';
208+ $output .= $imgGood.' '.$message.'<br />';
209 }
210 else
211 {
212- $this->envFault = true;
213+ // Not a fault as this will not block installation/upgrade. Informational.
214+ $this->envFault = false;
215
216- $output .= $imgBad.$message.'<br />';
217- $output .= <<<END
218- <div class="check_explain">
219- <p>You must have allow_url_fopen = On in your PHP.ini file for homecall to function.<br />
220- If you do not intend to enable homecall you need not worry about this problem.</p>
221- </div>
222-END;
223+ $output .= $imgBad.' '.$message.'<br />';
224+ $output .= '<div class="check_explain"><p>' . __('You must have allow_url_fopen = On in your PHP.ini file for statistics gathering to function.') . '<br />';
225+ $output .= __('If you do not intend to enable homecall you need not worry about this problem.') . '</p></div>';
226 }
227
228 $output .= '</div>';
229@@ -394,4 +361,4 @@
230 }
231 }
232
233-?>
234\ No newline at end of file
235+?>
236
237=== modified file 'server/install.php'
238--- server/install.php 2009-04-08 18:54:13 +0000
239+++ server/install.php 2009-04-26 15:11:53 +0000
240@@ -19,13 +19,6 @@
241 * along with Xibo. If not, see <http://www.gnu.org/licenses/>.
242 */
243
244-// Start default to fr_FR
245-$locale = "fr_FR";
246-if (isset($_GET["locale"])) $locale = $_GET["locale"];
247-putenv("LC_ALL=$locale");
248-setlocale(LC_ALL, $locale);
249-bindtextdomain("default", "./locale");
250-textdomain("default");
251
252 DEFINE('XIBO', true);
253
254@@ -37,6 +30,10 @@
255 include('install/header.inc');
256 include('config/config.class.php');
257 include('config/db_config.php');
258+
259+// Setup the translations for gettext
260+require_once("lib/app/translationengine.class.php");
261+TranslationEngine::InitLocale($db);
262
263 $fault = false;
264
265@@ -65,113 +62,6 @@
266 <?php
267 echo $cObj->CheckEnvironment();
268 if ($cObj->EnvironmentFault()) {
269-## Filesystem Permissions
270- if (checkFsPermissions()) {
271- ?>
272- <img src="install/dot_green.gif" align="absmiddle">&nbsp;<?php echo __("Filesystem Permissions"); ?><br />
273- <?php
274- }
275- else {
276- $fault = true;
277- ?>
278- <img src="install/dot_red.gif" align="absmiddle">&nbsp;<?php echo __("Filesystem Permissions"); ?></br>
279- <div class="check_explain">
280- <?php echo __("Xibo needs to be able to write to the following"); ?>
281- <ul>
282- <li> settings.php
283- <li> install.php
284- <li> upgrade.php
285- </ul>
286- <?php echo __("Please fix this, and retest."); ?><br />
287- </div>
288- <?php
289- }
290-## PHP5
291- if (checkPHP()) {
292- ?>
293- <img src="install/dot_green.gif" align="absmiddle">&nbsp;<?php echo __("PHP Version"); ?><br />
294- <?php
295- }
296- else {
297- $fault = true;
298- ?>
299- <img src="install/dot_red.gif" align="absmiddle">&nbsp;<?php echo __("PHP Version"); ?><br />
300- <div class="check_explain">
301- <?php echo __("Xibo requires PHP version 5 or later."); ?><br />
302- <?php echo __("Please fix this, and retest."); ?><br />
303- </div>
304- <?php
305- }
306-## MYSQL
307- if (checkMySQL()) {
308- ?>
309- <img src="install/dot_green.gif" align="absmiddle">&nbsp;<?php echo __("PHP MySQL Extension"); ?><br />
310- <?php
311- }
312- else {
313- $fault = true;
314- ?>
315- <img src="install/dot_red.gif" align="absmiddle">&nbsp;<?php echo __("PHP MySQL Extension"); ?><br />
316- <div class="check_explain">
317- <?php echo __("Xibo needs to access a MySQL database to function."); ?><br />
318- <?php echo __("Please install MySQL and the appropriate MySQL extension and retest."); ?><br />
319- </div>
320- <?php
321- }
322-## JSON
323- if (checkJson()) {
324- ?>
325- <img src="install/dot_green.gif" align="absmiddle">&nbsp;<?php echo __("PHP JSON Extension"); ?><br />
326- <?php
327- }
328- else {
329- $fault = true;
330- ?>
331- <img src="install/dot_red.gif" align="absmiddle">&nbsp;<?php echo __("PHP JSON Extension"); ?><br />
332- <div class="check_explain">
333- <?php echo __("Xibo needs the PHP JSON extension to function."); ?><br />
334- <?php echo __("Please install the PHP JSON extension and retest."); ?><br />
335- </div>
336- <?php
337- }
338-## GD
339- if (checkGd()) {
340- ?>
341- <img src="install/dot_green.gif" align="absmiddle">&nbsp;<?php echo __("PHP GD Extension"); ?><br />
342- <?php
343- }
344- else {
345- $fault = true;
346- ?>
347- <img src="install/dot_red.gif" align="absmiddle">&nbsp;<?php echo __("PHP GD Extension"); ?><br />
348- <div class="check_explain">
349- <?php echo __("Xibo needs to manipulate images to function."); ?><br />
350- <?php echo __("Please install the GD libraries and extension and retest."); ?><br />
351- </div>
352- <?php
353- }
354-## Calendar
355- if (checkCal()) {
356- ?>
357- <img src="install/dot_green.gif" align="absmiddle">&nbsp;<?php echo __("PHP Calendar Extension"); ?><br />
358- <?php
359- }
360- else {
361- $fault = true;
362- ?>
363- <img src="install/dot_red.gif" align="absmiddle">&nbsp;<?php echo __("PHP Calendar Extension"); ?><br />
364- <div class="check_explain">
365- <?php echo __("Xibo needs the calendar extension to function."); ?><br />
366- <?php echo __("Please install the calendar extension and retest."); ?><br />
367- </div>
368- <?php
369- }
370- ?>
371- <br /><br />
372- </div>
373- <?php
374- if ($fault) {
375->>>>>>> MERGE-SOURCE
376 ?>
377 <form action="install.php" method="POST">
378 <input type="hidden" name="xibo_step" value="1" />
379
380=== modified file 'server/upgrade.php'
381--- server/upgrade.php 2009-04-08 18:56:00 +0000
382+++ server/upgrade.php 2009-04-26 15:11:53 +0000
383@@ -19,20 +19,20 @@
384 * along with Xibo. If not, see <http://www.gnu.org/licenses/>.
385 */
386
387-// Start default to fr_FR
388-$locale = "fr_FR";
389-if (isset($_GET["locale"])) $locale = $_GET["locale"];
390-putenv("LC_ALL=$locale");
391-setlocale(LC_ALL, $locale);
392-bindtextdomain("default", "./locale");
393-textdomain("default");
394-
395-DEFINE('XIBO', true);
396+DEFINE('XIBO', true);
397+
398+if (! checkPHP()) {
399+ die(__("Xibo requires PHP 5.0.2 or later"));
400+}
401
402 include('lib/app/kit.class.php');
403 include('config/db_config.php');
404 include('config/config.class.php');
405-require('settings.php');
406+require('settings.php');
407+
408+// Setup the translations for gettext
409+require_once("lib/app/translationengine.class.php");
410+TranslationEngine::InitLocale($db);
411
412 // Once we've calculated the upgrade in step 2 below, we need
413 // to have included the appropriate upgrade php files
414@@ -129,112 +129,6 @@
415 $cObj = new Config($db);
416 echo $cObj->CheckEnvironment();
417 if ($cObj->EnvironmentFault()) {
418-## Filesystem Permissions
419- if (checkFsPermissions()) {
420- ?>
421- <img src="install/dot_green.gif" align="absmiddle">&nbsp;<?php echo __("Filesystem Permissions"); ?><br />
422- <?php
423- }
424- else {
425- $fault = true;
426- ?>
427- <img src="install/dot_red.gif" align="absmiddle">&nbsp;<?php echo __("Filesystem Permissions"); ?></br>
428- <div class="check_explain">
429- <?php echo __("Xibo needs to be able to write to the following"); ?>
430- <ul>
431- <li> settings.php
432- <li> install.php
433- <li> upgrade.php
434- </ul>
435- <?php echo __("Please fix this, and retest."); ?><br />
436- </div>
437- <?php
438- }
439-## PHP5
440- if (checkPHP()) {
441- ?>
442- <img src="install/dot_green.gif" align="absmiddle">&nbsp;<?php echo __("PHP Version"); ?><br />
443- <?php
444- }
445- else {
446- $fault = true;
447- ?>
448- <img src="install/dot_red.gif" align="absmiddle">&nbsp;<?php echo __("PHP Version"); ?><br />
449- <div class="check_explain">
450- <?php echo __("Xibo requires PHP version 5.02 or later."); ?><br />
451- <?php echo __("Please fix this, and retest."); ?><br />
452- </div>
453- <?php
454- }
455-## MYSQL
456- if (checkMySQL()) {
457- ?>
458- <img src="install/dot_green.gif" align="absmiddle">&nbsp;<?php echo __("PHP MySQL Extension"); ?><br />
459- <?php
460- }
461- else {
462- $fault = true;
463- ?>
464- <img src="install/dot_red.gif" align="absmiddle">&nbsp;<?php echo __("PHP MySQL Extension"); ?><br />
465- <div class="check_explain">
466- <?php echo __("Xibo needs to access a MySQL database to function."); ?><br />
467- <?php echo __("Please install MySQL and the appropriate MySQL extension and retest."); ?><br />
468- </div>
469- <?php
470- }
471-## JSON
472- if (checkJson()) {
473- ?>
474- <img src="install/dot_green.gif" align="absmiddle">&nbsp;<?php echo __("PHP JSON Extension"); ?><br />
475- <?php
476- }
477- else {
478- $fault = true;
479- ?>
480- <img src="install/dot_red.gif" align="absmiddle">&nbsp;<?php echo __("PHP JSON Extension"); ?><br />
481- <div class="check_explain">
482- <?php echo __("Xibo needs the PHP JSON extension to function."); ?><br />
483- <?php echo __("Please install the PHP JSON extension and retest."); ?><br />
484- </div>
485- <?php
486- }
487-## GD
488- if (checkGd()) {
489- ?>
490- <img src="install/dot_green.gif" align="absmiddle">&nbsp;<?php echo __("PHP GD Extension"); ?><br />
491- <?php
492- }
493- else {
494- $fault = true;
495- ?>
496- <img src="install/dot_red.gif" align="absmiddle">&nbsp;<?php echo __("PHP GD Extension"); ?><br />
497- <div class="check_explain">
498- <?php echo __("Xibo needs to manipulate images to function."); ?><br />
499- <?php echo __("Please install the GD libraries and extension and retest."); ?><br />
500- </div>
501- <?php
502- }
503-## Calendar
504- if (checkCal()) {
505- ?>
506- <img src="install/dot_green.gif" align="absmiddle">&nbsp;<?php echo __("PHP Calendar Extension"); ?><br />
507- <?php
508- }
509- else {
510- $fault = true;
511- ?>
512- <img src="install/dot_red.gif" align="absmiddle">&nbsp;<?php echo __("PHP Calendar Extension"); ?><br />
513- <div class="check_explain">
514- <?php echo __("Xibo needs the calendar extension to function."); ?><br />
515- <?php echo __("Please install the calendar extension and retest."); ?><br />
516- </div>
517- <?php
518- }
519- ?>
520- <br /><br />
521- </div>
522- <?php
523- if ($fault) {
524 $_SESSION['step'] = 1;
525 ?>
526 <form action="upgrade.php" method="POST">
527@@ -704,4 +598,4 @@
528 }
529 }
530
531-?>
532\ No newline at end of file
533+?>

Subscribers

People subscribed via source and target branches

to all changes: