diff --git a/LangCodes.php b/LangCodes.php new file mode 100644 index 0000000..2d58bc7 --- /dev/null +++ b/LangCodes.php @@ -0,0 +1,23 @@ +'fr_FR', + 'en'=>'en_US' + ); + return $all_lang[$code]; + } + public function getNameLang($code_lang){ + $name_lang=array( + 'fr'=>_('French'), + 'en'=>_('English') + ); + return $name_lang[$code_lang]; + } +} +?> \ No newline at end of file diff --git a/admin/classes/common/DBService.php b/admin/classes/common/DBService.php index b45e8c3..f6e58cb 100644 --- a/admin/classes/common/DBService.php +++ b/admin/classes/common/DBService.php @@ -21,22 +21,22 @@ class DBService { public function __construct($dbname = null){ Config::init(); if (!($this->db = new mysqli(Config::$database->host, Config::$database->username, Config::$database->password))){ - throw new Exception("There was a problem with the database: " . $this->db->error); + throw new Exception(_("There was a problem with the database: ") . $this->db->error); }else if ($dbname){ if (!$this->db->select_db($dbname)){ - throw new Exception("There was a problem with the database: " . $this->db->error); + throw new Exception(_("There was a problem with the database: ") . $this->db->error); } }else if (!($this->db->select_db(Config::$database->name))){ - throw new Exception("There was a problem with the database: " . $this->db->error); + throw new Exception(_("There was a problem with the database: ") . $this->db->error); } if ($dbname) $this->changeDB($dbname); } - public function changeDB($databaseName){ - // $databaseName='coral_reporting_pprd'; + public function changeDB($databaseName) { + //$databaseName='coral_reporting_pprd'; if (!$this->db->select_db($databaseName)){ - throw new Exception("There was a problem with the database: " . $this->db->error); + throw new Exception(_("There was a problem with the database: ") . $this->db->error); } return $this; } @@ -45,7 +45,7 @@ public function getSQLdb(){ } public function query($sql){ if (!($result = $this->db->query($sql))) - throw new Exception("There was a problem with the database: " . $this->db->error); + throw new Exception(_("There was a problem with the database: ") . $this->db->error); else if ($result instanceof mysqli_result){ return new DBResult($result); }else if ($result){ diff --git a/admin/classes/domain/Report.php b/admin/classes/domain/Report.php index 164a53f..99ab6a1 100644 --- a/admin/classes/domain/Report.php +++ b/admin/classes/domain/Report.php @@ -136,18 +136,18 @@ public function printPlatformInfo(&$platforms){ foreach ( $platforms as $platform ){ echo "{$platform['reportDisplayName']}Year"; if ($platform['startYear'] != '' && ($platform['endYear'] == '' || $platform['endYear'] == '0')){ - echo ": {$platform['startYear']} to present"; + echo ": {$platform['startYear']} "._("to present"); }else{ - echo "s: {$platform['startYear']} to {$platform['endYear']}"; + echo "s: {$platform['startYear']} "._("to")." {$platform['endYear']}"; } - echo 'This Interface '; + echo ""._("This Interface "); if ($platform['counterCompliantInd'] == '1'){ - echo 'provides COUNTER compliant stats.
'; + echo _("provides COUNTER compliant stats.").'
'; }else{ - echo 'does not provide COUNTER compliant stats.
'; + echo _("does not provide COUNTER compliant stats.").'
'; } if ($platform['noteText']){ - echo "
Interface Notes: {$platform['noteText']}
"; + echo "
"._("Interface Notes").": {$platform['noteText']}
"; } echo ''; } @@ -155,11 +155,11 @@ public function printPlatformInfo(&$platforms){ public function printPublisherInfo(&$publishers){ foreach ( $publishers as $publisher ){ - echo "{$publisher['reportDisplayName']}Year"; + echo "{$publisher['reportDisplayName']}"._("Year"); if (($publisher['startYear'] != '') && ($publisher['endYear'] == '')){ echo ": {$publisher['startYear']}"; }else{ - echo "s: {$publisher['startYear']} to {$publisher['endYear']}"; + echo "s: {$publisher['startYear']} "._("to")." {$publisher['endYear']}"; } echo ''; if (isset($publisher['notes'])){ diff --git a/admin/classes/domain/ReportHelper.php b/admin/classes/domain/ReportHelper.php index 0274370..93f1ae2 100644 --- a/admin/classes/domain/ReportHelper.php +++ b/admin/classes/domain/ReportHelper.php @@ -136,11 +136,11 @@ public function process(DBResult &$reportArray, ReportNotes &$notes){ if ($this->outputType === 'web' && ($print_data !== ' ') && $field === 'TITLE'){ if ($this->report->getID() != '1'){ - $print_data .= '
view related titles"; + $print_data .= '
"._("view related titles").""; } // echo link resolver link if ((($currentRow['PRINT_ISSN']) || ($currentRow['ONLINE_ISSN'])) && isset($this->baseURL)){ - $print_data .= '
view in link resolver'; + $print_data .= "
"._("view in link resolver").""; } } @@ -195,7 +195,7 @@ public function process(DBResult &$reportArray, ReportNotes &$notes){ if ($this->outputType != 'xls' && !($performCheck && in_array(false, $this->groupColsArray, true) !== false) && $print_subtotal_flag && $this->report->hasGroupTotalInd()){ $rowoutput .= ""; if ($countForGrouping > 1){ - $rowoutput .= "Total for $hold_rprt_grpng_data"; + $rowoutput .= ""._("Total for ").$hold_rprt_grpng_data.""; foreach ( $fields as $field ){ $rowoutput .= '' . $this->sumField($this->sumColsArray[$field], $sumArray[$field]) . ''; } @@ -218,7 +218,7 @@ public function process(DBResult &$reportArray, ReportNotes &$notes){ if ($this->report->hasGroupTotalInd() && $hold_rprt_grpng_data){ // one last grouping summary if ($countForGrouping > 1){ - $grp .= "Total for $hold_rprt_grpng_data"; + $grp .= ""._("Total for ").$hold_rprt_grpng_data.""; foreach ( $fields as $field ){ $grp .= "" . $this->sumField($this->sumColsArray[$field], $sumArray[$field]) . ""; } @@ -226,7 +226,7 @@ public function process(DBResult &$reportArray, ReportNotes &$notes){ } echo " "; } - echo 'Total for Report'; + echo ''._("Total for Report").''; $total = ''; for($colNum = 1; $colNum < $numFields; ++$colNum){ if (isset($this->sumColsArray[$fields[$colNum]])){ @@ -241,13 +241,13 @@ public function process(DBResult &$reportArray, ReportNotes &$notes){ } if ($rowNum === 0){ - echo "Sorry, no rows were returned."; + echo ""._("Sorry, no rows were returned."); }else{ - echo "Showing rows {$this->startPage} to "; + echo ""._("Showing rows ").$this->startPage._(" to "); if (($this->maxRows > 0) && ($rowNum > $this->maxRows)){ - echo "$this->maxRows of $this->maxRows"; + echo $this->maxRows._(" of ").$this->maxRows; }else{ - echo "$rowNum of $rowNum"; + echo $rowNum._(" of ").$rowNum; } } echo ''; @@ -297,7 +297,7 @@ private function loopThroughParams(){ $this->paramDisplay = ''; $this->rprt_prm_add = ''; }else{ - $this->paramDisplay = 'Title: ' . $this->report->getUsageTitle($this->titleID) . '
'; + $this->paramDisplay = ''._("Title:").' ' . $this->report->getUsageTitle($this->titleID) . '
'; $this->rprt_prm_add = "&titleID={$this->titleID}"; $this->hidden_inputs->addReportID($this->report->getID()) ->addTitleID($this->titleID); @@ -311,13 +311,13 @@ private function loopThroughParams(){ if (($prm_value === 'on') || ($prm_value === 'Y')){ $this->showUnadjusted = true; $this->hidden_inputs->addParam($parm->ID, 'Y'); - $this->paramDisplay .= 'Numbers are not adjusted for use violations
'; + $this->paramDisplay .= ''._("Numbers are not adjusted for use violations").'
'; } }else if ($parm->addWhereClause === 'limit'){ // decide what to do $this->addWhere[0] = ''; // changed from $add_where. Assumed mistake. $this->maxRows = $prm_value; - $this->paramDisplay .= "Limit: Top $prm_value
"; + $this->paramDisplay .= ""._("Limit:")." "._("Top ").$prm_value."
"; }else{ // if the parm comes through as an id (for publisher / platform or title), display actual value for user friendliness if (($parm->displayPrompt === 'Provider / Publisher') || ($parm->displayPrompt === 'Provider') || ($parm->displayPrompt === 'Publisher')){ diff --git a/ajax_htmldata.php b/ajax_htmldata.php index db804eb..53e58a0 100644 --- a/ajax_htmldata.php +++ b/ajax_htmldata.php @@ -38,7 +38,7 @@ echo ">"; if ($parm->requiredInd != '1'){ - echo ""; + echo ""; } $rownumber = 1; @@ -55,10 +55,10 @@ unset($p); echo ''; }else if ($parm->typeCode === "ms"){ - echo ""; }else if ($parm->typeCode === "chk"){ echo ""; }else{ @@ -94,7 +94,7 @@ echo ">"; } if ($parm->requiredInd != '1'){ - echo ""; + echo ""; } $rownumber = 1; @@ -107,10 +107,10 @@ echo ""; }else if ($parm->typeCode === "ms"){ - echo "
"; } }else{ - echo "Action " . $action . " not set up!"; + echo _("Action ") . $action . _(" not set up!"); } ob_end_flush(); ?> - diff --git a/css/print.css b/css/print.css index 0b99ba2..61ca38c 100644 --- a/css/print.css +++ b/css/print.css @@ -29,7 +29,6 @@ font-weight: bold; th { border-width: 1px; color: black; -font-weight: heavy; } html, body { diff --git a/css/style.css b/css/style.css index f60c546..80312b6 100644 --- a/css/style.css +++ b/css/style.css @@ -1,7 +1,7 @@ html { height: 100%; margin: 0; - padding: 0 + padding: 0; } body { @@ -10,9 +10,8 @@ body { color: #3D545D; font-family: "arial"; font-size: 8pt; - font-weight: heavy; margin: 5px; - padding: 0 + padding: 0; } label{ @@ -131,10 +130,9 @@ border-right: 1px solid #C1DAD7; border-bottom: 1px solid #C1DAD7; background: #f5f8fb; padding: 1px; -font-weight: heavy; color: #3D545D; text-align:center; -align:center; +/*align:center;*/ } td.head { @@ -168,7 +166,25 @@ a.headLink{ color: white; } -select option { color: #3D545D; font-family: "arial"; font-size: 8pt; font-weight: medium; } -.opt { color: #3D545D; font-family: "arial"; font-size: 8pt; font-weight: medium; } - +select option { color: #3D545D; font-family: "arial"; font-size: 8pt; } +.opt { color: #3D545D; font-family: "arial"; font-size: 8pt; } +/* Change language */ +.dropDownLang{ + color: #3D545D; + background: #e4f5fc; /* Old browsers */ + background: linear-gradient(to bottom, #c8d8e9 3%,#e2f0ff 52%,#c7cefc 100%); /* W3C */ + border: none; + border-radius: 5px; + font-weight: bolder; + width: auto; + height:20px; + cursor: pointer; +} +.fontText{ + font-size: 11pt; +} +.boxRight{ + position:absolute; + margin-left:67%; +} diff --git a/directory.php b/directory.php index 359d3ac..5af0140 100644 --- a/directory.php +++ b/directory.php @@ -56,4 +56,21 @@ function lcfirst($string) { } } +// Include file of language codes +include_once 'LangCodes.php'; +$lang_name = new LangCodes(); + +// Verify the language of the browser +global $http_lang; +if(isset($_COOKIE["lang"])){ + $http_lang = $_COOKIE["lang"]; +}else{ + $codeL = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2); + $http_lang = $lang_name->getLanguage($codeL); +} +putenv("LC_ALL=$http_lang"); +setlocale(LC_ALL, $http_lang.".utf8"); +bindtextdomain("messages", "./locale"); +textdomain("messages"); + ?> diff --git a/index.php b/index.php index b59dabd..9964bbe 100644 --- a/index.php +++ b/index.php @@ -21,7 +21,7 @@ include_once 'directory.php'; // print header -$pageTitle = 'Home'; +$pageTitle = _('Home'); include 'templates/header.php'; ?> @@ -54,7 +54,7 @@
- "; if ($parm->requiredInd != '1'){ - echo ""; + echo ""; } $rownumber = 1; @@ -127,7 +127,7 @@ echo "display:none;"; } - echo "float:left;margin-bottom: 5px'>ID, "','block');toggleLayer('div_show_", $parm->ID, "','none');\">-Click to choose ", $parm->displayPrompt, "-
", // echo javascript left/right buttons - "

ID, "','none');toggleLayer('div_show_", $parm->ID, "','block');\">-Hide ", $parm->displayPrompt, "-
"; + "
ID, "','none');toggleLayer('div_show_", $parm->ID, "','block');\">-"._("Hide "), $parm->displayPrompt, "-"; }else if ($parm->typeCode === "chk"){ echo "ID] === 'on' || $_GET['prm_' . $parm->ID] === 'Y') ? 'checked' : ''), ">"; @@ -180,8 +180,8 @@ ?>

- " name="submitbutton" + id="submitbutton"> " name="resetbutton" id="resetbutton" onclick="javascript:clearParms();"> @@ -190,13 +190,67 @@ -
Contact / Help +


+
+

+ +
+
diff --git a/install/create_tables_data.sql b/install/create_tables_data.sql index 1d86036..f1eea66 100644 --- a/install/create_tables_data.sql +++ b/install/create_tables_data.sql @@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS `_DATABASE_NAME_`.`Report` ( `excelOnlyInd` tinyint(1) default NULL, `reportDatabaseName` varchar(45) NOT NULL, PRIMARY KEY (`reportID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; @@ -20,7 +20,7 @@ CREATE TABLE IF NOT EXISTS `_DATABASE_NAME_`.`ReportGroupingColumn` ( `reportGroupingColumnName` varchar(45) NOT NULL, `reportGroupingColumnID` int(10) unsigned NOT NULL auto_increment, PRIMARY KEY USING BTREE (`reportGroupingColumnID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; @@ -37,7 +37,7 @@ CREATE TABLE IF NOT EXISTS `_DATABASE_NAME_`.`ReportParameter` ( `parentReportParameterID` int(11) default NULL, `parameterSQLRestriction` text, PRIMARY KEY (`reportParameterID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; @@ -48,7 +48,7 @@ CREATE TABLE IF NOT EXISTS `_DATABASE_NAME_`.`ReportSum` ( `reportGroupingColumnName` varchar(45) default NULL, `reportAction` varchar(45) default NULL, PRIMARY KEY (`reportSumID`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DELETE FROM `_DATABASE_NAME_`.Report; diff --git a/install/manual_upgrade_charset_utf8.txt b/install/manual_upgrade_charset_utf8.txt new file mode 100644 index 0000000..a9d0f4e --- /dev/null +++ b/install/manual_upgrade_charset_utf8.txt @@ -0,0 +1,6 @@ +How to change the charset in the database to utf8 + + -Open SQL file in /coral/reports/install/update_latin1-to-utf8.sql and replace _DATABASE_NAME_ with your database schema name + -Run SQL file + +This script will change the charset in the database and convert all tables to utf8. \ No newline at end of file diff --git a/install/update_latin1-to-utf8.sql b/install/update_latin1-to-utf8.sql new file mode 100644 index 0000000..e231252 --- /dev/null +++ b/install/update_latin1-to-utf8.sql @@ -0,0 +1,5 @@ +ALTER DATABASE `_DATABASE_NAME_` CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`Report` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`ReportGroupingColumn` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`ReportParameter` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `_DATABASE_NAME_`.`ReportSum` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; \ No newline at end of file diff --git a/js/common.js b/js/common.js index ec002ab..fad33d3 100644 --- a/js/common.js +++ b/js/common.js @@ -15,6 +15,15 @@ ************************************************************************************************************************** */ +/* + * gt : Object to translate JavaScript strings + * function _() : Syntax of gettext + */ +var gt = new Gettext({ 'domain' : 'messages' }); +function _(msgid) { + return gt.gettext(msgid); +} + //image preloader (function($) { var cache = []; diff --git a/js/index.js b/js/index.js index cb9457e..559ac9a 100644 --- a/js/index.js +++ b/js/index.js @@ -1,147 +1,147 @@ -/* - ************************************************************************************************************************** - ** CORAL Usage Statistics Reporting Module v. 1.0 - ** - ** Copyright (c) 2010 University of Notre Dame - ** - ** This file is part of CORAL. - ** - ** CORAL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - ** - ** CORAL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License along with CORAL. If not, see . - ** - ************************************************************************************************************************** - */ - -$("#reportID").change(function(){ - //updateParms; - if ($("#reportID").val() != "") { - $("#div_parm").html("
Refreshing Contents..."); - $.ajax({ - type: "GET", - url: "ajax_htmldata.php", - cache: false, - data: "action=getReportParameters&reportID=" + $("#reportID").val(), - success: function(html) { - $("#div_parm").html(html); - } - - - }); - }else{ - $("#div_parm").html(""); - } - - -}); - - - -function clearParms() { - - $("#reportID").val(""); - $("#div_parm").html(""); - - -} - - -function updateChildren(parmID){ - - //first get a list of this parm's children - $.ajax({ - type: "GET", - url: "ajax_htmldata.php", - cache: false, - data: "action=getChildParameters&parentReportParameterID=" + parmID, - success: function(childParms) { - var childParmArray = childParms.split("|"); - - for (var i=0; i=0; i--) - { - if(theSelFrom.options[i].selected) - { - selectedText[selectedCount] = theSelFrom.options[i].text; - selectedValues[selectedCount] = theSelFrom.options[i].value; - if (theSelFrom.length > 0){ - theSelFrom.options[i] = null; - } - selectedCount++; - } - } - - // Add the selected text/values in reverse order. - // This will add the Options to the 'to' Select - // This will add the Options to the 'to' Select - // in the same order as they were in the 'from' Select. - for(i=selectedCount-1; i>=0; i--) - { - theSelTo.options[theSelTo.length] = new Option(selectedText[i], selectedValues[i]); - } - -} - -function placeInHidden(delim, selStr, hidStr) -{ - var selObj = document.getElementById(selStr); - var hideObj = document.getElementById(hidStr); - hideObj.value = ''; - for (var i=0; i. + ** + ************************************************************************************************************************** + */ + +$("#reportID").change(function(){ + //updateParms; + if ($("#reportID").val() != "") { + $("#div_parm").html("
"+_("Refreshing Contents...")); + $.ajax({ + type: "GET", + url: "ajax_htmldata.php", + cache: false, + data: "action=getReportParameters&reportID=" + $("#reportID").val(), + success: function(html) { + $("#div_parm").html(html); + } + + + }); + }else{ + $("#div_parm").html(""); + } + + +}); + + + +function clearParms() { + + $("#reportID").val(""); + $("#div_parm").html(""); + + +} + + +function updateChildren(parmID){ + + //first get a list of this parm's children + $.ajax({ + type: "GET", + url: "ajax_htmldata.php", + cache: false, + data: "action=getChildParameters&parentReportParameterID=" + parmID, + success: function(childParms) { + var childParmArray = childParms.split("|"); + + for (var i=0; i=0; i--) + { + if(theSelFrom.options[i].selected) + { + selectedText[selectedCount] = theSelFrom.options[i].text; + selectedValues[selectedCount] = theSelFrom.options[i].value; + if (theSelFrom.length > 0){ + theSelFrom.options[i] = null; + } + selectedCount++; + } + } + + // Add the selected text/values in reverse order. + // This will add the Options to the 'to' Select + // This will add the Options to the 'to' Select + // in the same order as they were in the 'from' Select. + for(i=selectedCount-1; i>=0; i--) + { + theSelTo.options[theSelTo.length] = new Option(selectedText[i], selectedValues[i]); + } + +} + +function placeInHidden(delim, selStr, hidStr) +{ + var selObj = document.getElementById(selStr); + var hideObj = document.getElementById(hidStr); + hideObj.value = ''; + for (var i=0; i, all rights reserved + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +USA. + +=head1 NAME + +Javascript Gettext - Javascript implemenation of GNU Gettext API. + +=head1 SYNOPSIS + + // ////////////////////////////////////////////////////////// + // Optimum caching way + + + + var gt = new Gettext({ "domain" : "myDomain" }); + // rest is the same + + + // ////////////////////////////////////////////////////////// + // The reson the shortcuts aren't exported by default is because they'd be + // glued to the single domain you created. So, if you're adding i18n support + // to some js library, you should use it as so: + + if (typeof(MyNamespace) == 'undefined') MyNamespace = {}; + MyNamespace.MyClass = function () { + var gtParms = { "domain" : 'MyNamespace_MyClass' }; + this.gt = new Gettext(gtParams); + return this; + }; + MyNamespace.MyClass.prototype._ = function (msgid) { + return this.gt.gettext(msgid); + }; + MyNamespace.MyClass.prototype.something = function () { + var myString = this._("this will get translated"); + }; + + // ////////////////////////////////////////////////////////// + // Adding the shortcuts to a global scope is easier. If that's + // ok in your app, this is certainly easier. + var myGettext = new Gettext({ 'domain' : 'myDomain' }); + function _ (msgid) { + return myGettext.gettext(msgid); + } + alert( _("text") ); + + // ////////////////////////////////////////////////////////// + // Data structure of the json data + // NOTE: if you're loading via the + + // in domain.json + json_locale_data = { + "mydomain" : { + // po header fields + "" : { + "plural-forms" : "...", + "lang" : "en", + }, + // all the msgid strings and translations + "msgid" : [ "msgid_plural", "translation", "plural_translation" ], + }, + }; + // please see the included bin/po2json script for the details on this format + +This method also allows you to use unsupported file formats, so long as you can parse them into the above format. + +=item 2. Use AJAX to load language file. + +Use XMLHttpRequest (actually, SJAX - syncronous) to load an external resource. + +Supported external formats are: + +=over + +=item * Javascript Object Notation (.json) + +(see bin/po2json) + + type=application/json + +=item * Uniforum Portable Object (.po) + +(see GNU Gettext's xgettext) + + type=application/x-po + +=item * Machine Object (compiled .po) (.mo) + +NOTE: .mo format isn't actually supported just yet, but support is planned. + +(see GNU Gettext's msgfmt) + + type=application/x-mo + +=back + +=back + +=head1 METHODS + +The following methods are implemented: + + new Gettext(args) + textdomain (domain) + gettext (msgid) + dgettext (domainname, msgid) + dcgettext (domainname, msgid, LC_MESSAGES) + ngettext (msgid, msgid_plural, count) + dngettext (domainname, msgid, msgid_plural, count) + dcngettext (domainname, msgid, msgid_plural, count, LC_MESSAGES) + pgettext (msgctxt, msgid) + dpgettext (domainname, msgctxt, msgid) + dcpgettext (domainname, msgctxt, msgid, LC_MESSAGES) + npgettext (msgctxt, msgid, msgid_plural, count) + dnpgettext (domainname, msgctxt, msgid, msgid_plural, count) + dcnpgettext (domainname, msgctxt, msgid, msgid_plural, count, LC_MESSAGES) + strargs (string, args_array) + + +=head2 new Gettext (args) + +Several methods of loading locale data are included. You may specify a plugin or alternative method of loading data by passing the data in as the "locale_data" option. For example: + + var get_locale_data = function () { + // plugin does whatever to populate locale_data + return locale_data; + }; + var gt = new Gettext( 'domain' : 'messages', + 'locale_data' : get_locale_data() ); + +The above can also be used if locale data is specified in a statically included + @@ -71,7 +72,7 @@ @@ -79,8 +80,3 @@ - - - - - diff --git a/report.php b/report.php index 6f0f895..2e9ce69 100644 --- a/report.php +++ b/report.php @@ -57,7 +57,7 @@ header("Content-type: application/vnd.ms-excel;"); header("Content-Disposition: attachment; filename='" . strtr($reportHelper->report->getName(), ' ', '_') . "'"); - echo ""; + echo ""; } ?> @@ -93,14 +93,12 @@ type="hidden" name="useHidden" value=1> report->getName(); ?>  " style="border: none">
paramDisplay; ?> Modify - Parameters  Create New - Report
 
report->getDBName()); $reportArray = $reportHelper->getReportResults(false); - $textAdd = (($reportHelper->report->getID() === '1') || ($reportHelper->report->getID() === '2')) ? 'By Month and Resource' : ''; + $textAdd = (($reportHelper->report->getID() === '1') || ($reportHelper->report->getID() === '2')) ? _('By Month and Resource') : ''; if ($reportHelper->outputType === 'web'){ ?> -Number of Successful Full-Text Article Requests + @@ -146,7 +144,7 @@ - Number of Successful Full-Text Article Requests + @@ -164,7 +162,7 @@ ?> -Number of Successful Full-Text Article Requests from an Archive + @@ -183,7 +181,7 @@   - Number of Successful Full-Text Article Requests from an Archive + @@ -211,7 +209,7 @@ ?> - + - + - + - + - + - + - + - + numFields; ?>'>
Key
 Programmatically flagged as outlier based on previous 12 - month average. The number has not been adjusted.
 Programmatically flagged as outlier based on previous 12 - month average. The number has been adjusted manually by - Electronic Resources.
 Multiple titles with the same print ISSN (generally multiple - parts) have been merged together.
 Programmatically flagged as outlier using the following formula: Count is outlier[1]['overageCount']; ?> over outlier[1]['overagePercent']; ?>% of the previous 12 month average. outlier[1]['overageCount']._(" over "). $reportHelper->outlier[1]['overagePercent'] .'% '. _("of the previous 12 month average.");?>
 Programmatically flagged as outlier using the following formula: Count is outlier[2]['overageCount']; ?> over outlier[2]['overagePercent']; ?>% of the previous 12 month average. outlier[2]['overageCount']._(" over "). $reportHelper->outlier[2]['overagePercent'].'% '. _("of the previous 12 month average.");?>
 Programmatically flagged as outlier using the following formula: Count is outlier[3]['overageCount']; ?> over outlier[3]['overagePercent']; ?>% of the previous 12 month average. outlier[3]['overageCount']._(" over "). $reportHelper->outlier[3]['overagePercent'].'% '. _("of the previous 12 month average.");?>
 Multiple titles with the same print ISSN (generally multiple - parts) have been merged together.
- + - +
Color Background Key  Programmatically - flagged as outlier based on previous 12 month average. The - number has not been adjusted.
@@ -286,9 +277,7 @@          - Programmatically - flagged as outlier based on previous 12 month average. The - number has been adjusted manually by Electronic Resources. + @@ -299,9 +288,7 @@          - Multiple - titles with the same print ISSN (generally multiple parts) - have been merged together. + @@ -314,10 +301,10 @@ - + - +
Color Background Key  Programmatically flagged as outlier using the following formula: Count is outlier[1]['overageCount']; ?> over outlier[1]['overagePercent']; ?>% of the previous 12 month average. outlier[1]['overageCount']._(" over "). $reportHelper->outlier[1]['overagePercent'].'% '. _("of the previous 12 month average.");?>
@@ -329,7 +316,7 @@          - Programmatically flagged as outlier using the following formula: Count is outlier[2]['overageCount']; ?> over outlier[2]['overagePercent']; ?>% of the previous 12 month average. + outlier[2]['overageCount']._(" over "). $reportHelper->outlier[2]['overagePercent'].'% '._(" of the previous 12 month average.");?> @@ -341,7 +328,7 @@          - Programmatically flagged as outlier using the following formula: Count is outlier[3]['overageCount']; ?> over outlier[3]['overagePercent']; ?>% of the previous 12 month average. + outlier[3]['overageCount']._(" over "). $reportHelper->outlier[3]['overagePercent'].'% '. _("of the previous 12 month average.");?> @@ -352,9 +339,7 @@          - Multiple - titles with the same print ISSN (generally multiple parts) - have been merged together. + @@ -370,7 +355,7 @@

- report->printPlatformInfo($notes->platformNotes()); ?> @@ -382,7 +367,7 @@

Platform Interface Notes (if available) +
- + report->printPublisherInfo($notes->publisherNotes()); ?>
Publisher Notes (if available)
outputType === 'print') { ?> diff --git a/templates/header.php b/templates/header.php index a8d8447..e68ddc0 100644 --- a/templates/header.php +++ b/templates/header.php @@ -16,8 +16,6 @@ ************************************************************************************************************************** */ - - Config::init(); //get the current page to determine which menu button should be depressed @@ -49,7 +47,22 @@ + +getLanguage($str); + if($default_l==null || empty($default_l)){$default_l=$str;} + if(isset($_COOKIE["lang"])){ + if($_COOKIE["lang"]==$http_lang && $_COOKIE["lang"] != "en_US"){ + echo ""; + } + }else if($default_l==$http_lang && $default_l != "en_US"){ + echo ""; + } +?> -
+