Forums

Plugins Language Switcher
[resolved] Why using a cookie? (2 posts)

  1. Olaf
    Member
    Posted 7 months ago #

    Hi,

    thanks for providing this plugin, I work with the english version of wordpress for years and sometimes I need to build dutch websites too.

    You understand that just switching the language is a great time saver :)

    You're using a cookie to store the language, why?

    setcookie('pls_language', $pls_language, time()+60*60*24*30, COOKIEPATH, COOKIE_DOMAIN);

    It would be much better to store this value in the wp_options table, this way you can setup the language by user... just a suggestion.

    Thanks again!

    http://wordpress.org/extend/plugins/plugins-language-switcher/

  2. Vladimir Garagulya
    Member
    Posted 5 months ago #

    Hi,

    WordPress defines language to use at stage when it know nothing about current user. So, there was know problem with one global for the blog language option stored in wp_options, but when I tried to have separate options on per user base I've got a problem, described above - I need language value for current user already but I don't know who the current user are, as WP user routine is not loaded yet :).

    If you find a way to realize this, please share and I will add WP database storage as an alternative to cookie variant.

Reply

You must log in to post.

About this Plugin

About this Topic