Access variable user_language

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
RobiX
Registered User
Posts: 93
Joined: Thu Oct 05, 2017 9:59 am

Access variable user_language

Post by RobiX » Wed Dec 13, 2017 6:44 pm

Code: Select all

  protected 'language' => 
    object(phpbb\language\language)[26]
      protected 'common_language_files' => 
        array (size=1)
          0 => string 'common' (length=6)
      protected 'common_language_files_loaded' => boolean true
      protected 'default_language' => string 'en' (length=2)
      protected 'user_language' => string 'de' (length=2)
how can I access user_language?

i tried so many things such as $user->language->user_language or $user->language['user_language'].

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 20794
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Access variable user_language

Post by RMcGirr83 » Wed Dec 13, 2017 6:55 pm

Probably help if explained what it is you are trying to do.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

RobiX
Registered User
Posts: 93
Joined: Thu Oct 05, 2017 9:59 am

Re: Access variable user_language

Post by RobiX » Wed Dec 13, 2017 6:57 pm

hi RMcGirr83,

Code: Select all

if ($user_language === "en" ) {
//todo
} else if ($user_language === "de" ) {
//todo
} else {
//todo
}
Last edited by RobiX on Wed Dec 13, 2017 6:59 pm, edited 2 times in total.

RobiX
Registered User
Posts: 93
Joined: Thu Oct 05, 2017 9:59 am

Re: Access variable user_language

Post by RobiX » Wed Dec 13, 2017 6:58 pm

i need the value of user_language

User avatar
david63
Jr. Extension Validator
Posts: 14338
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Access variable user_language

Post by david63 » Wed Dec 13, 2017 9:24 pm

Off the top of my head$user->data['user_lang']
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

RobiX
Registered User
Posts: 93
Joined: Thu Oct 05, 2017 9:59 am

Re: Access variable user_language

Post by RobiX » Mon Dec 18, 2017 8:20 pm

tnx a lot

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: No registered users and 5 guests