From f4d24fafeee4f2361a998ffdd407364b0e0b8758 Mon Sep 17 00:00:00 2001 From: Cesar HERNANDEZ ANTONIO Date: Tue, 14 Apr 2015 15:37:26 +0200 Subject: [PATCH 01/10] Created file messages.po for translate this module --- locale/fr_FR/LC_MESSAGES/messages.mo | Bin 0 -> 517 bytes locale/fr_FR/LC_MESSAGES/messages.po | 16 ++++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 locale/fr_FR/LC_MESSAGES/messages.mo create mode 100644 locale/fr_FR/LC_MESSAGES/messages.po diff --git a/locale/fr_FR/LC_MESSAGES/messages.mo b/locale/fr_FR/LC_MESSAGES/messages.mo new file mode 100644 index 0000000000000000000000000000000000000000..a50b03241cc489fe6785250ceaf90804de3d1950 GIT binary patch literal 517 zcmZvY!A|Qi5Jf?-%91sUS-b@ZoWwv;aVbIsijY85P!Kybq(d8&*wNUf@cx6ZdjG(; zya|!o4I^FI*K@5o_V>p6*NW7tXjAk@v?kgWHPsdUljf1EO=eL;c5jpibv0Ix#J+IW zKtk}PqH zICL~F0_gZK)~U2wug=g@jbUmac}Gs>^Ldgv#xh~59S8Zmawb*{99Q0et$(cV@AaVF t_O~pYfZpyc9%kT`p9go#8TW3+Ib|)offjy2a8JnjbSMleH4sND{{aXPn05dF literal 0 HcmV?d00001 diff --git a/locale/fr_FR/LC_MESSAGES/messages.po b/locale/fr_FR/LC_MESSAGES/messages.po new file mode 100644 index 0000000..112387e --- /dev/null +++ b/locale/fr_FR/LC_MESSAGES/messages.po @@ -0,0 +1,16 @@ +msgid "" +msgstr "" +"Project-Id-Version: messages\n" +"POT-Creation-Date: 2015-04-14 15:33+0100\n" +"PO-Revision-Date: 2015-04-14 15:35+0100\n" +"Last-Translator: Cesar \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.6.10\n" +"X-Poedit-Basepath: /var/www/Coral/reports\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language: fr_FR\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-SearchPath-0: .\n" From 2c3c2adb23e87c8ccc10931c009ca92530263048 Mon Sep 17 00:00:00 2001 From: Cesar HERNANDEZ ANTONIO Date: Tue, 14 Apr 2015 16:37:49 +0200 Subject: [PATCH 02/10] Added menu to change language --- css/style.css | 22 ++++++++++++++++++++-- directory.php | 22 ++++++++++++++++++++++ index.php | 2 -- report.php | 2 +- templates/footer.php | 37 +++++++++++++++++++++++++++++++++++++ templates/header.php | 2 +- 6 files changed, 81 insertions(+), 6 deletions(-) diff --git a/css/style.css b/css/style.css index d538166..df6af6a 100644 --- a/css/style.css +++ b/css/style.css @@ -134,7 +134,7 @@ padding: 1px; font-weight: heavy; color: #3D545D; text-align:center; -align:center; +/*align:center;*/ } td.alt { @@ -183,4 +183,22 @@ color: white; select option { color: #3D545D; font-family: "arial"; font-size: 8pt; font-weight: medium; } .optionStyle { color: #3D545D; font-family: "arial"; font-size: 8pt; font-weight: medium; } - +/* 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%; +} \ No newline at end of file diff --git a/directory.php b/directory.php index 359d3ac..7abc3e5 100644 --- a/directory.php +++ b/directory.php @@ -56,4 +56,26 @@ function lcfirst($string) { } } +// Verify the language of the browser + if(isset($_COOKIE["lang"])){ + $http_lang = $_COOKIE["lang"]; + }else{ + $http_lang = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2); + } + switch ($http_lang) { + case 'fr': + $language = "fr_FR.utf8"; + break; + case 'en': + $language = "en_US.utf8"; + break; + default: + $language = "en_US.utf8"; + break; + } + putenv("LC_ALL =$language"); + setlocale(LC_ALL, $language); + bindtextdomain("messages", "./locale"); + textdomain("messages"); + ?> diff --git a/index.php b/index.php index 2818500..df12129 100644 --- a/index.php +++ b/index.php @@ -266,8 +266,6 @@ -
-
diff --git a/report.php b/report.php index 0387af8..d27de81 100644 --- a/report.php +++ b/report.php @@ -1098,7 +1098,7 @@ diff --git a/templates/footer.php b/templates/footer.php index 151d5ce..dc4b582 100644 --- a/templates/footer.php +++ b/templates/footer.php @@ -18,6 +18,43 @@ */ ?> +
+

+ +
+ \ No newline at end of file diff --git a/templates/header.php b/templates/header.php index 8e4ef1a..4c3d3ef 100644 --- a/templates/header.php +++ b/templates/header.php @@ -51,4 +51,4 @@ - + From b728f050bb56dc05dd7b3b9936d1f445782cc97e Mon Sep 17 00:00:00 2001 From: Cesar HERNANDEZ ANTONIO Date: Tue, 14 Apr 2015 17:15:50 +0200 Subject: [PATCH 03/10] Translate Started, changed all strings to format gettext --- admin/classes/common/DBService.php | 2 +- admin/classes/common/LdapPerson.php | 2 +- admin/classes/common/Object.php | 4 +- ajax_htmldata.php | 18 +++--- index.php | 20 +++--- locale/fr_FR/LC_MESSAGES/messages.mo | Bin 517 -> 1177 bytes locale/fr_FR/LC_MESSAGES/messages.po | 33 +++++++++- popup.php | 2 +- report.php | 88 +++++++++++++-------------- 9 files changed, 98 insertions(+), 71 deletions(-) diff --git a/admin/classes/common/DBService.php b/admin/classes/common/DBService.php index 6610508..e926d09 100644 --- a/admin/classes/common/DBService.php +++ b/admin/classes/common/DBService.php @@ -36,7 +36,7 @@ protected function dealloc() { protected function checkForError() { if ($this->error = mysql_error($this->db)) { - throw new Exception("There was a problem with the database: " . $this->error); + throw new Exception(_("There was a problem with the database: ") . $this->error); } } diff --git a/admin/classes/common/LdapPerson.php b/admin/classes/common/LdapPerson.php index 2205f10..c3238bc 100644 --- a/admin/classes/common/LdapPerson.php +++ b/admin/classes/common/LdapPerson.php @@ -31,7 +31,7 @@ public function __construct($userKey) { $ds = ldap_connect($config->ldap->host); //may need ldap_bind( $ds, $username, $password ) - $bd = ldap_bind($ds) or die("

Could not connect to " . $config->ldap->host . "

"); + $bd = ldap_bind($ds) or die("

"._("Could not connect to ") . $config->ldap->host . "

"); if ($bd){ $filter = $config->ldap->search_key . "=" . $userKey; diff --git a/admin/classes/common/Object.php b/admin/classes/common/Object.php index 653e9ce..7378c77 100644 --- a/admin/classes/common/Object.php +++ b/admin/classes/common/Object.php @@ -60,7 +60,7 @@ protected function setValueForKey($key, $value) { if (property_exists($this, $key)) { $this->$key = $value; } else { - throw new Exception("Cannot set value for undefined key ($key)."); + throw new Exception(_("Cannot set value for undefined key (").$key.")."); } } @@ -69,7 +69,7 @@ protected function valueForKey($key) { if (property_exists($this, $key)) { return $this->$key; } else { - throw new Exception("Cannot get value for undefined key ($key)."); + throw new Exception(_("Cannot get value for undefined key (").$key.")."); } } diff --git a/ajax_htmldata.php b/ajax_htmldata.php index fc7a4b8..43a7d4d 100644 --- a/ajax_htmldata.php +++ b/ajax_htmldata.php @@ -47,7 +47,7 @@ } if ($parm->requiredInd != '1'){ - echo "\n"; + echo "\n"; } $rownumber=1; @@ -66,14 +66,14 @@ echo "\n"; echo ""; echo ""; echo ""; echo ""; @@ -171,7 +171,7 @@ } if ($parm->requiredInd != '1'){ - echo "\n"; + echo "\n"; } $rownumber=1; @@ -190,14 +190,14 @@ echo "\n"; echo ""; echo ""; echo ""; echo ""; @@ -237,7 +237,7 @@ default: - echo "Action " . $action . " not set up!"; + echo _("Action ") . $action . _(" not set up!"); break; diff --git a/index.php b/index.php index df12129..8e6d46b 100644 --- a/index.php +++ b/index.php @@ -23,7 +23,7 @@ include_once 'directory.php'; //print header -$pageTitle='Home'; +$pageTitle=_('Home'); include 'templates/header.php'; @@ -58,7 +58,7 @@
- + \n"; if ($parm->requiredInd != '1'){ - echo "\n"; + echo "\n"; } @@ -201,7 +201,7 @@ echo "\n"; echo "\n"; echo ""; - echo "reportParameterID . "','none');toggleLayer('div_show_" . $parm->reportParameterID . "','block');\">-Hide " . $parm->parameterDisplayPrompt . "-"; + echo "reportParameterID . "','none');toggleLayer('div_show_" . $parm->reportParameterID . "','block');\">-"._("Hide ") . $parm->parameterDisplayPrompt . "-"; echo "\n"; echo "
"; echo ""; @@ -246,8 +246,8 @@

- - + + @@ -256,7 +256,7 @@
-Contact / Help + diff --git a/locale/fr_FR/LC_MESSAGES/messages.mo b/locale/fr_FR/LC_MESSAGES/messages.mo index a50b03241cc489fe6785250ceaf90804de3d1950..05d4dd3f685e5130d572c83c5b8b69dc3afff6d5 100644 GIT binary patch literal 1177 zcmZuwJ#Q015Iw$yX;5m4=>Xw7-$6j+LL!1m_)rj5Vh|l#-;M1>zTIPY&&CloB^?qC zbrOC8C9V)9J^zB9w_HdZ!AQ@0@08z*aR*BZvk(6z(rsmI0t+I zeC$`?2k;Fz4}3Zi1mA&OU;(~8RmZ=>>i6Gc{e|@-)`s^_2LVF=nCJ6`twTGBuQLF` zYHJUL8ZeFUTZsXu!MYlZq#XtuhE+BU9*eQq&WtP_6_s_=V`3$GBhE=G(k5p^eQju} zD{`7D%hZ0lwYC}2Lp|X!nC#E9Y?F{tQQ*v!#6U5ZjpaT3P}47YeJ{qg_CEyi`+rm!yT z8lmh+IBimDvlWK!pbbi>oOdFjoK{jtncqm3?hXneM^UDW)yC$*gu*V1BBet=rM`K& zvDJ9;=*jxgC6Xv^w6$`qka1d~bjNR8s~q9h%f3s-vRir9-3V_V#rewmY{GSw=^RZ= z>2^=L#*6R)D>ik>9nCognnbsvB*s?lhxdf#Qn+DCt+6nz$z;-MYa>Q2!+x4*=BR=j zZfH~3lvMf0wJX<`ss3EKqG*+ptIJ26+ZcYv5U8&;rMlR|jN2?sHtZm07^f69f?CN2 zQm)kuEw4e#LRx59sM)Unnv-CzagW(&XP89hHb|Kv5M`-T60Zv#yADj^$8P mU@U!!Qv4+|t@?6+u6lhU`#;oRDa~xpQebBLUer_G34Q~K$!lW( delta 107 zcmbQq*~(&ZPl#nI0}wC*u?!Ha05LNV>i{tbSOD>9prj>`2C0F8$;%jRSxl{rjVC{6 lQ~@zeC-XA}PcC9Q$?ubxmtLBfo@%9#Ruu0RG}(&T5&-155|ID^ diff --git a/locale/fr_FR/LC_MESSAGES/messages.po b/locale/fr_FR/LC_MESSAGES/messages.po index 112387e..aea1fdd 100644 --- a/locale/fr_FR/LC_MESSAGES/messages.po +++ b/locale/fr_FR/LC_MESSAGES/messages.po @@ -1,16 +1,43 @@ msgid "" msgstr "" "Project-Id-Version: messages\n" -"POT-Creation-Date: 2015-04-14 15:33+0100\n" -"PO-Revision-Date: 2015-04-14 15:35+0100\n" +"POT-Creation-Date: 2015-04-14 16:39+0100\n" +"PO-Revision-Date: 2015-04-14 16:40+0100\n" "Last-Translator: Cesar \n" "Language-Team: \n" +"Language: fr_FR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.6.10\n" "X-Poedit-Basepath: /var/www/Coral/reports\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"Language: fr_FR\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SearchPath-0: .\n" + +#: templates/footer.php:22 +msgid "Change language:" +msgstr "Changer la langue:" + +#: templates/footer.php:25 templates/footer.php:26 +msgid "French" +msgstr "Français" + +#: templates/footer.php:25 templates/footer.php:26 +msgid "English" +msgstr "Anglais" + +#: templates/header.php:54 +msgid "" +"JavaScript must be enabled in order for you to use CORAL. However, it seems " +"JavaScript is either disabled or not supported by your browser. To use " +"CORAL, enable JavaScript by changing your browser options, then " +msgstr "" +"JavaScript doit être activé pour utiliser CORAL. Cependant, on semble qui " +"JavaScript est desactivé ou n'est pas supporté par votre navigateur. Pour " +"utiliser CORAL, activez JavaScript en modifiant la configuration de votre " +"navigateur, après " + +#: templates/header.php:54 +msgid "try again" +msgstr "réessayez" diff --git a/popup.php b/popup.php index f3cdefb..d663c92 100644 --- a/popup.php +++ b/popup.php @@ -66,7 +66,7 @@ diff --git a/report.php b/report.php index d27de81..cef66eb 100644 --- a/report.php +++ b/report.php @@ -65,7 +65,7 @@ if ($titleID != ''){ $title = $report->getUsageTitle($titleID); - $paramDisplay = "Title: " . $title . "
"; + $paramDisplay = ""._("Title:")." " . $title . "
"; $rprt_prm_add = '&titleID=' . $titleID; $hidden_inputs .= ''; } @@ -96,13 +96,13 @@ if (($prm_value == 'on') || ($prm_value == 'Y')){ $showUnadjusted = 'Y'; $hidden_inputs .= ''; - $paramDisplay .= "Numbers are not adjusted for use violations
"; + $paramDisplay .= ""._("Numbers are not adjusted for use violations")."
"; } }else if ($parm->parameterAddWhereClause == 'limit'){ //decide what to do $add_where=''; $max_rows=$prm_value; - $paramDisplay = $paramDisplay . "Limit: Top " . $prm_value . "
"; + $paramDisplay = $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 @@ -270,10 +270,10 @@ reportName; ?>  -
+
- Modify Parameters  - Create New Report +   +

@@ -318,7 +318,7 @@ $fieldNameArray = array(); if (($reportID == '1') || ($reportID == '2')){ - $textAdd = "By Month and Resource"; + $textAdd = _("By Month and Resource"); } //archive loop @@ -332,7 +332,7 @@
- Number of Successful Full-Text Article Requests from an Archive + @@ -345,7 +345,7 @@ - Number of Successful Full-Text Article Requests from an Archive + @@ -361,7 +361,7 @@ ?> - Number of Successful Full-Text Article Requests + @@ -370,7 +370,7 @@ - Number of Successful Full-Text Article Requests + @@ -487,7 +487,7 @@ if (($outputType == 'web') && ($print_data != ' ')){ if ($field == 'TITLE'){ if ($reportID != '1'){ - $print_data .= "
view related titles"; + $print_data .= "
"._("view related titles").""; } //echo link resolver link @@ -516,7 +516,7 @@ $resolverURL .= $urlAdd; - $print_data .= "
view in link resolver"; + $print_data .= "
"._("view in link resolver").""; } @@ -592,7 +592,7 @@ $total=''; if ($index==0){ - $rowoutput[$groupRow] .= "Total for " . $hold_rprt_grpng_data . ""; + $rowoutput[$groupRow] .= ""._("Total for ") . $hold_rprt_grpng_data . ""; $index++; }else{ if ($sumColsArray[$sumfield] == 'dollarsum'){ @@ -739,7 +739,7 @@ $total=''; if ($index==0){ - echo "Total for " . $hold_rprt_grpng_data . ""; + echo ""._("Total for ") . $hold_rprt_grpng_data . ""; $index++; }else{ if ($sumColsArray[$sumfield] == 'dollarsum'){ @@ -782,7 +782,7 @@ if (($outputType != 'xls') && ($perform_subtotal_flag == 'Y')) { echo ""; - echo "Total for Report"; + echo ""._("Total for Report").""; $colNum=0; @@ -816,14 +816,14 @@ } if ($rowcount == 0){ - echo "Sorry, no rows were returned."; + echo ""._("Sorry, no rows were returned.").""; }else{ if ($endPage > $rowcount) $endPage = $rowcount; if ($outputType != 'web') $startPage=1; $endPage=$rowcount; if (($max_rows > 0) && ($rowcount > $max_rows)){ - echo "Showing rows $startPage to $max_rows of $max_rows"; + echo ""._("Showing rows ").$startPage._(" to ").$max_rows._(" of ").$max_rows.""; }else{ - echo "Showing rows $startPage to $rowcount of $rowcount"; + echo ""._("Showing rows ").$startPage._(" to ").$rowcount(" of ").$rowcount.""; } } @@ -851,7 +851,7 @@ ?> - + - + - + - + - + - + - + - + @@ -899,14 +899,14 @@ @@ -917,7 +917,7 @@ - +
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 over % of the previous 12 month average. %
 Programmatically flagged as outlier using the following formula: Count is over % of the previous 12 month average. %
 Programmatically flagged as outlier using the following formula: Count is over % 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.
        Programmatically flagged as outlier based on previous 12 month average. The number has been adjusted manually by Electronic Resources.
@@ -928,7 +928,7 @@          - Multiple titles with the same print ISSN (generally multiple parts) have been merged together. +   - Programmatically flagged as outlier using the following formula: Count is over % of the previous 12 month average. + % @@ -948,7 +948,7 @@          - Programmatically flagged as outlier using the following formula: Count is over % of the previous 12 month average. + % @@ -959,7 +959,7 @@          - Programmatically flagged as outlier using the following formula: Count is over % of the previous 12 month average. + % @@ -970,7 +970,7 @@          - Multiple titles with the same print ISSN (generally multiple parts) have been merged together. + "; - echo "Platform Interface Notes (if available)"; + echo ""._("Platform Interface Notes (if available)").""; foreach ($report->getPlatformInformation($platIDs) as $platform) { echo ""; echo "" . $platform['reportDisplayName'] . ""; if (($platform['startYear'] != '') && (($platform['endYear'] == '') || ($platform['endYear'] == '0'))){ - echo "Year: " . $platform['startYear'] . " to present"; + echo ""._("Year: ") . $platform['startYear'] . _(" to present").""; }else{ - echo "Years: " . $platform['startYear'] . " to " . $platform['endYear'] . ""; + echo ""._("Years: ") . $platform['startYear'] . _(" to ") . $platform['endYear'] . ""; } echo ""; if ($platform['counterCompliantInd'] == '1') { - echo "This Interface provides COUNTER compliant stats.
"; + echo _("This Interface provides COUNTER compliant stats.")."
"; }else{ - echo "This Interface does not provide COUNTER compliant stats.
"; + echo _("This Interface does not provide COUNTER compliant stats.")."
"; } if ($platform['noteText']){ - echo "
Interface Notes: " . $platform['noteText'] . "
"; + echo "
"._("Interface Notes").": " . $platform['noteText'] . "
"; } echo ""; echo ""; @@ -1055,7 +1055,7 @@ if (count($publisherArray) > 0){ echo ""; - echo ""; + echo ""; foreach ($publisherArray as $publisher) { @@ -1063,9 +1063,9 @@ echo ""; if (($publisher['startYear'] != '') && ($publisher['endYear'] == '')){ - echo ""; + echo ""; }else{ - echo ""; + echo ""; } echo ""; From ea9586e00c658d4aee299db32b12375d5317c55e Mon Sep 17 00:00:00 2001 From: Cesar HERNANDEZ ANTONIO Date: Wed, 15 Apr 2015 15:11:36 +0200 Subject: [PATCH 04/10] Fixed problem with the help message in report.php --- locale/fr_FR/LC_MESSAGES/messages.mo | Bin 1177 -> 5195 bytes locale/fr_FR/LC_MESSAGES/messages.po | 215 ++++++++++++++++++++++++++- report.php | 2 +- 3 files changed, 214 insertions(+), 3 deletions(-) diff --git a/locale/fr_FR/LC_MESSAGES/messages.mo b/locale/fr_FR/LC_MESSAGES/messages.mo index 05d4dd3f685e5130d572c83c5b8b69dc3afff6d5..16ae07032a4a1884455479c5707514868d881a4f 100644 GIT binary patch literal 5195 zcmcJSO^h5z6~_w_KC*l#5D1^;kgzt{ncX#Z;!JRq^~AkT zcXiKttRNvpe2EhvE*ye6pm=>iLg5q%`7m%vazT+mNGOVO2t<%02oVYKd)2)=Yb!(v zQd-;n@9yb(_3Hor@73EEZoK{{isMesPjf!^4y8_jk6p)wSL&Vv5}zYFU3D)lIM2|Nkjbc0f#1s?{PN_`Xj0Qh)~KLkI+^Upw;_cx%} z`z?3~{5vS~-ab?P{vgPo`UV%_r(eGxgSeo+1?~aA2QpM$28EwrgExWCfX@=U7eL|R zGC>nwo(9FgD>eQO6rP_2#qNuseD_yS?7a%!4PM7$gonf6ji3YN_s77yz#oC4muEoX z`!C?@R@g@1gqnNR1~!@naQ~_4dGjfagK+Cu0%9TL3=+UI5R4KL&-r zSHPp-tqi^w?1L@vN$?{05;y`MC)jJ?zrnrWGK*mfwF!P4{0=C7JORq@Pl4j^pTYg$ z%b?723na@tkAULW6QJn+7oh0rS0K_*6HvxK2THvE01^`QAMiHt1|}2UnjqndoQjS_ zEAyNZt1obhEwN8HqQ7FR!6~*DIS+8&&MA32$0HBzaVy-(K{(W{@s3;p_i=unQ#gDl=O;P057CEk zCWmNb`;fTHA#wRqyyK!XU+7>9T@Lps?Yo-G$mT%dtIIIA!DfY8N($#Qt(MYM9U1G> zJ}dg#WF5U~gD>;MsT?c25 z`+-#_vcl$FlkmAOY~Y#oxsEQzL%U~>I%!5`Ey>-m(1S7*dc$g)nT-@;T&8{Afpp<( z>`R%tWRdL$R+mmS^>M#x3CWyx5-B?fdY3I$X-K!1m-50TOulN*l{OSXzvThl+z-$< zmXf~1joLuaCbyAb(|MFY;#8D5@ftawMhynF!i`8$U!w}W*L5{YaH+&$a{_4_TArlRyAT6JhgzD@YajSeu@4nHo9D9W^O+*;&{KK1F5K z+uWjSNyC`ZqMAqHwsE4SzX%(lj|=No{W9SUTDH8 z!uCzdfyo!|zOOeR(VFmm@64%sE1^1=K}+vEw{$mu{@nYF`iGhl5#lN%1K#@ zGaIC30x@4QeUeVL5MJyT9Ib+k^d-fz8f=2=u~G2p_P|}=vQ9b%teUE8sCou!{{^v; zOW%OPScY^G)hj8X(UIBR?E~v00f#;a0c_^EiQA|&5#lQ^nId}HnKgOtCYN$LpPgo6 ziA=xNakhrKslY+((^gEjs)a1GK5I(7TFW!fv|0dRwbL2cM{uB^&4WIc#gbGn3<95k@_V~$BKmE>PhD+kBHH(jz%_n zX(nQY6s~>Nbv@)CyE_(st!bcDZK|CnZe`|E=~KAAXSVPY{xbc zH4Y}1X-w*tWU>`|5<8#-RBeeEk)DK5>&aHZI=gIBG>elhYWT7rY_MR+5$V&$P}$>C z-H1f(OWhAFC`PF={eKVa%#sHkAA+n=onqcBx&YE*iIWl(BP|LJRw17@D4O9h{*l$! z6;&;D>11p}HeajvhFO5HZC;vDQU4HqoyXiUJ0{grA^s`;~0^e1bC<11U>owc84RK z-?ZO&yBy4BX$zpb(nRg%Tb`E03&Kn&-6+ykwL9!QZ9jk<$+F#Hf;1<2^*S*L`_$@W z%Vn-``~yOU*Da7}HRi)kwOOTRQi+gBx9gIAyjAxj7f&LQR%L?52vMcy=mXsmd5q?p zQuMkGS>)XM6_KoT-SQZBk7J% znUgTaDj*t!=Zo8o5iVR~W!uD?9KJ3EV7rfsMX_$AL{{5{e@QZ2`n&2zoR{i56|p?c z@~1H)+`UJk@UKz=bZM132O2FdpU>90U~29V|g@mUxcfJ!}qOo)LX8Yl+`Oh6VZ z5ChdgfOAG-UV5rR4v;KOOi#69aLr54$t=!ba4Sm9OU{_g$##{qq^MFMF+DLeZ}MF( zD|QnFLo+L5%gJ)wiV(Jm!Dct^6h;+@QAI$rAjSa=a|9Zem{|-oEHUr!av*DRIp25g PqQfgwi;EL0Q>z#N{JuK9 diff --git a/locale/fr_FR/LC_MESSAGES/messages.po b/locale/fr_FR/LC_MESSAGES/messages.po index aea1fdd..f71b0c0 100644 --- a/locale/fr_FR/LC_MESSAGES/messages.po +++ b/locale/fr_FR/LC_MESSAGES/messages.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: messages\n" -"POT-Creation-Date: 2015-04-14 16:39+0100\n" -"PO-Revision-Date: 2015-04-14 16:40+0100\n" +"POT-Creation-Date: 2015-04-15 14:47+0100\n" +"PO-Revision-Date: 2015-04-15 15:09+0100\n" "Last-Translator: Cesar \n" "Language-Team: \n" "Language: fr_FR\n" @@ -15,6 +15,217 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SearchPath-0: .\n" +#: admin/classes/common/DBService.php:39 +msgid "There was a problem with the database: " +msgstr "Il y avait un problème avec la base de données: " + +#: admin/classes/common/LdapPerson.php:34 +msgid "Could not connect to " +msgstr "Ne pouvait pas se connecter à " + +#: admin/classes/common/Object.php:63 +msgid "Cannot set value for undefined key (" +msgstr "Ne pouvait pas asigner un valeur indefini (" + +#: admin/classes/common/Object.php:72 +msgid "Cannot get value for undefined key (" +msgstr "Ne peut pas récupérer le valeur par une clé indefini (" + +#: ajax_htmldata.php:50 ajax_htmldata.php:76 ajax_htmldata.php:174 +#: ajax_htmldata.php:200 index.php:107 index.php:159 +msgid "All" +msgstr "Tous" + +#: ajax_htmldata.php:69 ajax_htmldata.php:193 index.php:144 index.php:149 +msgid "Click to choose " +msgstr "Cliquez pour choisir " + +#: ajax_htmldata.php:103 ajax_htmldata.php:227 index.php:204 +msgid "Hide " +msgstr "Cacher " + +#: ajax_htmldata.php:240 +msgid "Action " +msgstr "Action " + +#: ajax_htmldata.php:240 +msgid " not set up!" +msgstr " ne pas etabli!" + +#: index.php:26 +msgid "Home" +msgstr "Accueil" + +#: index.php:61 +msgid "Select Report" +msgstr "Selectionner le Rapport" + +#: index.php:249 +msgid "Submit" +msgstr "Confirmer" + +#: index.php:250 +msgid "Reset" +msgstr "Réinitialiser" + +#: index.php:259 +msgid "Contact / Help" +msgstr "Contact / Aide" + +#: popup.php:69 +msgid "Invalid type!!" +msgstr "Type incorrect!!" + +#: report.php:68 +msgid "Title:" +msgstr "Titre:" + +#: report.php:99 +msgid "Numbers are not adjusted for use violations" +msgstr "Les nombres ne sont pas ajustés pour violations d'utilisation" + +#: report.php:105 +msgid "Limit:" +msgstr "Limit:" + +#: report.php:273 +msgid "Click to show information about this report" +msgstr "Clic pour montrer l'information à propos de ce rapport" + +#: report.php:275 +msgid "Modify Parameters" +msgstr "Modifier les paramètres" + +#: report.php:276 +msgid "Create New Report" +msgstr "Créer un Nouveau Rapport" + +#: report.php:321 +msgid "By Month and Resource" +msgstr "Par Mois et Ressource" + +#: report.php:335 report.php:348 +msgid "Number of Successful Full-Text Article Requests from an Archive " +msgstr "Nombre des Resultats des Articles rémplis correctement d'un dossier " + +#: report.php:364 report.php:373 +msgid "Number of Successful Full-Text Article Requests " +msgstr "Nombre des Resultats des Articles rémplis correctement " + +#: report.php:490 +msgid "view related titles" +msgstr "Regarder les titres connexes" + +#: report.php:519 +msgid "view in link resolver" +msgstr "Regarder dans le résoudre des liens" + +#: report.php:595 report.php:742 +msgid "Total for " +msgstr "Total pour " + +#: report.php:785 +msgid "Total for Report" +msgstr "Total par rapport" + +#: report.php:819 +msgid "Sorry, no rows were returned." +msgstr "Désolé, aucun résultat est retourné." + +#: report.php:824 report.php:826 +msgid "Showing rows " +msgstr "Rangées affichées " + +#: report.php:824 report.php:826 report.php:1013 report.php:1068 +msgid " to " +msgstr " par " + +#: report.php:824 +msgid " of " +msgstr " de " + +#: report.php:854 +msgid "Key" +msgstr "Clé" + +#: report.php:862 report.php:909 +msgid "" +"Programmatically flagged as outlier based on previous 12 month average. The " +"number has not been adjusted." +msgstr "" +"Programme marqué comme valeur aberrante basé en la moyenne précédente de 12 " +"mois. Le nombre n'a pas été ajusté." + +#: report.php:866 report.php:920 +msgid "" +"Programmatically flagged as outlier based on previous 12 month average. The " +"number has been adjusted manually by Electronic Resources." +msgstr "" +"Programme marqué comme valeur aberrante basé en la moyenne précédente de 12 " +"mois. Le nombre a été ajusté manuellemente par les Ressources Électroniques." + +#: report.php:870 report.php:887 report.php:931 report.php:973 +msgid "" +"Multiple titles with the same print ISSN (generally multiple parts) have " +"been merged together." +msgstr "" +"Multiples titres avec le même ISSN (géneralement multi parts) ont été " +"fusionnés." + +#: report.php:875 report.php:879 report.php:883 report.php:940 report.php:951 +#: report.php:962 +msgid "" +"Programmatically flagged as outlier using the following formula: Count is " +msgstr "" +"Programme marqué comme valeur aberrante basé dans la suivante formule: Comte " +"est " + +#: report.php:875 report.php:879 report.php:883 report.php:940 report.php:951 +#: report.php:962 +msgid " over " +msgstr " sur " + +#: report.php:875 report.php:879 report.php:883 report.php:940 report.php:951 +#: report.php:962 +msgid "of the previous 12 month average." +msgstr "de la moyenne de l'année précéndent." + +#: report.php:902 +msgid "Color Background Key" +msgstr "Coleur de la clé d'arrière" + +#: report.php:1004 +msgid "Platform Interface Notes (if available)" +msgstr "Notes de l'interface de la Plate-forme (s'il y a existant)" + +#: report.php:1011 report.php:1066 +msgid "Year: " +msgstr "Année: " + +#: report.php:1011 +msgid " to present" +msgstr " jusqu'à maintenant" + +#: report.php:1013 report.php:1068 +msgid "Years: " +msgstr "Années: " + +#: report.php:1018 +msgid "This Interface provides COUNTER compliant stats." +msgstr "Cette interface fournit des statistiques conformes à COUNTER." + +#: report.php:1020 +msgid "This Interface does not provide COUNTER compliant stats." +msgstr "Cette interface ne fournit pas des statistiques conformes à COUNTER." + +#: report.php:1025 +msgid "Interface Notes" +msgstr "Notes de l'interface" + +#: report.php:1058 +msgid "Publisher Notes (if available)" +msgstr "Notes de l'éditeur (s'il y a existants)" + #: templates/footer.php:22 msgid "Change language:" msgstr "Changer la langue:" diff --git a/report.php b/report.php index cef66eb..0e1e972 100644 --- a/report.php +++ b/report.php @@ -270,7 +270,7 @@ reportName; ?>  -
+ " style="border:none">
  From df950bfed8533e9eeb1929d442630bfb7f49c0b4 Mon Sep 17 00:00:00 2001 From: Cesar HERNANDEZ ANTONIO Date: Thu, 16 Apr 2015 16:32:38 +0200 Subject: [PATCH 05/10] Added Charset UTF-8 for export the report in French --- report.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/report.php b/report.php index 0e1e972..172de6f 100644 --- a/report.php +++ b/report.php @@ -244,7 +244,7 @@ header("Content-type: application/vnd.ms-excel;"); header("Content-Disposition: attachment; filename='" . $excelfile . "'"); - echo ""; + echo ""; } From 7e2f4c6306725520529bf91bb832bd4bfbcef0bb Mon Sep 17 00:00:00 2001 From: Cesar HERNANDEZ ANTONIO Date: Thu, 23 Apr 2015 17:13:10 +0200 Subject: [PATCH 06/10] Translated JavaScript and fixed CSS --- css/print.css | 1 - css/style.css | 10 +- js/common.js | 42 + js/index.js | 2 +- js/plugins/Gettext.js | 1265 ++++++++++++++++++++++++++ locale/fr_FR/LC_MESSAGES/messages.mo | Bin 5195 -> 5264 bytes locale/fr_FR/LC_MESSAGES/messages.po | 14 +- popup.php | 13 + templates/footer.php | 2 +- templates/header.php | 13 + 10 files changed, 1348 insertions(+), 14 deletions(-) create mode 100755 js/plugins/Gettext.js diff --git a/css/print.css b/css/print.css index 38e91d9..98a6629 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 df6af6a..4f6e6ee 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,7 +130,6 @@ border-right: 1px solid #C1DAD7; border-bottom: 1px solid #C1DAD7; background: #f5f8fb; padding: 1px; -font-weight: heavy; color: #3D545D; text-align:center; /*align:center;*/ @@ -180,8 +178,8 @@ a.headLink{ color: white; } -select option { color: #3D545D; font-family: "arial"; font-size: 8pt; font-weight: medium; } -.optionStyle { color: #3D545D; font-family: "arial"; font-size: 8pt; font-weight: medium; } +select option { color: #3D545D; font-family: "arial"; font-size: 8pt; } +.optionStyle { color: #3D545D; font-family: "arial"; font-size: 8pt; } /* Change language */ .dropDownLang{ diff --git a/js/common.js b/js/common.js index 8b8e86a..2808ccd 100644 --- a/js/common.js +++ b/js/common.js @@ -15,6 +15,48 @@ ************************************************************************************************************************** */ +function getCookie(keyCo){ + var valCookie= ""; + var search= keyCo + "="; + if(document.cookie.length > 0) { + pos=document.cookie.indexOf(search); + if (pos != -1) { + pos += search.length; + end= document.cookie.indexOf(";", pos); + if (end == -1) + end= document.cookie.length; + valCookie= unescape(document.cookie.substring(pos,end)) + } + } + return valCookie; +} + +function fLang() { + var langBrowser = ''; + // Search the language according to the browser + if(getCookie('lang')=='' || getCookie('lang')==undefined){ + if (navigator.languages==undefined) { + if (navigator.language==undefined) { + // Internet Explorer Compatibility + langBrowser= navigator.userLanguage.slice(0,2); + } else { + // Old navigator compatibility + langBrowser= navigator.language.slice(0,2); + } + } else { + // Recent navigators + langBrowser= navigator.languages[0].slice(0,2); + } + }else{ + langBrowser = getCookie('lang'); + } + return langBrowser; +} +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 259c37a..df08c85 100644 --- a/js/index.js +++ b/js/index.js @@ -32,7 +32,7 @@ $("#reportID").change(function () { function updateParms() { if ($("#reportID").val() != ""){ - $("#div_parm").html("
Refreshing Contents..."); + $("#div_parm").html("
"+_("Refreshing Contents...")); $.ajax({ type: "GET", url: "ajax_htmldata.php", diff --git a/js/plugins/Gettext.js b/js/plugins/Gettext.js new file mode 100755 index 0000000..8a905e6 --- /dev/null +++ b/js/plugins/Gettext.js @@ -0,0 +1,1265 @@ +/* +Pure Javascript implementation of Uniforum message translation. +Copyright (C) 2008 Joshua I. Miller , 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 + +"; + } + }else{ + $defLang = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2); + if($defLang=='fr'){ + echo ""; + } + } +?> diff --git a/templates/footer.php b/templates/footer.php index dc4b582..8f32685 100644 --- a/templates/footer.php +++ b/templates/footer.php @@ -50,7 +50,7 @@ function setLanguage(lang) { var wl = window.location, now = new Date(), time = now.getTime(); - var cookievalid=86400000; // 1 jour (1000*60*60*24) + var cookievalid=86400000; // 1 day (1000*60*60*24) time += cookievalid; now.setTime(time); document.cookie ='lang='+lang+';path=/'+';domain='+wl.host+';expires='+now; diff --git a/templates/header.php b/templates/header.php index 4c3d3ef..b7b9b6c 100644 --- a/templates/header.php +++ b/templates/header.php @@ -48,6 +48,19 @@ + +"; + } + }else{ + $defLang = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2); + if($defLang=='fr'){ + echo ""; + } + } +?> From 88a378b5be0cf02e5acdf988a57fe9d61a1b2b3e Mon Sep 17 00:00:00 2001 From: Cesar HERNANDEZ ANTONIO Date: Wed, 29 Apr 2015 14:14:17 +0200 Subject: [PATCH 07/10] Repository updated with the new changes of ndlibersa/reports and translate updated --- admin/classes/domain/ReportHelper.php | 20 +-- admin/classes/domain/ReportResult.php | 6 +- locale/fr_FR/LC_MESSAGES/messages.mo | Bin 5264 -> 4662 bytes locale/fr_FR/LC_MESSAGES/messages.po | 239 +++++++++++++------------- report.php | 2 +- templates/header.php | 1 + 6 files changed, 136 insertions(+), 132 deletions(-) diff --git a/admin/classes/domain/ReportHelper.php b/admin/classes/domain/ReportHelper.php index 6f212d0..0e0f402 100644 --- a/admin/classes/domain/ReportHelper.php +++ b/admin/classes/domain/ReportHelper.php @@ -158,14 +158,14 @@ public function process(ReportResult &$reportArray, ReportNotes &$notes){ if ($this->ID != '1') { $print_data .= '
view related titles'; + . '&outputType=web">'._("view related titles").''; } //echo link resolver link if ((($currentRow['PRINT_ISSN']) || ($currentRow['ONLINE_ISSN'])) && isset($this->baseURL)) { $print_data .= '
view in link resolver'; + . '">'._("view in link resolver").''; } } @@ -226,7 +226,7 @@ public function process(ReportResult &$reportArray, ReportNotes &$notes){ $rowoutput .= "
"; if ($countForGrouping > 1) { - $rowoutput .= ''; foreach($reportArray->fields as $field) { $rowoutput .= ''; foreach($reportArray->fields as $field) { $grp .= '"; } - echo ''; + echo ''; $total = ''; for ($colNum=1; $colNum < $reportArray->numFields; ++$colNum) { if(isset($this->sumColsArray[$reportArray->fields[$colNum]])){ @@ -282,9 +282,9 @@ public function process(ReportResult &$reportArray, ReportNotes &$notes){ } if ($rowNum === 0){ - echo ''; + echo ''; }else{ - echo ""; } else { @@ -346,7 +346,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->ID) @@ -361,13 +361,13 @@ private function loopThroughParams(){ if (($prm_value === 'on') || ($prm_value === 'Y')) { $this->showUnadjusted = true; $this->hidden_inputs->addParam($parm->reportParameterID,'Y'); - $this->paramDisplay .= 'Numbers are not adjusted for use violations
'; + $this->paramDisplay .= ''._("Numbers are not adjusted for use violations").'
'; } } else if ($parm->parameterAddWhereClause === 'limit') { //decide what to do $this->addWhere[0] = ''; //changed from $add_where. Assumed mistake. $this->maxRows = $prm_value; - $this->paramDisplay .= 'Limit: Top ' + $this->paramDisplay .= ''._("Limit:").''._(" Top ") . $prm_value . '
'; } else { diff --git a/admin/classes/domain/ReportResult.php b/admin/classes/domain/ReportResult.php index 25ef564..8d5a8d3 100644 --- a/admin/classes/domain/ReportResult.php +++ b/admin/classes/domain/ReportResult.php @@ -27,11 +27,11 @@ public function __construct($dbname,$sql) { Config::$database->password ); if ($this->db->errno) { - 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->$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->data = $this->db->query($this->sql,MYSQLI_USE_RESULT)) ) { - 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); } while($fld = $this->data->fetch_field()){ diff --git a/locale/fr_FR/LC_MESSAGES/messages.mo b/locale/fr_FR/LC_MESSAGES/messages.mo index 846a69620e0afe80503b5ea1d60186c83df25313..cd746db9ad43d771b04ece2c31e467eae7f0d8ab 100644 GIT binary patch delta 1340 zcmXxjPiPcp7{~EvW8yZOzb0ukYIG9gf8!Vx)PVmQ1wB|&wIW!=H9OS}ac7;K+33Zb zR1mS2Q7Hwn(nApsqKkrvcqk%N52Bz&tq0p26za+7rH6ihar3b6eBSqE^1jdeypyvF zZ*`5lZmK+QgiD)AJC`u)!`ewah-sB(RoI5LI2-xd5*|tHLA|;Lzr?lJh&#$=a53Wu zTkta0<1OU<5xY-k3KK6;3;v6faSXNbf5^`&80Zg^_!L`F8^1%n{~oo@81BU+lRDJ* zxE?Q{5_yL6v4YJ`vcD~&GswgZ+=}gAn9afi*or5RHSHqS;jd+{V>{z}$eQ*SYT+{{*jizB3dzYX*O)cn6;vX(QS{uj~|OKFQ~x)R-| zN<4!`ZsVcMl_b?44^=>+11uWveSXXVeZUlLyc+s;CPG!62z^VdHBhNsno2a6rdaYB zj=9s%JLcs4&?$JK6XiS134JGiQP~x5sk&LJn|wME|D4=VdYSw&5g)4lEk2g&jIX6S zEB&Gu#E(Y7p zrh8eh;}+9_J3Kt>_W412$PK)_AA|*Wu;Av0q666+-NTU=99=qCNSU)G9fh7U^_+aV z;CNwr|4^1>^Xb5`jRRrU&pEc!j|$e$%r-w;h-cQ-$7k!_md@1QPQ(q3b80j5qnx8u jvPCcMX>2W>X&g<&Vbi<#@8-GjjFttH3Q-V$)$;ZKn%k;g delta 1920 zcmaizU1(fI6vt;ZUu)WJHjQ7c)!An4Hm$Cy(KZH@N+=qs5o+tlOXa#d+updjceD52 zg+9o>2)?MPT!NsW5ep@G@Ph?yOX5!zb8Dwkeas(gv96wDu#*KF4!}8>f{RcBoQ7$50m=c(P!hNd`KjON zh^?-|4e&20{=IDa3T}du(63PZ*61YOpYX7%vyrI7EKI?@@Es@#eG7B2r$?z*;V_(n zr{EKCFsam?(1EwW*P$eI0c!1qw%{tQPsUv0dpmB4-|8(xO|)GKr% z)oi>z56MZLgcOMX5`0BfJ97Q^ro}B8pt3exlGalmvf_`3tOzPo!lz+| zTWp6xKl)2;-erNa)LD2dJP#$Im3ZSHP%_V;@BMHmlmib#Iq(FO1Xm!ct5qnE>?-8B zs2+lee;VfCW=NIPxagl{FbPFM4^p~FetBGy+%P6}6GsUq2T-vnVYx*flVFnAgV^1e zl;vJbl9DFnkOZWR@^<7bQL=s?-ENH1MNM9^v|SkLMeUxLLl7aNCVwd|7bV|Xxz=xH z$UUM)h16DT8>X=x*dR87-Jn!KZDP=F@>oPRY4R@GP2PYsDa`}Xh)z4MuRY`IppsGA zEor)%sRG|^b(N~|jN^yH9ofe%N46hfd(A2bMwi^G4xFMX*^Vjdm&`G}U5&RkNzChR z3J-LAw%#|@l2tHz()Eqk=<1wJBy>2}wKt&~-*mkxlTy#gqepE|PdM$pMb~&y%9W~H zvx`QLKXqvG;JyR8;7(V{w&idc-}1e@I{0tLc)xdDhp;!9O+9a{>X=pnZ%l{zEm=tHMn0n}mZyzxy;!zUkd&160uiucNk0{MGeNF7ucs}W zYdEABp6kt;NgPe!N8Z)uLLsO$7pe$fHX@rLg7^o-FO-`L+HR?ABd~b7LCvyT&X#8% zac~Trw&S(E;d1ZlK%}oER?bNVk?4)3b!SB3{i)HEF6Qtpx}IkfrtwAU2l?`0-)eo_ z_`c!jw)!Mfa)YW9pIoFCqPFe%_DsN};5xjBX-3>Pu1sG2H%dFi|GIZdW%J=%>23Xw VI!<%JP@2|2igPwS6kbk0`42y1S0?}f diff --git a/locale/fr_FR/LC_MESSAGES/messages.po b/locale/fr_FR/LC_MESSAGES/messages.po index b821635..690149a 100644 --- a/locale/fr_FR/LC_MESSAGES/messages.po +++ b/locale/fr_FR/LC_MESSAGES/messages.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: messages\n" -"POT-Creation-Date: 2015-04-23 17:03+0100\n" -"PO-Revision-Date: 2015-04-23 17:03+0100\n" +"POT-Creation-Date: 2015-04-29 13:47+0100\n" +"PO-Revision-Date: 2015-04-29 13:47+0100\n" "Last-Translator: Cesar \n" "Language-Team: \n" "Language: fr_FR\n" @@ -14,8 +14,14 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SearchPath-0: .\n" - -#: admin/classes/common/DBService.php:39 +"X-Poedit-SearchPathExcluded-0: /var/www/Coral/reports/js/plugins/jquery.js\n" + +#: admin/classes/common/DBService.php:33 admin/classes/common/DBService.php:36 +#: admin/classes/common/DBService.php:39 admin/classes/common/DBService.php:49 +#: admin/classes/common/DBService.php:55 admin/classes/common/DBService.php:79 +#: admin/classes/domain/ReportResult.php:30 +#: admin/classes/domain/ReportResult.php:32 +#: admin/classes/domain/ReportResult.php:34 msgid "There was a problem with the database: " msgstr "Il y avait un problème avec la base de données: " @@ -23,32 +29,69 @@ msgstr "Il y avait un problème avec la base de données: " msgid "Could not connect to " msgstr "Ne pouvait pas se connecter à " -#: admin/classes/common/Object.php:63 -msgid "Cannot set value for undefined key (" -msgstr "Ne pouvait pas asigner un valeur indefini (" +#: admin/classes/domain/ReportHelper.php:161 +msgid "view related titles" +msgstr "Regarder les titres connexes" + +#: admin/classes/domain/ReportHelper.php:168 +msgid "view in link resolver" +msgstr "Regarder dans le résoudre des liens" + +#: admin/classes/domain/ReportHelper.php:229 +#: admin/classes/domain/ReportHelper.php:259 +msgid "Total for " +msgstr "Total pour " + +#: admin/classes/domain/ReportHelper.php:270 +msgid "Total for Report" +msgstr "Total par rapport" + +#: admin/classes/domain/ReportHelper.php:285 +msgid "Sorry, no rows were returned." +msgstr "Désolé, aucun résultat est retourné." + +#: admin/classes/domain/ReportHelper.php:287 +msgid "Showing rows " +msgstr "Rangées affichées " + +#: admin/classes/domain/ReportHelper.php:287 +msgid " to " +msgstr " par " + +#: admin/classes/domain/ReportHelper.php:349 +msgid "Title:" +msgstr "Titre:" -#: admin/classes/common/Object.php:72 -msgid "Cannot get value for undefined key (" -msgstr "Ne peut pas récupérer le valeur par une clé indefini (" +#: admin/classes/domain/ReportHelper.php:364 +msgid "Numbers are not adjusted for use violations" +msgstr "Les nombres ne sont pas ajustés pour violations d'utilisation" + +#: admin/classes/domain/ReportHelper.php:370 +msgid "Limit:" +msgstr "Limit:" -#: ajax_htmldata.php:50 ajax_htmldata.php:76 ajax_htmldata.php:174 -#: ajax_htmldata.php:200 index.php:107 index.php:159 +#: admin/classes/domain/ReportHelper.php:370 +msgid " Top " +msgstr " Haute " + +#: ajax_htmldata.php:55 ajax_htmldata.php:91 ajax_htmldata.php:181 +#: ajax_htmldata.php:213 msgid "All" msgstr "Tous" -#: ajax_htmldata.php:69 ajax_htmldata.php:193 index.php:144 index.php:149 +#: ajax_htmldata.php:81 ajax_htmldata.php:202 msgid "Click to choose " msgstr "Cliquez pour choisir " -#: ajax_htmldata.php:103 ajax_htmldata.php:227 index.php:204 +#: ajax_htmldata.php:129 ajax_htmldata.php:249 msgid "Hide " msgstr "Cacher " -#: ajax_htmldata.php:240 +#: ajax_htmldata.php:254 msgid "Action " msgstr "Action " -#: ajax_htmldata.php:240 +#: ajax_htmldata.php:254 msgid " not set up!" msgstr " ne pas etabli!" @@ -56,19 +99,19 @@ msgstr " ne pas etabli!" msgid "Home" msgstr "Accueil" -#: index.php:61 +#: index.php:55 msgid "Select Report" msgstr "Selectionner le Rapport" -#: index.php:249 +#: index.php:261 msgid "Submit" msgstr "Confirmer" -#: index.php:250 +#: index.php:262 msgid "Reset" msgstr "Réinitialiser" -#: index.php:259 +#: index.php:270 msgid "Contact / Help" msgstr "Contact / Aide" @@ -76,79 +119,35 @@ msgstr "Contact / Aide" msgid "Invalid type!!" msgstr "Type incorrect!!" -#: report.php:68 -msgid "Title:" -msgstr "Titre:" - -#: report.php:99 -msgid "Numbers are not adjusted for use violations" -msgstr "Les nombres ne sont pas ajustés pour violations d'utilisation" - -#: report.php:105 -msgid "Limit:" -msgstr "Limit:" - -#: report.php:273 +#: report.php:92 msgid "Click to show information about this report" msgstr "Clic pour montrer l'information à propos de ce rapport" -#: report.php:275 +#: report.php:94 msgid "Modify Parameters" msgstr "Modifier les paramètres" -#: report.php:276 +#: report.php:95 msgid "Create New Report" msgstr "Créer un Nouveau Rapport" -#: report.php:321 +#: report.php:121 msgid "By Month and Resource" msgstr "Par Mois et Ressource" -#: report.php:335 report.php:348 -msgid "Number of Successful Full-Text Article Requests from an Archive " -msgstr "Nombre des Resultats des Articles rémplis correctement d'un dossier " - -#: report.php:364 report.php:373 -msgid "Number of Successful Full-Text Article Requests " -msgstr "Nombre des Resultats des Articles rémplis correctement " - -#: report.php:490 -msgid "view related titles" -msgstr "Regarder les titres connexes" - -#: report.php:519 -msgid "view in link resolver" -msgstr "Regarder dans le résoudre des liens" - -#: report.php:595 report.php:742 -msgid "Total for " -msgstr "Total pour " - -#: report.php:785 -msgid "Total for Report" -msgstr "Total par rapport" - -#: report.php:819 -msgid "Sorry, no rows were returned." -msgstr "Désolé, aucun résultat est retourné." - -#: report.php:824 report.php:826 -msgid "Showing rows " -msgstr "Rangées affichées " - -#: report.php:824 report.php:826 report.php:1013 report.php:1068 -msgid " to " -msgstr " par " +#: report.php:126 report.php:139 +msgid "Number of Successful Full-Text Article Requests" +msgstr "Nombre des Resultats des Articles rémplis correctement" -#: report.php:824 -msgid " of " -msgstr " de " +#: report.php:156 report.php:171 +msgid "Number of Successful Full-Text Article Requests from an Archive" +msgstr "Nombre des Resultats des Articles d'un archive rémplis correctement" -#: report.php:854 +#: report.php:202 msgid "Key" msgstr "Clé" -#: report.php:862 report.php:909 +#: report.php:210 report.php:255 msgid "" "Programmatically flagged as outlier based on previous 12 month average. The " "number has not been adjusted." @@ -156,7 +155,7 @@ msgstr "" "Programme marqué comme valeur aberrante basé en la moyenne précédente de 12 " "mois. Le nombre n'a pas été ajusté." -#: report.php:866 report.php:920 +#: report.php:214 report.php:266 msgid "" "Programmatically flagged as outlier based on previous 12 month average. The " "number has been adjusted manually by Electronic Resources." @@ -164,7 +163,7 @@ msgstr "" "Programme marqué comme valeur aberrante basé en la moyenne précédente de 12 " "mois. Le nombre a été ajusté manuellemente par les Ressources Électroniques." -#: report.php:870 report.php:887 report.php:931 report.php:973 +#: report.php:218 report.php:235 report.php:277 report.php:326 msgid "" "Multiple titles with the same print ISSN (generally multiple parts) have " "been merged together." @@ -172,57 +171,33 @@ msgstr "" "Multiples titres avec le même ISSN (géneralement multi parts) ont été " "fusionnés." -#: report.php:875 report.php:879 report.php:883 report.php:940 report.php:951 -#: report.php:962 +#: report.php:223 report.php:227 report.php:231 report.php:293 report.php:304 +#: report.php:315 msgid "" -"Programmatically flagged as outlier using the following formula: Count is " +"Programmatically flagged as outlier using the following formula: Count is" msgstr "" "Programme marqué comme valeur aberrante basé dans la suivante formule: Comte " -"est " +"est" -#: report.php:875 report.php:879 report.php:883 report.php:940 report.php:951 -#: report.php:962 -msgid " over " -msgstr " sur " +#: report.php:223 report.php:227 report.php:231 report.php:293 report.php:304 +#: report.php:315 +msgid "over" +msgstr "sur" -#: report.php:875 report.php:879 report.php:883 report.php:940 report.php:951 -#: report.php:962 +#: report.php:223 report.php:227 report.php:231 report.php:293 report.php:304 +#: report.php:315 msgid "of the previous 12 month average." msgstr "de la moyenne de l'année précéndent." -#: report.php:902 +#: report.php:253 report.php:291 msgid "Color Background Key" msgstr "Coleur de la clé d'arrière" -#: report.php:1004 +#: report.php:344 msgid "Platform Interface Notes (if available)" msgstr "Notes de l'interface de la Plate-forme (s'il y a existant)" -#: report.php:1011 report.php:1066 -msgid "Year: " -msgstr "Année: " - -#: report.php:1011 -msgid " to present" -msgstr " jusqu'à maintenant" - -#: report.php:1013 report.php:1068 -msgid "Years: " -msgstr "Années: " - -#: report.php:1018 -msgid "This Interface provides COUNTER compliant stats." -msgstr "Cette interface fournit des statistiques conformes à COUNTER." - -#: report.php:1020 -msgid "This Interface does not provide COUNTER compliant stats." -msgstr "Cette interface ne fournit pas des statistiques conformes à COUNTER." - -#: report.php:1025 -msgid "Interface Notes" -msgstr "Notes de l'interface" - -#: report.php:1058 +#: report.php:356 msgid "Publisher Notes (if available)" msgstr "Notes de l'éditeur (s'il y a existants)" @@ -238,7 +213,7 @@ msgstr "Français" msgid "English" msgstr "Anglais" -#: templates/header.php:67 +#: templates/header.php:66 msgid "" "JavaScript must be enabled in order for you to use CORAL. However, it seems " "JavaScript is either disabled or not supported by your browser. To use " @@ -249,10 +224,38 @@ msgstr "" "utiliser CORAL, activez JavaScript en modifiant la configuration de votre " "navigateur, après " -#: templates/header.php:67 +#: templates/header.php:66 msgid "try again" msgstr "réessayez" -#: js/index.js:35 +#: js/index.js:21 msgid "Refreshing Contents..." msgstr "Rechargements des contenus..." + +#~ msgid "Cannot set value for undefined key (" +#~ msgstr "Ne pouvait pas asigner un valeur indefini (" + +#~ msgid "Cannot get value for undefined key (" +#~ msgstr "Ne peut pas récupérer le valeur par une clé indefini (" + +#~ msgid " of " +#~ msgstr " de " + +#~ msgid "Year: " +#~ msgstr "Année: " + +#~ msgid " to present" +#~ msgstr " jusqu'à maintenant" + +#~ msgid "Years: " +#~ msgstr "Années: " + +#~ msgid "This Interface provides COUNTER compliant stats." +#~ msgstr "Cette interface fournit des statistiques conformes à COUNTER." + +#~ msgid "This Interface does not provide COUNTER compliant stats." +#~ msgstr "" +#~ "Cette interface ne fournit pas des statistiques conformes à COUNTER." + +#~ msgid "Interface Notes" +#~ msgstr "Notes de l'interface" diff --git a/report.php b/report.php index 4abc86d..8a574f6 100644 --- a/report.php +++ b/report.php @@ -43,7 +43,7 @@ outputType==='pop'){ +}else if($report->outputType==='pop'){ $pageTitle = $report->report->reportName; include 'templates/header.php'; }else{ diff --git a/templates/header.php b/templates/header.php index beed485..e5078f5 100644 --- a/templates/header.php +++ b/templates/header.php @@ -46,6 +46,7 @@ + Date: Wed, 20 May 2015 11:02:49 +0200 Subject: [PATCH 08/10] Fixed issues to add new languages and deleted unused JavaScript functions to translate this module --- LangCodes.php | 23 ++++++++ directory.php | 35 +++++------- index.php | 70 ++++++++++++++++++++--- js/common.js | 41 ++------------ locale/fr_FR/LC_MESSAGES/messages.mo | Bin 4662 -> 4751 bytes locale/fr_FR/LC_MESSAGES/messages.po | 80 ++++++++++----------------- popup.php | 12 ---- report.php | 54 +++++++++--------- templates/footer.php | 37 ------------- templates/header.php | 22 ++++---- 10 files changed, 172 insertions(+), 202 deletions(-) create mode 100644 LangCodes.php 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/directory.php b/directory.php index 7abc3e5..5af0140 100644 --- a/directory.php +++ b/directory.php @@ -56,26 +56,21 @@ function lcfirst($string) { } } +// Include file of language codes +include_once 'LangCodes.php'; +$lang_name = new LangCodes(); + // Verify the language of the browser - if(isset($_COOKIE["lang"])){ - $http_lang = $_COOKIE["lang"]; - }else{ - $http_lang = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2); - } - switch ($http_lang) { - case 'fr': - $language = "fr_FR.utf8"; - break; - case 'en': - $language = "en_US.utf8"; - break; - default: - $language = "en_US.utf8"; - break; - } - putenv("LC_ALL =$language"); - setlocale(LC_ALL, $language); - bindtextdomain("messages", "./locale"); - textdomain("messages"); +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 fbf813e..39e7810 100644 --- a/index.php +++ b/index.php @@ -52,7 +52,7 @@
- +

- - + +
Publisher Notes (if available)
"._("Publisher Notes (if available)")."
" . $publisher['reportDisplayName'] . "Year: " . $publisher['startYear'] . ""._("Year: ") . $publisher['startYear'] . "Years: " . $publisher['startYear'] . " to " . $publisher['endYear'] . ""._("Years: ") . $publisher['startYear'] . _(" to ") . $publisher['endYear'] . "" . $publisher['notes'] . "
Total for ' + $rowoutput .= '
'._("Total for ") . $hold_rprt_grpng_data . '' @@ -256,7 +256,7 @@ public function process(ReportResult &$reportArray, ReportNotes &$notes){ if ($this->report->groupTotalInd === '1' && $hold_rprt_grpng_data) { // one last grouping summary if ($countForGrouping > 1) { - $grp .= '
Total for ' + $grp .= '
'._("Total for ") . $hold_rprt_grpng_data . '' @@ -267,7 +267,7 @@ public function process(ReportResult &$reportArray, ReportNotes &$notes){ } echo "
 
Total for Report
'._("Total for Report").'
Sorry, no rows were returned.
'._("Sorry, no rows were returned.").'
Showing rows {$this->startPage} to "; + echo "
"._("Showing rows ").$this->startPage._(" to "); if (($this->maxRows>0)&&($rowNum>$this->maxRows)){ echo "$this->maxRows of $this->maxRows
@@ -267,7 +267,7 @@
- + @@ -275,7 +275,63 @@

+
+

+ +
+ diff --git a/js/common.js b/js/common.js index 587e3e3..fad33d3 100644 --- a/js/common.js +++ b/js/common.js @@ -15,43 +15,10 @@ ************************************************************************************************************************** */ -function getCookie(keyCo){ - var valCookie= ""; - var search= keyCo + "="; - if(document.cookie.length > 0) { - pos=document.cookie.indexOf(search); - if (pos != -1) { - pos += search.length; - end= document.cookie.indexOf(";", pos); - if (end == -1) - end= document.cookie.length; - valCookie= unescape(document.cookie.substring(pos,end)) - } - } - return valCookie; -} - -function fLang() { - var langBrowser = ''; - // Search the language according to the browser - if(getCookie('lang')=='' || getCookie('lang')==undefined){ - if (navigator.languages==undefined) { - if (navigator.language==undefined) { - // Internet Explorer Compatibility - langBrowser= navigator.userLanguage.slice(0,2); - } else { - // Old navigator compatibility - langBrowser= navigator.language.slice(0,2); - } - } else { - // Recent navigators - langBrowser= navigator.languages[0].slice(0,2); - } - }else{ - langBrowser = getCookie('lang'); - } - return langBrowser; -} +/* + * gt : Object to translate JavaScript strings + * function _() : Syntax of gettext + */ var gt = new Gettext({ 'domain' : 'messages' }); function _(msgid) { return gt.gettext(msgid); diff --git a/locale/fr_FR/LC_MESSAGES/messages.mo b/locale/fr_FR/LC_MESSAGES/messages.mo index cd746db9ad43d771b04ece2c31e467eae7f0d8ab..a1bd81178b46ddd16a5efe6924c9ebfd23c51765 100644 GIT binary patch delta 1236 zcmZY8O-PhM9LMolUCq_?Ww%_j7kzw7H&b^v%#hfy2oka&@X|qe(j_-^H}-jU=@3YV z=pYoebcv!Dx^$Gy4j!TiA|!&y4uN`#4hBI&FPEtAPgV%}vooKW;dy4}`Ooar_Uj!p zt3mHALqsUMD0e)@996rNisjQKz#z`z&Oguk&I%UD$l`>7Z*LEM22s0m{D9*0mHsOKfU*GQ%LEF8la_TddY zj4x0d@~~JZ>zf`LR~Z<^^SFY;c)Y@xCcKFuoI}RUK~2T(_xLS=9kXPRl;rqPHCs0o*lHO+Fd|GDT_>}LE2>PuQl!*|?|+CZ3D z^~Jro9s6+FT(@WWmwqipI zDQnsgN565V+KfVTDU%A_6)k2_6s;5;3sak&lT-?&OJBrso4pi;ZtXsbZoMv`Qmjqs z3l!S8vchR>M7U@N>X{p3mk34q+e1M}1MJJ~7M cb{%UX;aGP5Tuu1D!NR?oT!|-B2n8(9UoakubpQYW delta 1181 zcmZA0OGs2v9LMqhjAJ%BYHInYMz5yTsFO33AsQ8-n-=z%D1sssyoC|XVjf#p6$Ig8 zD%wOzD``gM9^bXP(dXWxhSYrQ!Rq}{_IN7pL@>doWq^-_@6tI9kcBd^R>-UB2Hv11{DRA{h+6m;@|d5FeprStupYJWXVm*&QS%h>D3&p(Lmk5%cnP(Um$(7_ zEOwUlt&_$H25#dn3@4qD!l?HWs0|;+1iGjV zT}BRXSCPkVQ0Z#!p}v^~)YW{dA^+_(zA>N_HIYC502ZYzMVr^qLOP{3#1)%E(RC>_ znKG#0@V1_!6f1P++O)1_HASJr=-cuiqKZ%ynw6#8-$%8ULN%0~x9(VcG%{4Q)Qy%k9GMic!`eDgqWUso(1 zibpC0fbh33IG5A diff --git a/locale/fr_FR/LC_MESSAGES/messages.po b/locale/fr_FR/LC_MESSAGES/messages.po index 690149a..8c18815 100644 --- a/locale/fr_FR/LC_MESSAGES/messages.po +++ b/locale/fr_FR/LC_MESSAGES/messages.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: messages\n" -"POT-Creation-Date: 2015-04-29 13:47+0100\n" -"PO-Revision-Date: 2015-04-29 13:47+0100\n" +"POT-Creation-Date: 2015-05-20 11:01+0100\n" +"PO-Revision-Date: 2015-05-20 11:01+0100\n" "Last-Translator: Cesar \n" "Language-Team: \n" "Language: fr_FR\n" @@ -16,6 +16,14 @@ msgstr "" "X-Poedit-SearchPath-0: .\n" "X-Poedit-SearchPathExcluded-0: /var/www/Coral/reports/js/plugins/jquery.js\n" +#: LangCodes.php:17 +msgid "French" +msgstr "Français" + +#: LangCodes.php:18 +msgid "English" +msgstr "Anglais" + #: admin/classes/common/DBService.php:33 admin/classes/common/DBService.php:36 #: admin/classes/common/DBService.php:39 admin/classes/common/DBService.php:49 #: admin/classes/common/DBService.php:55 admin/classes/common/DBService.php:79 @@ -75,11 +83,11 @@ msgid " Top " msgstr " Haute " #: ajax_htmldata.php:55 ajax_htmldata.php:91 ajax_htmldata.php:181 -#: ajax_htmldata.php:213 +#: ajax_htmldata.php:213 index.php:111 index.php:167 msgid "All" msgstr "Tous" -#: ajax_htmldata.php:81 ajax_htmldata.php:202 +#: ajax_htmldata.php:81 ajax_htmldata.php:202 index.php:149 msgid "Click to choose " msgstr "Cliquez pour choisir " @@ -101,7 +109,7 @@ msgstr "Accueil" #: index.php:55 msgid "Select Report" -msgstr "Selectionner le Rapport" +msgstr "Selectionner le rapport" #: index.php:261 msgid "Submit" @@ -115,7 +123,15 @@ msgstr "Réinitialiser" msgid "Contact / Help" msgstr "Contact / Aide" -#: popup.php:82 +#: index.php:279 +msgid "Change language:" +msgstr "Changer la langue:" + +#: index.php:295 +msgid "Invalid translation route!" +msgstr "Le chemin aux traductions n'est pas valide!" + +#: popup.php:70 msgid "Invalid type!!" msgstr "Type incorrect!!" @@ -129,19 +145,19 @@ msgstr "Modifier les paramètres" #: report.php:95 msgid "Create New Report" -msgstr "Créer un Nouveau Rapport" +msgstr "Créer un nouveau rapport" #: report.php:121 msgid "By Month and Resource" -msgstr "Par Mois et Ressource" +msgstr "Par mois et ressource" #: report.php:126 report.php:139 msgid "Number of Successful Full-Text Article Requests" -msgstr "Nombre des Resultats des Articles rémplis correctement" +msgstr "Nombre des résultats des articles rémplis correctement" #: report.php:156 report.php:171 msgid "Number of Successful Full-Text Article Requests from an Archive" -msgstr "Nombre des Resultats des Articles d'un archive rémplis correctement" +msgstr "Nombre des résultats des articles d'un archive rémplis correctement" #: report.php:202 msgid "Key" @@ -201,19 +217,7 @@ msgstr "Notes de l'interface de la Plate-forme (s'il y a existant)" msgid "Publisher Notes (if available)" msgstr "Notes de l'éditeur (s'il y a existants)" -#: templates/footer.php:22 -msgid "Change language:" -msgstr "Changer la langue:" - -#: templates/footer.php:25 templates/footer.php:26 -msgid "French" -msgstr "Français" - -#: templates/footer.php:25 templates/footer.php:26 -msgid "English" -msgstr "Anglais" - -#: templates/header.php:66 +#: templates/header.php:68 msgid "" "JavaScript must be enabled in order for you to use CORAL. However, it seems " "JavaScript is either disabled or not supported by your browser. To use " @@ -224,38 +228,10 @@ msgstr "" "utiliser CORAL, activez JavaScript en modifiant la configuration de votre " "navigateur, après " -#: templates/header.php:66 +#: templates/header.php:68 msgid "try again" msgstr "réessayez" #: js/index.js:21 msgid "Refreshing Contents..." msgstr "Rechargements des contenus..." - -#~ msgid "Cannot set value for undefined key (" -#~ msgstr "Ne pouvait pas asigner un valeur indefini (" - -#~ msgid "Cannot get value for undefined key (" -#~ msgstr "Ne peut pas récupérer le valeur par une clé indefini (" - -#~ msgid " of " -#~ msgstr " de " - -#~ msgid "Year: " -#~ msgstr "Année: " - -#~ msgid " to present" -#~ msgstr " jusqu'à maintenant" - -#~ msgid "Years: " -#~ msgstr "Années: " - -#~ msgid "This Interface provides COUNTER compliant stats." -#~ msgstr "Cette interface fournit des statistiques conformes à COUNTER." - -#~ msgid "This Interface does not provide COUNTER compliant stats." -#~ msgstr "" -#~ "Cette interface ne fournit pas des statistiques conformes à COUNTER." - -#~ msgid "Interface Notes" -#~ msgstr "Notes de l'interface" diff --git a/popup.php b/popup.php index fbd56e7..8a35bea 100644 --- a/popup.php +++ b/popup.php @@ -40,18 +40,6 @@ -"; - } - }else{ - $defLang = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2); - if($defLang=='fr'){ - echo ""; - } - } -?> diff --git a/report.php b/report.php index 8a574f6..9974afd 100644 --- a/report.php +++ b/report.php @@ -63,7 +63,7 @@ . strtr($report->report->reportName,' ','_') . "'"); - echo ""; + echo ""; } @@ -89,10 +89,10 @@ report->reportName; ?>  - " style="border:none">
+ " style="border:none">
paramDisplay; ?> -   - +   +

@@ -123,7 +123,7 @@ ?> - + @@ -136,7 +136,7 @@ - + @@ -153,7 +153,7 @@ if ($report->outputType === 'web') { ?> - + @@ -168,7 +168,7 @@   - + @@ -199,7 +199,7 @@ ?> - + - + - + - + - + - + - + - +
 
 
 
 outlier[1]['overageCount'].' '._("over").' '.$report->outlier[1]['overagePercent'].' % '._("of the previous 12 month average.");?> outlier[1]['overageCount'].' '._("over").' '.$report->outlier[1]['overagePercent'].' % '._("of the previous 12 month average.");?>
 outlier[2]['overageCount'].' '._("over").' '.$report->outlier[2]['overagePercent'].' % '._("of the previous 12 month average.");?> outlier[2]['overageCount'].' '._("over").' '.$report->outlier[2]['overagePercent'].' % '._("of the previous 12 month average.");?>
 outlier[3]['overageCount'].' '._("over").' '.$report->outlier[3]['overagePercent'].' % '._("of the previous 12 month average.");?> outlier[3]['overageCount'].' '._("over").' '.$report->outlier[3]['overagePercent'].' % '._("of the previous 12 month average.");?>
 
@@ -250,9 +250,9 @@ - + - +
 
@@ -263,7 +263,7 @@          - + @@ -274,7 +274,7 @@          - + @@ -288,9 +288,9 @@ - + - +
 outlier[1]['overageCount'].' '._("over").' '.$report->outlier[1]['overagePercent'].' % '._("of the previous 12 month average.");?> outlier[1]['overageCount'].' '._("over").' '.$report->outlier[1]['overagePercent'].' % '._("of the previous 12 month average.");?>
@@ -301,7 +301,7 @@          - outlier[2]['overageCount'].' '._("over").' '.$report->outlier[2]['overagePercent'].' % '._("of the previous 12 month average.");?> + outlier[2]['overageCount'].' '._("over").' '.$report->outlier[2]['overagePercent'].' % '._("of the previous 12 month average.");?> @@ -312,7 +312,7 @@          - outlier[3]['overageCount'].' '._("over").' '.$report->outlier[3]['overagePercent'].' % '._("of the previous 12 month average.");?> + outlier[3]['overageCount'].' '._("over").' '.$report->outlier[3]['overagePercent'].' % '._("of the previous 12 month average.");?> @@ -323,7 +323,7 @@          - + @@ -341,7 +341,7 @@ report->printPlatformInfo($notes->platformNotes()); ?> @@ -353,7 +353,7 @@
- +
report->printPublisherInfo($notes->publisherNotes()); ?> diff --git a/templates/footer.php b/templates/footer.php index 8f32685..151d5ce 100644 --- a/templates/footer.php +++ b/templates/footer.php @@ -18,43 +18,6 @@ */ ?> -
-

- -
- \ No newline at end of file diff --git a/templates/header.php b/templates/header.php index e5078f5..e68ddc0 100644 --- a/templates/header.php +++ b/templates/header.php @@ -49,18 +49,20 @@ "; + // Add translation for the JavaScript files + global $http_lang; + $str = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2); + $default_l = $lang_name->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{ - $defLang = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2); - if($defLang=='fr'){ - echo ""; - } - } + }else if($default_l==$http_lang && $default_l != "en_US"){ + echo ""; + } ?> - + From 83b983fd4f1f623c3e051240108bb3ad5762e378 Mon Sep 17 00:00:00 2001 From: Cesar HERNANDEZ ANTONIO Date: Wed, 20 May 2015 11:20:37 +0200 Subject: [PATCH 09/10] Added script SQL to change the charset in the database to utf8, convert the tables to utf8 and manual how to use it --- install/create_tables_data.sql | 8 ++++---- install/manual_upgrade_charset_utf8.txt | 6 ++++++ install/update_latin1-to-utf8.sql | 5 +++++ 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 install/manual_upgrade_charset_utf8.txt create mode 100644 install/update_latin1-to-utf8.sql 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 From ad49b2e6e08501baa3d0b14ab79962e556d1dbb6 Mon Sep 17 00:00:00 2001 From: Cesar HERNANDEZ ANTONIO Date: Wed, 20 May 2015 14:09:18 +0200 Subject: [PATCH 10/10] Added meta tag with charset utf8 to show correctly the report --- report.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/report.php b/report.php index 9974afd..c1893b0 100644 --- a/report.php +++ b/report.php @@ -63,7 +63,7 @@ . strtr($report->report->reportName,' ','_') . "'"); - echo ""; + echo ""; }
- +