Skip to content

Commit

Permalink
restores uniformity
Browse files Browse the repository at this point in the history
  • Loading branch information
severoiuliano@gmail.com committed Jun 15, 2020
1 parent 33643a7 commit 486c21c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions system/Translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ class Translations
{
public static function loadTranslations($environment)
{
define('DS', '/');

$yaml = new Models\WriteYaml();
$settings = $yaml->getYaml('settings', 'settings.yaml');

Expand All @@ -28,7 +26,7 @@ public static function loadTranslations($environment)

// theme labels selected according to the environment: admin or user
$theme_labels = [];
$theme_language_folder = 'themes' . DS . $theme . DS . 'languages' . DS . $environment . DS;
$theme_language_folder = 'themes' . DIRECTORY_SEPARATOR . $theme . DIRECTORY_SEPARATOR . 'languages' . DIRECTORY_SEPARATOR . $environment . DIRECTORY_SEPARATOR;
$theme_language_file = $language . '.yaml';
if (file_exists($theme_language_folder . $theme_language_file))
{
Expand All @@ -39,7 +37,7 @@ public static function loadTranslations($environment)
$plugins_labels = [];
if($environment=='admin'){
// system labels
$system_language_folder ='system' . DS . 'author' . DS . 'languages' . DS;
$system_language_folder ='system' . DIRECTORY_SEPARATOR . 'author' . DIRECTORY_SEPARATOR . 'languages' . DIRECTORY_SEPARATOR;
$system_language_file = $language . '.yaml';
if (file_exists($system_language_folder . $system_language_file))
{
Expand All @@ -56,7 +54,7 @@ public static function loadTranslations($environment)
if($settings['plugins'] !== NULL) {
foreach($settings['plugins'] as $plugin => $config){
if($config['active']=='on'){
$plugin_language_folder = 'plugins' . DS . $plugin . DS . 'languages' . DS;
$plugin_language_folder = 'plugins' . DIRECTORY_SEPARATOR . $plugin . DIRECTORY_SEPARATOR . 'languages' . DIRECTORY_SEPARATOR;
$plugin_language_file = $language . '.yaml';
if (file_exists($plugin_language_folder . $plugin_language_file)){
$plugin_labels[$plugin] = $yaml->getYaml($plugin_language_folder, $plugin_language_file);
Expand Down

0 comments on commit 486c21c

Please sign in to comment.