1

In the control panel, if you go to

Admin -> General Configuration

there is an option for setting the default language. The select dropdown contains the list of languages that are supported.

Is there a way to get this list of languages either in the templates or inside a plugin function?

2

I am not sure if there is any template tag for it but all the languages can be fetched with code.

Basically all the language options displayed from the installed language packs within the directory "system/expressionengine/language/". I think, you can develop a small plugin for it with the following code example:

ee()->load->model('admin_model');
$languages = ee()->admin_model->get_installed_language_packs();

See $languages is an array of all languages.

I hope, it would help you.

| improve this answer | |
  • Yep. This does the trick. Strange that this cannot be found in the documentation. Or at least, I didn't find it. – developarvin Aug 27 '13 at 2:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.