Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding how the official plugins load language files #65

Open
amarillonmc opened this issue Jun 14, 2024 · 0 comments
Open

Regarding how the official plugins load language files #65

amarillonmc opened this issue Jun 14, 2024 · 0 comments

Comments

@amarillonmc
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant