The Portuguese, Portugal should be "pt-pt" (as it has been since the beginning), and not "pt".

Currently there is already a development translation of Portuguese, Portugal on the server, but it doesn't load on the site by selecting "Portuguese, Portugal".

Comments

josesanmartin’s picture

Title: Portuguese, Portugal Language Code » Language code with country suffix not being rendered correctly
Status: Active » Needs work
StatusFileSize
new536 bytes

I have found the error and created a patch that works for the installer. Actually, it's just an extra "\-" in line 93 of install.php.

Automatic translation importing after module activation should be checked too.

gábor hojtsy’s picture

Title: Language code with country suffix not being rendered correctly » Language codes with dashes don't work in installer and runtime

This bug is for the runtime system, http://drupal.org/node/228852 was for the install system. Anyway, since the issue seems to be very similar (but need probably different places to fix), we can merge the two bugs into one here.

mcduarte2000’s picture

Do you know when this corrections will be out? In 6.3?

gábor hojtsy’s picture

mcduarte2000: Well, until there is a committed patch, we have no idea when it is going to be released.

introfini’s picture

Hi Gábor,

Isn't this http://drupal.org/node/228761#comment-764169 the patch?

Regards,
introfini

gábor hojtsy’s picture

What about fixing it in the runtime as well? Did you notice the issue there as well (once applied the patch and managed to install a site with it)? José marked his patch needs work, because it is not complete yet.

roborn’s picture

Version: 6.1 » 6.4
Status: Needs work » Active
StatusFileSize
new1.06 KB

The only issue i’ve noticed at runtime was the language name missing.
That's because locale.inc got ‘pt’ only, so locale.install insert empty values into DB.

Here’s a patch (with José's patch included) to correct that :)

borfast’s picture

Status: Active » Reviewed & tested by the community

I have reviewd this patch, both by looking at the code and by applying it to two sites, and it solves the problem.

Not much more to say other than to thank José San Martin and roborn for their work. Thanks guys!

Now how does this get into core? :)

Title: Language codes with dashes don't work in installer and runtime » Language codes with dashes don't work in installer and runtime

Patch failed to apply. More information can be found at http://testing.drupal.org/node/13908. If you need help with creating patches please look at http://drupal.org/patch/create

Patch failed to apply. More information can be found at http://testing.drupal.org/node/13909. If you need help with creating patches please look at http://drupal.org/patch/create

borfast’s picture

Just as a note (also noticed by roborn), the two errors reported by DrupalTestbedBot are regarding the first patch, submitted by José San Martin.

The second patch, submitted by roborn, works just fine.

gábor hojtsy’s picture

Version: 6.4 » 7.x-dev

Ok, I've verified that locale_batch_by_language() and locale_batch_by_component() use the already established language code, so those do not need modification. _locale_batch_import() has a regex on .po files, but that only grabs the language code.

I've also verified that the Portuguese Portugal translation is shipped under the pt-pt name, not simply pt, so looks like we'd better fix that reference in our code.

So looks like these were the only issues. Committed to 6.x! Thanks for the resistance and for driving this home! Moving to 7.x for commit.

introfini’s picture

Great Gábor!

Thanks,
introfini

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x. Thanks!

webchick’s picture

Title: Language codes with dashes don't work in installer and runtime » Language codes with dashes don't work in installer and runtime

Also, that's bugging me. ;)

borfast’s picture

Thanks Gábor and webchick! :)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.