Browse Source

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

Julio Montoya 5 years ago
parent
commit
2bb74b7bc1

+ 2 - 2
main/inc/lib/internationalization.lib.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 it is too large
+ 45 - 241
src/CoreBundle/Resources/translations/messages.en.po


File diff suppressed because it is too large
+ 796 - 0
src/CoreBundle/Resources/translations/messages.es.po


File diff suppressed because it is too large
+ 47 - 259
src/CoreBundle/Resources/translations/messages.fr.po


+ 10 - 8
tests/scripts/lang/generate_gettext_files.php

@@ -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',

+ 2 - 5
tests/scripts/lang/switch_files_to_gettext.php

@@ -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) {

Some files were not shown because too many files changed in this diff