Adding en/es/fr po files + minor format code.

pull/3016/head
Julio Montoya 5 years ago
parent 2a0079c83c
commit 2bb74b7bc1
  1. 4
      main/inc/lib/internationalization.lib.php
  2. 8832
      src/CoreBundle/Resources/translations/messages.en.po
  3. 23283
      src/CoreBundle/Resources/translations/messages.es.po
  4. 10047
      src/CoreBundle/Resources/translations/messages.fr.po
  5. 18
      tests/scripts/lang/generate_gettext_files.php
  6. 7
      tests/scripts/lang/switch_files_to_gettext.php

@ -81,7 +81,7 @@ function get_lang($variable)
$defaultDomain
);
if ($translated == $variable) {
if ($translated === $variable) {
// Check the langVariable for BC
$translated = Container::getTranslator()->trans(
"lang$variable",
@ -89,7 +89,7 @@ function get_lang($variable)
$defaultDomain
);
if ($translated == "lang$variable") {
if ($translated === "lang$variable") {
return $variable;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,21 +1,20 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Generate Gettext-format language files from the existing language files
* Generate Gettext-format language files from the existing language files.
*
* @package chamilo.cron.lang
* @author Yannick Warnier <yannick.warnier@beeznest.com>
*/
/**
* Includes and declarations.
*/
die(); //remove before execution
require_once __DIR__.'/../../../main/inc/global.inc.php';
ini_set('memory_limit', '128M');
$partial = false;//if set to true, do not add empty strings to .po files
ini_set('memory_limit', '600M');
$partial = false; //if set to true, do not add empty strings to .po files
$destinationDir = '/tmp/gettext'; //where to put the generated files
/**
* Get list of languages
* Get list of languages.
*/
$langPath = api_get_path(SYS_LANG_PATH);
$languagesListFull = scandir($langPath);
@ -64,6 +63,7 @@ $langToIso639v1 = [
'dari' => 'fa_AF',
'dutch' => 'nl',
'english' => 'en_US',
'estonian' => 'et',
'esperanto' => 'eo',
'faroese' => 'fo_FO',
'finnish' => 'fi_FI',
@ -112,6 +112,7 @@ $langToIso639v1 = [
'xhosa' => 'xh_ZA',
'yoruba' => 'yo_NG',
];
$langToPOFilename = [
'arabic' => 'ar',
'asturian' => 'ast_ES',
@ -127,6 +128,7 @@ $langToPOFilename = [
'dari' => 'fa_AF',
'dutch' => 'nl',
'english' => 'en',
'estonian' => 'et',
'esperanto' => 'eo',
'faroese' => 'fo',
'finnish' => 'fi',

@ -1,13 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Script to switch all PHP files in Chamilo to a more Gettext-like syntax.
*
* @package chamilo.cron.lang
*/
/**
* Includes and declarations.
*/
die();
require_once __DIR__.'/../../../main/inc/global.inc.php';
$path = api_get_path(SYS_LANG_PATH).'english';
@ -66,7 +64,6 @@ foreach ($files as $file) {
}
}
} else {
$res = 0;
$res = preg_match_all('/\{\s*([\'"](\\w*)[\'"])\s*\|get_lang\}/m', $line, $myTerms);
if ($res > 0) {
foreach ($myTerms[2] as $term) {

Loading…
Cancel
Save