getUserLocale() - PHP Warning when changing language

I have installed Zenphoto version 1.4.2 [8956] (Official Build)

When change my language (the URL get's ?locale=en_US variable added) and I use `<?php echo getUserLocale(); ?>` inside the HTML body I get the
"PHP Warning: Cannot modify header information - headers already sent..." in error log.

This does not happen when I do this outside the HTML..

Comments

  • Yes, that would be the case. That function does setup of the locale which must be done before any output has been sent. But you really sould not even be using the function--it is intended for the runtime and has already been executed by the time your theme is running. The current locale is `ZENPHOTO_LOCALE`
  • Aha! Missed that. Cheers!
    btw I finally got my domain transferred and put my first install online :-)
    Still need to sort out quite a few things though...
    I'll make a first donation now as promised..
  • vincent3569 Member, Translator
    thanks sbillard for this good tip !!

    I have these warning too in my guestbook page (wich was call getUserLocale).
    Now, it'is work fine.
Sign In or Register to comment.