Wednesday 13 January 2010

sfValidatorI18nChoiceLanguage "The following languages do not exist"

Another interesting issue with the symfony I18n system.

Using the language form from sfFormExtra plugin automatically uses the sfValidatorI18nChoiceLanguage object. We've set up our microsite to use the full format cultures made up of a 2 character language code, followed by an underscore and a 2 character code: e.g. en_GB for British english or fr_FR for French. This offers consistency with our other sites that also use this form of localisation selection.

However, while trying to use nl_NL, de_DE & fr_FR, we are told via a 500 server error that those languages don't exist.

Dumping out the languages obtained from sfCultureInfo::getInstance()->getLanguages(); shows that indeed, those 3 language selections don't exist. Only, nl, de, and fr do.

I don't know, as yet, why this is so - and i haven't found a consistent and 'correct' method to update my other languages but I shall update this post when I do find one...

1 comment:

  1. Hi! Here is the solution to this problem: http://trac.symfony-project.org/ticket/9055

    ReplyDelete

Please leave your feedback and comments. I love to discuss this stuff!