Skip to content

Regarding how the official plugins load language files #65

Closed
@amarillonmc

Description

@amarillonmc

In all of the officially provided plugins loader.php, there are this snippet that decides which language to load:
(Example Taken from Change Class Plugin)

// language phrases
if(file_exists(__PATH_CHANGECLASS_ROOT__ . 'languages/'.config('language_default', true).'/language.php')) {
	// attempt to load same language as website
	if(!@include_once(__PATH_CHANGECLASS_ROOT__ . 'languages/'.config('language_default', true).'/language.php')) throw new Exception('Error loading language file (changeclass).');
} else {
	// load default language file (en)
	if(!@include_once(__PATH_CHANGECLASS_ROOT__ . 'languages/en/language.php')) throw new Exception('Error loading language file (changeclass).');

 }

However, it only checks for the language_default value in the configs, and not $_SESSION['language_display'], which means even if a translation is provided by populating the language.php file, and the user switched to said language, the plugin language will still be in the language_default value, defeating the purpose of multi-language.

Please advise, thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions