-
14th Oct, 2008No Comments
One of our websites is using gettext for displaying dutch and french language. Based on the host header, we define the locale/environment variable. Sometimes it seemed that the locale and the environment variables were getting lost.
After some testing we found the problem, just look at the warning on the PHP website:
"The locale information is maintained per process, not per thread. If you are running PHP on a multithreaded server api like IIS or Apache on Windows you may experience sudden changes of locale settings while a script is running although the script itself never called setlocale() itself. This happens due to other scripts running in different threads of the same process at the same time changing the processwide locale using setlocale()."
So when requests of the dutch site are running at the same time as request on the french site, the locale was getting mixed up. The chance of this problem occuring, gets bigger when requesting slower pages. The problem might not be visible when all pages are fetched very fast.
Solution? Put each website in his own app pool, or move to linux

Cheers
Peter -
10th Oct, 2008No Comments
The left panel is like it should be, the right panel looks awfull. All lines are blurry, shadows are buggy, etc.
This is caused by the panel having a x or y property a floating point value.
So when working with randoms, dragging operations, or any other calculations, always remember to round your values. This keeps your skins snappy
//panel.x = Math.random() * 10;
panel.x = Math.floor(Math.random()*10);Great success!
Peter
-
3rd Oct, 2008No Comments
When selecting text in the Flex Text component, sometimes the text is scrolled up one line, and thus hiding the first line.
A solution is to set the selectable property to false, but then links don’t work anymore, and sometimes you want to let the user select text.
There is a nice solution on viconflex.blogspot.com , but it seems odd that you can select text on several components at the same time, so I added some code that handles this.
Just watch for the focusout event, and manually deselect the text. that’s it

Watch it in action: (Source view is enabled)
Now the visitor can select text, follow links, without the scroll annoyance!
Cheers,
Peter -
23rd May, 2008No Comments
Extracting language strings from PHP is best done woth xgettext… in order you are using the _(”) function to specify your text fragments.
Afterwards on the server you must run the following command to create a translatable *.po file which then can be eidtied using programs like poEdit:
find . -iname ‘*.php’ -exec xgettext –keyword=_ -j -o messages.po {} \;







