How does one get current language?

how do we get current language…



{$_REQUEST.sl} is empty UNLESS one changes the language…



would we need



if {$_REQUEST.sl} empty then

sl = customer_default_language



?

In version 3.0.x:



{$smarty.const.CART_LANGUAGE}

Good for all versions/editions. If you want the current language in the admin area then use DESCR_SL.

In PHP you can use $lang[CART_LANGUAGE] I think.

@mwounters - no, that's incrorrect. If '$lang' were defined somewhere, that would give you a pointer into the array of properties related to that language, not the language itself.



There is a constant in the 'C' AREA called CART_LANGUAGE which is set to the users selected language (or the cart default). This is also available in the A AREA but always reflects the site default language. To get to the selected language in the A AREA use DESCR_SL.