1
redheadedrod
Knowing what language you are using...

I need to know what language the site is using for a module I am doing. Is there an easy method to check what language the site is set to use?

I suppose I could use a ...

define('_Lang_', 'EN');


in one of the language files but I am guessing xoops keeps track of the language it is using and I should be able to look at that.

I am saving data to a database and want to do it based on the language in use by the site.

For example...

I am setting up a dynamic field that the description will be entered by the user. But I want there to be a description that will be displayed depending on the language in use. The user will need to enter the description for each language then when the module runs it should show the description for the language in use...

So I need to know how to tell what language the site is using.

Rodney

2
zyspec
Re: Knowing what language you are using...
  • 2011/3/2 15:28

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


I think you can just use the constant _LANGCODE or if you need to determine the language in a template you can use Smarty <{$xoops_langcode}>

3
kerkyra
Re: Knowing what language you are using...
  • 2011/3/2 16:50

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


you should get the language like this

global $xoopsConfig;
$xoopsConfig['language']
www.guidemap.gr - Beta is out...

4
zyspec
Re: Knowing what language you are using...
  • 2011/3/2 20:07

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


duh... I knew that, thanks kerkyra

5
kerkyra
Re: Knowing what language you are using...
  • 2011/3/3 4:25

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


@ zyspec: it happens to everybody mate :)

@redheadedrod: one more thing, in case you are using your module in a multilanguage site (with xlanguage for example) you should read the cookie to get the users selected language.
www.guidemap.gr - Beta is out...

6
redheadedrod
Re: Knowing what language you are using...

Ahhh thanks.. I have so much to learn...

And when I do get the handle on it then XE will be done... lol

Oh well..


Login

Who's Online

312 user(s) are online (198 user(s) are browsing Support Forums)


Members: 0


Guests: 312


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits