Permalink
Browse files

Adding support for localization of navigation/talk selection pages.

  • Loading branch information...
1 parent d9a06b6 commit 76282575eebb76dd32b9ac5832ca3d86f147995c @jmcastagnetto jmcastagnetto committed May 24, 2005
View
@@ -12,6 +12,14 @@
$pdf_example_font = "Courier";
$jsKeyboard = true; // enable javascript handling of keyboard events
$topic_cols = 3; // number of topic columns on front page
+
+ // language/locale for PRES2 messages, available: en, es
+ // do not use es_ES or other variation, set the equivalencies
+ // in the function _init_gettext() in messages.php
+ define('PRES2_LOCALE', 'en');
+ define('PRES2_LOCALEDIR', 'locale');
+ define('PRES2_USE_GETTEXT', false);
+
// Convert em font sizing to flash font sizes
function flash_fixsize($ht) {
View
@@ -5,6 +5,7 @@
require 'config.php';
require 'XML_Presentation.php';
+ require_once 'messages.php';
session_start();
@@ -23,8 +24,8 @@
}
if (!$ps) {
- echo "Could not find any slides (xml files) in \$presentationDir $presentationDir<BR>";
- echo "Please modify config.php<BR>";
+ echo message('SLIDES_NOT_FOUND')." \$presentationDir $presentationDir<BR>";
+ echo message('MODIFY_CONFIG')." config.php<BR>";
exit;
}
@@ -109,16 +110,15 @@ function change_mode() {
echo "<img src=\"$logo2\" align=\"right\" style=\"float: right;\">";
}
- echo "<div style=\"font-size: 3em; margin: 0 2.5em 0 0;\">PHP Presentation System</div>";
+ echo "<div style=\"font-size: 3em; margin: 0 2.5em 0 0;\">".message('PRES2_TITLE')."</div>";
echo '</div></div>';
?>
<br /><br /><br /><br /><br /><br />
<div class="shadow" style="margin: 1em 4em 0.8em 3em;">
<div class="output" style="font-size: 1.8em; margin: -0.5em 0 0 -0.5em;">
<?php if(!isset($topic)){ ?>
-<p> Welcome to the PHP Presentation System. Here we list all of the available presentation categories stored
-within this system.</p>
+<p><?php echo message('WELCOME_MSG'); ?></p>
<?php
ksort($topics);
print('<table width="100%"><tr>'."\n");
@@ -144,51 +144,50 @@ function change_mode() {
$_SESSION['selected_display_mode'] = $display_mode;
?>
<form name="modes_form" action="<?php echo $_SERVER['PHP_SELF']?>" method="POST">
-<p>Please select a display mode:
+<p><?php echo message('SELECT_MODE'); ?>
<select name="modes" onChange="change_mode()">
-<option value="html" <?php echo ($display_mode=='html')?'SELECTED':''?>>Fancy HTML (Best with Mozilla)</option>
-<option value="plainhtml" <?php echo ($display_mode=='plainhtml')?'SELECTED':''?>>Plain HTML</option>
-<option value="flash" <?php echo ($display_mode=='flash')?'SELECTED':''?>>Flash 5 (navbar only)</option>
-<option value="pdfus" <?php echo ($display_mode=='pdfus')?'SELECTED':''?>>PDF (US-Letter)</option>
-<option value="pdfusl" <?php echo ($display_mode=='pdfusl')?'SELECTED':''?>>PDF (US-Legal)</option>
-<option value="pdfa4" <?php echo ($display_mode=='pdfa4')?'SELECTED':''?>>PDF (A4)</option>
+<option value="html" <?php echo ($display_mode=='html')?'SELECTED':''?>><?php echo message('OPT_FANCYHTML'); ?></option>
+<option value="plainhtml" <?php echo ($display_mode=='plainhtml')?'SELECTED':''?>><?php echo message('OPT_PLAINHTML'); ?></option>
+<option value="flash" <?php echo ($display_mode=='flash')?'SELECTED':''?>><?php echo message('OPT_FLASH'); ?></option>
+<option value="pdfus" <?php echo ($display_mode=='pdfus')?'SELECTED':''?>><?php echo message('OPT_PDFLETTER'); ?></option>
+<option value="pdfusl" <?php echo ($display_mode=='pdfusl')?'SELECTED':''?>><?php echo message('OPT_PDFLEGAL'); ?></option>
+<option value="pdfa4" <?php echo ($display_mode=='pdfa4')?'SELECTED':''?>><?php echo message('OPT_PDFA4'); ?></option>
</select>
<br />
-Show Speaker Notes: <input type="checkbox" name="speaker" <?php echo ($form_speaker=='true')?'checked':''?> onChange="change_mode()">
+<?php echo message('SHOW_NOTES'); ?> <input type="checkbox" name="speaker" <?php echo ($form_speaker=='true')?'checked':''?> onChange="change_mode()">
</p>
</form>
<?php
switch($display_mode) {
case 'html':
if($jsKeyboard) {
- echo "<p>Keyboard controls are available: <br />\n".
- " &lt;cursor-left&gt; previous slide<br />\n".
- " &lt;cursor-right&gt; next slide<br />\n".
- " also use &lt;cursor-right&gt; to step through animated slides.</p>\n";
+ echo "<p>".nl2br(message('HTML_KEYBOARD_CONTROLS'))."</p>\n";
} else {
- echo "<p>Keyboard controls disabled</p>\n";
+ echo "<p>".message('HTML_NO_KEYBOARD_CONTROLS')."</p>\n";
break;
}
break;
case 'flash':
- echo "<p>Keyboard controls available: <br />\n".
- " &lt;Space&gt; or &lt;Enter&gt; next slide<br />\n".
- " &lt;Backspace&gt; previous slide<br />\n";
+ echo "<p>".nl2br(message('FLASH_KEYBOARD_CONTROLS'))."</p>\n";
break;
case 'pdfus':
case 'pdfusl':
case 'pdfa4':
if (!extension_loaded("pdf")) {
- echo "<p>The PDF extension is not loaded, so this format is not available here.</p>";
+ echo "<p>".message('NO_PDF_EXTENSION')."</p>\n";
}
break;
}
?>
-<p>The available presentations are... (most recent first)</p>
+<p><?php echo message('AVAILABLE_PRESENTATIONS'); ?></p>
<table align="center" class="index">
-<tr><th>Title</th><th>Date</th><th>Location</th><th>Speaker</th><th>Slides</th></tr>
+<tr><th><?php echo message('PRES_TITLE'); ?></th>
+ <th><?php echo message('PRES_DATE'); ?></th>
+ <th><?php echo message('PRES_LOCATION'); ?></th>
+ <th><?php echo message('PRES_SPEAKER'); ?></th>
+ <th><?php echo message('PRES_SLIDES'); ?></th></tr>
<?php
$prnum = sizeof($pr);
Binary file not shown.
@@ -0,0 +1,32 @@
+<?php
+// en_US
+$messages = array(
+ 'SLIDES_NOT_FOUND' => 'Could not find any slides (xml files) in',
+ 'MODIFY_CONFIG' => 'Please modify',
+ 'PRES2_TITLE' => 'PHP Presentation System',
+ 'WELCOME_MSG' => 'Welcome to the PHP Presentation System. Here we list all of the available presentation categories stored within this system.',
+ 'SELECT_MODE' => 'Please select a display mode:',
+ 'OPT_FANCYHTML' => 'Fancy HTML (Best with Mozilla)',
+ 'OPT_PLAINHTML' => 'Plain HTML',
+ 'OPT_FLASH' => 'Flash 5 (navbar only)',
+ 'OPT_PDFLETTER' => 'PDF (US-Letter)',
+ 'OPT_PDFLEGAL' => 'PDF (US-Legal)',
+ 'OPT_PDFA4' => 'PDF (A4)',
+ 'SHOW_NOTES' => 'Show Speaker Notes:',
+ 'HTML_KEYBOARD_CONTROLS' => "Keyboard controls are available:\n".
+ " &lt;cursor-left&gt; previous slide\n".
+ " &lt;cursor-right&gt; next slide\n".
+ " also use &lt;cursor-right&gt; to step through animated slides.",
+ 'HTML_NO_KEYBOARD_CONTROLS' => 'Keyboard controls disabled',
+ 'FLASH_KEYBOARD_CONTROLS' => "Keyboard controls available:\n".
+ " &lt;Space&gt; or &lt;Enter&gt; next slide\n".
+ " &lt;Backspace&gt; previous slide",
+ 'NO_PDF_EXTENSION' => 'The PDF extension is not loaded, so this format is not available here.',
+ 'AVAILABLE_PRESENTATIONS' => 'The available presentations are... (most recent first)',
+ 'PRES_TITLE' => 'Title',
+ 'PRES_DATE' => 'Date',
+ 'PRES_LOCATION' => 'Location',
+ 'PRES_SPEAKER' => 'Speaker',
+ 'PRES_SLIDES' => 'Slides',
+);
+?>
@@ -0,0 +1,82 @@
+# English message strings for PRES2
+# Copyright (C) PHP
+# Jesus M. Castagnetto <jmcastagnetto@php.net>, 2005.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"POT-Creation-Date: 2005-05-07 23:21-0500\n"
+"PO-Revision-Date: 2005-05-07 23:26-0500\n"
+"Last-Translator: Jesus M. Castagnetto <jmcastagnetto@php.net>\n"
+"Language-Team:\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ASCII\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "SLIDES_NOT_FOUND"
+msgstr "Could not find any slides (xml files) in"
+
+msgid "MODIFY_CONFIG"
+msgstr "Please modify"
+
+msgid "PRES2_TITLE"
+msgstr "PHP Presentation System"
+
+msgid "WELCOME_MSG"
+msgstr "Welcome to the PHP Presentation System. Here we list all of the available presentation categories stored within this system."
+
+msgid "SELECT_MODE"
+msgstr "Please select a display mode:"
+
+msgid "OPT_FANCYHTML"
+msgstr "Fancy HTML (Best with Mozilla)"
+
+msgid "OPT_PLAINHTML"
+msgstr "Plain HTML"
+
+msgid "OPT_FLASH"
+msgstr "Flash 5 (navbar only)"
+
+msgid "OPT_PDFLETTER"
+msgstr "PDF (US-Letter)"
+
+msgid "OPT_PDFLEGAL"
+msgstr "PDF (US-Legal)"
+
+msgid "OPT_PDFA4"
+msgstr "PDF (A4)"
+
+msgid "SHOW_NOTES"
+msgstr "Show Speaker Notes:"
+
+msgid "HTML_KEYBOARD_CONTROLS"
+msgstr "Keyboard controls are available:\n&lt;cursor-left&gt; previous slide\n&lt;cursor-right&gt; next slide\nalso use &lt;cursor-right&gt; to step through animated slides."
+
+msgid "HTML_NO_KEYBOARD_CONTROLS"
+msgstr "Keyboard controls disabled"
+
+msgid "FLASH_KEYBOARD_CONTROLS"
+msgstr "Keyboard controls available:\n&lt;Space&gt; or &lt;Enter&gt; next slide\n&lt;Backspace&gt; previous slide"
+
+msgid "NO_PDF_EXTENSION"
+msgstr "The PDF extension is not loaded, so this format is not available here."
+
+msgid "AVAILABLE_PRESENTATIONS"
+msgstr "The available presentations are... (most recent first)"
+
+msgid "PRES_TITLE"
+msgstr "Title"
+
+msgid "PRES_DATE"
+msgstr "Date"
+
+msgid "PRES_LOCATION"
+msgstr "Location"
+
+msgid "PRES_SPEAKER"
+msgstr "Speaker"
+
+msgid "PRES_SLIDES"
+msgstr "Slides"
+
Binary file not shown.
@@ -0,0 +1,32 @@
+<?php
+// es_PE
+$messages = array(
+ 'SLIDES_NOT_FOUND' => 'No pude encontrar diapositivas (archivos xml) en',
+ 'MODIFY_CONFIG' => 'Por favor modifique',
+ 'PRES2_TITLE' => 'Sistema de Presentaciones de PHP',
+ 'WELCOME_MSG' => 'Bienvenido al Sistema de Presentaciones de PHP. Aqui listamos todas las categorias de presentaciones disponibles en nuestro sistema.',
+ 'SELECT_MODE' => 'Por favor seleccione un modo de exhibici&oacute;n:',
+ 'OPT_FANCYHTML' => 'HTML Din&aacute;mico (Mejor con Mozilla)',
+ 'OPT_PLAINHTML' => 'HTML Simple',
+ 'OPT_FLASH' => 'Flash 5 (barra de navegaci&oacute;n solamente)',
+ 'OPT_PDFLETTER' => 'PDF (Tama&ntilde;o carta, US)',
+ 'OPT_PDFLEGAL' => 'PDF (Tama&ntilde;o oficio, US)',
+ 'OPT_PDFA4' => 'PDF (Tama&ntilde;o A4)',
+ 'SHOW_NOTES' => 'Mostrar las Notas de Presentador:',
+ 'HTML_KEYBOARD_CONTROLS' => "Controles de teclado disponibles:\n".
+ " &lt;flecha-izquierda&gt; diapositiva previa\n".
+ " &lt;flecha-derecha&gt; diapositiva siguiente\n".
+ " tambi&eacute;n use &lt;flecha-derecha&gt; para activar diapositivas animadas.",
+ 'HTML_NO_KEYBOARD_CONTROLS' => 'Controles de teclado no disponibles.',
+ 'FLASH_KEYBOARD_CONTROLS' => "Controles de teclado disponibles:\n".
+ " &lt;Barra de espacio&gt; or &lt;Tecla de retorno&gt; diapositiva siguiente\n".
+ " &lt;Tecla de retroceso&gt; diapositiva previa",
+ 'NO_PDF_EXTENSION' => 'La extensi&ooacute;n de PDF no esta cargada, de manera que este formato no esta disponible aqui.',
+ 'AVAILABLE_PRESENTATIONS' => 'Las presentaciones disponibles son... (la m&aacute;s reciente primera)',
+ 'PRES_TITLE' => 'T&iacute;tulo',
+ 'PRES_DATE' => 'Fecha',
+ 'PRES_LOCATION' => 'Locaci&oacute;n',
+ 'PRES_SPEAKER' => 'Presentador',
+ 'PRES_SLIDES' => 'Diapositivas',
+);
+?>
@@ -0,0 +1,81 @@
+# Spanish translation of PRES2
+# Copyright (C) PHP
+# Jesus M. Castagnetto <jmcastagnetto@php.net>, 2005.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"POT-Creation-Date: 2005-05-07 23:21-0500\n"
+"PO-Revision-Date: 2005-05-07 23:26-0500\n"
+"Last-Translator: Jesus M. Castagnetto <jmcastagnetto@php.net>\n"
+"Language-Team:\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ASCII\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "SLIDES_NOT_FOUND"
+msgstr"No pude encontrar diapositivas (archivos xml) en"
+
+msgid "MODIFY_CONFIG"
+msgstr"Por favor modifique"
+
+msgid "PRES2_TITLE"
+msgstr"Sistema de Presentaciones de PHP"
+
+msgid "WELCOME_MSG"
+msgstr"Bienvenido al Sistema de Presentaciones de PHP. Aqui listamos todas las categorias de presentaciones disponibles en nuestro sistema."
+
+msgid "SELECT_MODE"
+msgstr"Por favor seleccione un modo de exhibici&oacute;n:"
+
+msgid "OPT_FANCYHTML"
+msgstr"HTML Din&aacute;mico (Mejor con Mozilla)"
+
+msgid "OPT_PLAINHTML"
+msgstr"HTML Simple"
+
+msgid "OPT_FLASH"
+msgstr"Flash 5 (barra de navegaci&oacute;n solamente)"
+
+msgid "OPT_PDFLETTER"
+msgstr"PDF (Tama&ntilde;o carta, US)"
+
+msgid "OPT_PDFLEGAL"
+msgstr"PDF (Tama&ntilde;o oficio, US)"
+
+msgid "OPT_PDFA4"
+msgstr"PDF (Tama&ntilde;o A4)"
+
+msgid "SHOW_NOTES"
+msgstr"Mostrar las Notas de Presentador:"
+
+msgid "HTML_KEYBOARD_CONTROLS"
+msgstr"Controles de teclado disponibles:\n&lt;flecha-izquierda&gt; diapositiva previa\n&lt;flecha-derecha&gt; diapositiva siguiente\ntambi&eacute;n use &lt;flecha-derecha&gt; para activar diapositivas animadas."
+
+msgid "HTML_NO_KEYBOARD_CONTROLS"
+msgstr"Controles de teclado no disponibles."
+
+msgid "FLASH_KEYBOARD_CONTROLS"
+msgstr"Controles de teclado disponibles:\n&lt;Barra de espacio&gt; or &lt;Tecla de retorno&gt; diapositiva siguiente\n&lt;Tecla de retroceso&gt; diapositiva previa"
+
+msgid "NO_PDF_EXTENSION"
+msgstr"La extensi&ooacute;n de PDF no esta cargada, de manera que este formato no esta disponible aqui."
+
+msgid "AVAILABLE_PRESENTATIONS"
+msgstr"Las presentaciones disponibles son... (la m&aacute;s reciente primera)"
+
+msgid "PRES_TITLE"
+msgstr"T&iacute;tulo"
+
+msgid "PRES_DATE"
+msgstr"Fecha"
+
+msgid "PRES_LOCATION"
+msgstr"Locaci&oacute;n"
+
+msgid "PRES_SPEAKER"
+msgstr"Presentador"
+
+msgid "PRES_SLIDES"
+msgstr"Diapositivas"

0 comments on commit 7628257

Please sign in to comment.