Revision: 1826
http://mrbs.svn.sourceforge.net/mrbs/?rev=1826&view=rev
Author: cimorrison
Date: 2011-05-14 10:15:57 +0000 (Sat, 14 May 2011)
Log Message:
-----------
Added lang.en as the fall-back language, in order that something is shown even
when the $default_language_tokens file does not have a translated token.
Based on a patch by Thomas Bleher.
Modified Paths:
--------------
mrbs/trunk/web/language.inc
Modified: mrbs/trunk/web/language.inc
===================================================================
--- mrbs/trunk/web/language.inc 2011-05-14 09:37:11 UTC (rev 1825)
+++ mrbs/trunk/web/language.inc 2011-05-14 10:15:57 UTC (rev 1826)
@@ -337,23 +337,31 @@
////////////////////////////////////////////////////////////////////////
// Language token handling
+// Get a default set of language tokens, you can change this if you like.
+// Always include English as the fallback language, in case the selected
language
+// is missing some translated tokens
+include "lang.en";
+// include_once just to avoid reloading the 'en' file
+include_once "lang." . $default_language_tokens;
+
+
// Get first default set of language tokens for emails.
$need_to_send_mail = ($mail_settings['admin_on_bookings'] or
$mail_settings['area_admin_on_bookings'] or
$mail_settings['room_admin_on_bookings'] or
$mail_settings['booker'] or
$mail_settings['book_admin_on_approval']);
+
if ($need_to_send_mail)
{
- include "lang." . $default_language_tokens;
+ $web_vocab = $vocab; // Save $vocab before it gets overwritten
include "lang." . $mail_settings['admin_lang'];
$mail_vocab = $vocab;
- unset ($vocab);
+ $vocab = $web_vocab; // Restore $vocab
}
-// Get a default set of language tokens, you can change this if you like
-include "lang." . $default_language_tokens;
+
// Define the default locale here. For a list of supported
// locales on your system do "locale -a"
setlocale(LC_ALL,'C');
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits