Skip to content

Commit

Permalink
system: move development languages to development flag instead
Browse files Browse the repository at this point in the history
This avoids carrying a diff between master and respective stable.
  • Loading branch information
fichtner committed Aug 25, 2023
1 parent cf4f47d commit ea92afa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/etc/inc/config.inc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ final class product
} else {
self::$data['product_booting'] = false;
}

/* development flag */
$develflag = '/var/run/development';
self::$data['product_development'] = file_exists($develflag);
}

private function __clone()
Expand Down
11 changes: 8 additions & 3 deletions src/etc/inc/system.inc
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ function system_resolvconf_generate($verbose = false)

function get_locale_list()
{
$locales = array();
$locales = [];

/* first one is the default */
$locales['en_US'] = gettext('English');
Expand All @@ -254,13 +254,18 @@ function get_locale_list()
$locales['ja_JP'] = gettext('Japanese');
$locales['ko_KR'] = gettext('Korean');
$locales['no_NO'] = gettext('Norwegian');
$locales['pl_PL'] = gettext('Polish'); /* development only */
$locales['pl_PL'] = gettext('Polish');
$locales['pt_BR'] = gettext('Portuguese (Brazil)');
$locales['pt_PT'] = gettext('Portuguese (Portugal)');
$locales['ru_RU'] = gettext('Russian');
$locales['es_ES'] = gettext('Spanish');
$locales['tr_TR'] = gettext('Turkish');
$locales['vi_VN'] = gettext('Vietnamese'); /* development only */
$locales['vi_VN'] = gettext('Vietnamese');

if (!product::getInstance()->development()) {
unset($locales['pl_PL']);
unset($locales['vi_VN']);
}

return $locales;
}
Expand Down
1 change: 1 addition & 0 deletions src/www/guiconfig.inc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

/* check before 'product' class is known to catch all errors */
if (file_exists('/var/run/development')) {
ini_set('display_errors', 0);
}
Expand Down

0 comments on commit ea92afa

Please sign in to comment.