I just want to generate a code that will detect the current language of my websit in joomla + php
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
See getLanguage in JFactory:
Once you have the language, you can also retrieve the locale/language code (e.g.
en-US). Joomla! languages can have multiple locales, so you’ll get an array.If for some reason, you are only interested in the first locale, you can simply grab the first element. You will probably need an array, like this:
If you just want to get the selected language tag (e.g. pt-PT) you can use getTag()