Get list of available languages |
Hello guys, quick question.
Is there a built-in way to get a list of languages available? Or do I have to go the manual route, by scanning folder names in app/Language? I'd like to provide a logged-in user with the languages available, so he can choose whichever he wants.
07-21-2021, 04:47 AM
(This post was last modified: 07-27-2021, 05:47 AM by InsiteFX. Edit Reason: Added helper method to get language list. )
We usally add the languages that were going to use, you could create your own array and add the languages to it.
Updated 07-27-2021 Added helper method. PHP Code: /** This method willl return to you an array of all languages in the app/Language folder. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |