list all available languages for the site |
[eluser]chejnik[/eluser]
Hello, can someone give me a small hint how can I detect all language translations I store in my application/language directory? I would use it then in a list for user to choose. Thanks in advance Ales
[eluser]xwero[/eluser]
I think it's a bit tricky that way because you can add languages where the sentences in the files aren't translated yet. After saying that you can get the directories easy with the directory helper Code: $languages = array_keys(directory_map('./system/application/languages/', TRUE));
[eluser]chejnik[/eluser]
Hello, quite interesting. I have found directory_helper and placed it to application/helper directory and load it in controller Code: $this->load->helper('directory_helper'); when I print_r - it shows only # What do you think it the problem. Thank you Ales
[eluser]chejnik[/eluser]
Hello, it is solved. Firstly I have found directory_helper in system/helpers directory, so no need for me to copy the text from browser and save it with many # inside it. My bad. ![]() And I blindly copy your advice Code: $data["languages"] = directory_map('./system/application/languages/', TRUE); ![]() Because there are suppressed warnings if ($fp = @opendir($source_dir)) I didnot see the mistake. Thank you. Great. With regards Ales |
Welcome Guest, Not a member yet? Register Sign In |