This topic is locked

Manage multiple countries and multiple languages

3/9/2016 11:10:39 AM
PHPRunner General questions
F
Francesco_5000 author

In some nations are spoken different languages, in my case, the contents are country-related, not only language-related. For this reason I need to specify the country as well as the language, in the drop down language menu.
for example: Belgie (Nederlands) | Belgien (Deutsch) | Belgique (Francais) etc
I'm wondering if need to define new "Country (languages)" only here


or I need to consider also other aspects.

Sergey Kornilov admin 3/9/2016

Here is the article that explains how to add new languages:

http://xlinesoft.com/phprunner/docs/localizing_phprunner_application.htm

F
Francesco_5000 author 3/10/2016



Here is the article that explains how to add new languages:

http://xlinesoft.com/phprunner/docs/localizing_phprunner_application.htm


Thanks for the answer, I need to manage the access to the records, basing the permissions also with the countries - languages of the users. I imagine a situation where the users see only the contents of their country-language without the possibility to select other countries - languages from the dropdown menu.
So the quetion is this: how I can hide the languages from the dropdown menu? For example if a user is French, he must not see German in the dropdown menu unless he has the necessary permissions.

Sergey Kornilov admin 3/10/2016

I'm not really sure how do you want to manage list of languages available to any specific customer but here is the Javascript code that can help you remove a language (English in this case) from languages dropdown box.

$("option[value='English']").remove();
F
Francesco_5000 author 3/11/2016



I'm not really sure how do you want to manage list of languages available to any specific customer but here is the Javascript code that can help you remove a language (English in this case) from languages dropdown box.

$("option[value='English']").remove();



I made some few tables; countries, languages and a table to relate country with language, then I added a country_language field in the user table, so in this moment I think I've what I need... at least to manage the visibility of the records :-).
A javascript code you say... ok, exactly in which event?
[edit]
I answer myself, the code must be added in every list page and in Javascript onload event, now I'm working on the retrieving of the current language. Now the main problem is in the login page where is possibile to select all languages.
[/edit]