Prestashop: Wrong flag and ISO code for Argentina

Created on 18 Oct 2019  路  11Comments  路  Source: PrestaShop/PrestaShop

Describe the bug
The Argentina localization pack creates a language with the ISO code "ag" which is for Antigua and Barbuda. Argentina's code is "ar".
The Antigua and Barbuda flag lang_mini_2_1 is also set instead of 23px-Flag_of_Argentina svg

To Reproduce

  1. Install Argentina localization pack in International > Localization
  2. Go to International > Localization > Language

Additional information
PrestaShop version: 1.7.6.1

1.7.6.1 BO Bug Fixed International Languages PM 鉁旓笍

All 11 comments

Hi @gabrielfin,

Thanks for your report.
As you can see in the Wikipedia: https://en.wikipedia.org/wiki/Antigua_and_Barbuda
The iso code for Antigua and Barbuda is ag
And the flag for the Antigua and Barbuda is lang_mini_2_1

Thanks to check & feedback.

That's what I mean. Argentina is ar not ag.

Installing the Argentina localization pack creates a language with the ag code:
screenshot

@gabrielfin, thanks for your feedback.
So for the Argentina Pack:
iso code => ar
Flag: 23px-Flag_of_Argentina svg
Wikipedia: https://en.wikipedia.org/wiki/Argentina
For the Antigua and Barbuda
The iso code for Antigua and Barbuda is ag
And the flag for the Antigua and Barbuda is lang_mini_2_1
Wikipedia: https://en.wikipedia.org/wiki/Antigua_and_Barbuda
But, when we import the Arnetina pack, we have the Antigua and Barbuda iso code & flag.

Ping @LouiseBonnard what do you think, this normal behavior or a bug we should fix it.

Thanks!

Hello there! Argentina has several ISO codes in PrestaShop:

  • the country code (ISO 3166-1 alpha 2) is ar
  • the language code (ISO 639-1) is es for Spanish and another one that has a customized language code ag for Argentinian Spanish

We must pay attention not to mix up country and language codes: ar matches the Argentina country code and the Arabic language code while ag does not match any language code but matches the Antigua-and-Barbuda country code.

With that saying, what needs to be fixed here is the customized code for Argentinian Spanish. It should be ar to have the right flag displayed but ar already matches the Arabic language... it's pretty tricky, and I can see two solutions: find a better language code for Argentinian Spanish but I'm not sure how possible it is, or perform a manual action on this flag to have the right country flag listed. @PrestaShop/prestashop-core-developers, any idea to work around this issue?

In comparison, Colombian Spanish is properly displayed because the customized language code is cb that does not match any country nor language code:

Capture d鈥檈虂cran 2019-10-23 a虁 10 53 33

@khouloudbelguith yes, exactly.

@LouiseBonnard I'm very new to Prestashop, so I don't want to meddle, but you should probably have 3 codes: ISO 3166 (country), ISO 639 (language) and the locale (IETF BCP 47, or whatever you are currently using in the "Language code" column). ISO 3166 would be used for the flag and any other country related stuff, ISO 639 for any "general" language related stuff, and the IETF code for translations and any locale related stuff.

In the case you mention, ar is the language code for Arabic, but the country code (and therefore the flag) should be sa in the case of Saudi Arabia.

PS: Where can I see all the language packs? Is there a repo?

@gabrielfin, right here. ;-)

This is an old issue that we have been aware of for some time and goes a very long way back. My guess is that years ago, an old Core developer mixed up _country_ ISO codes (ISO 3166-1 alpha 2) with _language_ ISO codes (ISO 639-1) which happen to be the same for some country/languages (like French/France, Spanish/Spain and so on) but differ for many others (like English/United States for example) and don't exist for regionalized languages like Argentinian Spanish.

This is why IETF language tags exist: they represent a langage for a specific culture, like en-US or es-AR.

When the old developers realized there wasn't a 2-letter iso code for a regional variation of Spanish like Argentinian spanish, they just _made one up_ and used "ag"... which is actually the country iso code for Antigua and Barbuda 馃槱 .

So to sum it up, most of our new code uses IETF language tags, but old code must keep using 2-letter language codes for backwards compatibility. We hope that this is something that we'll be able to fix in a later version.

That said, we do have a mapping of 2-letter language codes to IETF language tags. I think we could use that to do something about the flag...

So, this is going to be fixed on v 1.7.7? Is there something I can do now with 1.7.6?
Is there a release date for 1.7.7?

It should be frozen in a few weeks, @Tomicapo. Meanwhile, you can still have a look at PR #16334 to get the fix. :-)

I Install the prestashop 1.7.7.0 beta 2 and this issue persist.
The ISO CODE for Argentina in prestashop continue AG, when is ES (Spanish)
If change it, fuck off all translation function for all languages
If you put again ag work again the translation function.
Can solve this issue pls is a bug from the first version of presta 1.7 (2017-2018) we are in 2020.....
Very thanks

In the same way you have Code ISO es, and other es-xxx for galicia, and others spanish lang from Spain, we need
ES code iso for language, and es-ar for country lang. how did complicate this may be . Is the same thing

Was this page helpful?
0 / 5 - 0 ratings