<marco.rizze...@gmail.com> wrote:
> Hi
> I try to use the localization of Cake.
> I have se in my errors.po:
>
> msgid "The submitted file extension is not permitted, only %s
> permitted."
> msgstr "L'estensione del file caricato non è permessa, solo %s sono
> permesse."
>
> But in my code when I have this __d('errors',''The submitted file
> extension is not permitted, only jpeg,png,gif permitted.); I don't get
> the translation
>
> Instead If I use :
>
> msgid "The submitted file extension is not permitted, only
> jpeg,png,gif permitted."
> msgstr "L'estensione del file caricato non è permessa, solo
> jpeg,png,gif sono permesse."
>
> All works fine.
>
> I don't understand where is the error. I hope someone can help me
> Many Thanks
> Marco
Hello Marco,
the localization searched for the exact string, so if you have
__d('errors',''The submitted file extension is not permitted, only
jpeg,png,gif permitted.);
in your code, it looks for
"The submitted file extension is not permitted, only jpeg,png,gif
permitted."
in the .po file. And as you said: That works.
If you need a more versatile approach - and I guess that is why you
tried to use the %s placeholder, then you have to use exactly the same
string in your php code. So: If you have
"The submitted file extension is not permitted, only %s
permitted."
in the .po file, then you need to use exactly that string in the php
code, e.g.
__d('errors',sprintf('The submitted file extension is not
permitted, only %s permitted.', 'jpeg,png,gif'));
Hope that helps,
Christian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment