Skip to content

Commit

Permalink
Add Portuguese (Brazil) translation
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisjacquet committed Mar 22, 2023
1 parent 7ed9740 commit 172cd1b
Show file tree
Hide file tree
Showing 10 changed files with 13,656 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Changes in 10.9
- Fix wkhtmltopdf not rendering URL in CSS in PDF.php
- CSS Fix breaking words inside .header2 in stylesheet.css
- SQL set N/A grade GPA to NULL in rosariosis.sql, rosariosis_es.sql, rosariosis_fr.sql & rosariosis_mysql.sql
- Add Portuguese (Brazil) translation in InstallDatabase.php, REFERENCE.md, locale/pt_BR.utf8/ & rosariosis_pt_BR.sql, thanks to Emerson Barros

This comment has been minimized.

Copy link
@emerson-pj

emerson-pj Mar 24, 2023

hello, it was a pleasure.


Changes in 10.8.5
-----------------
Expand Down
37 changes: 19 additions & 18 deletions InstallDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@

require_once 'database.inc.php';

// rosariosis_[lang].sql files available for database translation.
$lang = [
'fr' => 'French',
'pt_BR' => 'Portuguese (Brazil)',
'es' => 'Spanish',
];

// Test if database is already installed first.
if ( _configTableCheck() )
{
Expand All @@ -37,6 +44,7 @@
$config_login = db_fetch_row( $result );

if ( empty( $_POST['lang'] )
|| ! in_array( $_POST['lang'], array_keys( $lang ) )
|| $config_login['CONFIG_VALUE'] !== 'No' )
{
die( 'Database already installed.' );
Expand All @@ -53,27 +61,19 @@

$addons_sql = $rosariosis_sql = '';

// Translate Database.
if ( $_POST['lang'] === 'fr'
&& file_exists( 'rosariosis_fr.sql' ) )
{
// Same translation files for both MySQL & PostgreSQL.
$rosariosis_sql = file_get_contents( 'rosariosis_fr.sql' );
$rosariosis_sql_file = 'rosariosis_' . $_POST['lang'] . '.sql';

if ( file_exists( 'rosariosis_addons_fr.sql' ) )
{
$addons_sql = _getAddonsSQL( 'rosariosis_addons_fr.sql' );
}
}
elseif ( $_POST['lang'] === 'es'
&& file_exists( 'rosariosis_es.sql' ) )
$addons_sql_file = 'rosariosis_addons_' . $_POST['lang'] . '.sql';

// Translate Database.
if ( file_exists( $rosariosis_sql_file ) )
{
// Same translation files for both MySQL & PostgreSQL.
$rosariosis_sql = file_get_contents( 'rosariosis_es.sql' );
$rosariosis_sql = file_get_contents( $rosariosis_sql_file );

if ( file_exists( 'rosariosis_addons_es.sql' ) )
if ( file_exists( $addons_sql_file ) )
{
$addons_sql = _getAddonsSQL( 'rosariosis_addons_es.sql' );
$addons_sql = _getAddonsSQL( $addons_sql_file );
}
}

Expand Down Expand Up @@ -123,8 +123,9 @@
<form method="POST">
Translate database to
<select name="lang">
<option value="es">Spanish</option>
<option value="fr">French</option>
<?php foreach ( $lang as $lang_code => $lang_name ) : ?>
<option value="<?php echo $lang_code; ?>"><?php echo $lang_name; ?></option>
<?php endforeach; ?>
</select>
<br />
<input type="submit" value="Submit" />
Expand Down
2 changes: 2 additions & 0 deletions WHATS_NEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
New in 10.9
-----------

Add Portuguese (Brazil) translation, thanks to Emerson Barros

This comment has been minimized.

Copy link
@emerson-pj

emerson-pj Mar 24, 2023

hello, it was a pleasure.


Lists: add pagination if more than 1000 results. Deactivated by default, only activated for:
- Grading Scales
- Access Log
Expand Down
1 change: 1 addition & 0 deletions locale/REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Do not forget to add the `.utf8` suffix to the locale code.
| nl_NL | Dutch (Netherlands) | 32% | |
| nn_NO | Norwegian Nynorsk (Norway) | 33% | |
| pl_PL | Polish (Poland) | 33% | |
| pt_BR | Portuguese (Brazil) | **100%** | Emerson Barros |

This comment has been minimized.

Copy link
@emerson-pj

emerson-pj Mar 24, 2023

hello, it was a pleasure.

| pt_PT | Portuguese (Portugal) | 37% | |
| ro_RO | Romanian (Romania) | 33% | |
| ru_RU | Russian (Russia) | 32% | |
Expand Down
Binary file added locale/pt_BR.utf8/LC_MESSAGES/help.mo
Binary file not shown.
3,753 changes: 3,753 additions & 0 deletions locale/pt_BR.utf8/LC_MESSAGES/help.po

Large diffs are not rendered by default.

Binary file added locale/pt_BR.utf8/LC_MESSAGES/rosariosis.mo
Binary file not shown.
9,274 changes: 9,274 additions & 0 deletions locale/pt_BR.utf8/LC_MESSAGES/rosariosis.po

Large diffs are not rendered by default.

Binary file added locale/pt_BR.utf8/flag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 172cd1b

Please sign in to comment.