Those variables are undeclared because they come from the extract
statement and DO contain values.
So I changed the topic to reflect the real question:
Why is MY mo-file not accepted?
My "magic" value in the header is "-1794895138".
Apparently it should be "2500072158".
I come to this conclusion since both expressions in the if-statement
result in that number.
If I tweak the if-statement to accept my file it is parsed and
translation works without any apparent problem.
What is the "magic" number? A checksum? How do I go about "debugging"
my (also working) po-file? PoEdit has no problem and spits out no
errors.
On Apr 1, 11:27 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I have had a lot of problems getting i18n translation working but I
> think this may be one for the trac. THis is a sanity check before
> posting a ticket... please read on and tell me I am wrong :) (which is
> always fun)
>
> I have debugged a bit in cake/libs/i18n.php and found that my
> "default.mo" is loaded but then I found some strange code where the
> file should begin parsing:
> --- line 390-391 ---
> if (($magic == (-1794895138 & 0xFFFFFFFF) || $magic == (2500072158 &
> 0xFFFFFFFF)) && $version == 0) {
> for ($n = 0; $n < $count; $n++) {
> ---
>
> $magic and $count are never assigned values and thus the file will
> never be parsed. This is what I assume is a bug. The reason I doubt
> myself even though logically the file will never be parsed is that my
> previous questions have turned up people happily using "mo-files".
>
> My setup in the app:
>
> in config/core.php all caching is turned off (when debugging to avoid
> cached locale data).
>
> optional: in config/core.php I have set the language to Swedish:
> Configure::write('Config.language', 'swe');
>
> the file locale/???/LS_MESSAGES/default.mo contains translations
> compiled by poedit. (??? = swe or eng if using default)
>
> That is it. Does not display any translated texts. Translations are
> displayed using the __() function and all working with the uncompiled
> default.po. When I activate caching The cached translation-file
> contains the following which amounts to nothing:
> ----
> 1207044332
> a:1:{s:11:"LC_MESSAGES";a:1:{s:7:"default";a:0:{}}}
> ----
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---