Problem with setlocale() on windows server fixed

At the moment I'm setting up a ZenPhoto in a Windows Server 2003 (IIS6) and I was having problems with the setlocale. After few workarounds I found an easy solution for that, the only thing you have to do is to add a null as a last value of the function:

file: zp-core/functions-i18n.php
line: 245
updated line: `$result = setlocale(LC_ALL, $locale.'.'.$encoding, $locale, null);`

I hope you enjoy the fix.

Comments

  • What problems were you having? Have you tried to change languages after using this work-around?
  • castuo Member
    Before I couldn't change the languages, I was getting and error with any of the languages, after that changes everything works fine and I can change to any language.
  • Not sure why this fixed things, but it seems to be an innocuous change. But we are close to the next release of Zenphoto so I would prefer to wait until after that to make the change just to be sure we don't break things for the majority of folks.
  • bic Member, Translator
    Thanks, My own PC runs XP and now I can work with locales on my local server too!
  • castuo Member
    I'm glad is working for you!! I'm not sure why is working but I'm pretty sure that little change will work and like sbillard says is innocuous.
  • I'll have to add here that I had the same mysterious problem using 1.2.8 - I got the error that the language wasn't supported by the server, and that warning in Setup.php about lack of support also. Adding that final null parameter fixed it for me as well.
  • So, here is a good example of why it is important to create tickets. Unfortunatley, this change has not been made in the development stream. And again, we are close to the release date, so again it will have to wait. Hope we remember it for the 1.3 release.
  • Figured I would make a ticket for this just in case it was forgotten again.

    http://www.zenphoto.org/trac/ticket/1414
Sign In or Register to comment.