support

Author Topic: Setting id of languages according to the alphabetic list ISO 639-1  (Read 4410 times)

Offline OneMore

  • Newbie
  • *
  • Posts: 46
  • Karma: +13/-0
    • View Profile
Hello,

As AbanteCart likes standardization, I would suggest numbering languages according alphabetical list for the ISO 639-1 codes from the International Organization for Standardization.

This would mean that "language_id" would be set to:
  • 41 for English (instead of default 1)
  • 149 for Spanish
  • 29 for Chinese
  • 55 for German
  • 48 for French
a.s.o.
instead of being attributed by the auto increment.

If developers of language extensions would follow this simple rule, it would be much easier to create datasets that can be easily be imported by every user of AbanteCart.

Consider for instance how zone descriptions can be imported by SQL queries:
Quote
INSERT INTO `ac_zone_descriptions` (`zone_id`, `language_id`,`name`) VALUES (...,...,'')

Of course, some languages will probably never be imported, like dead ones (e.g. 93,'Latin','la), but it would just suffice to check the list to know which id should be used for each language.

I have prepared the full CSV list of 183 languages, alphabetically ordered, as well as the SQL query equivalent for AbanteCart's list languages list.

I hope there will be some traction for this practice. Writing a few updaters for existing shops should not be a big issue.
Awaiting for your feedback.

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5993
  • Karma: +284/-2
    • View Profile
Re: Setting id of languages according to the alphabetic list ISO 639-1
« Reply #1 on: December 11, 2023, 02:57:30 AM »
Hello.
The ID is just a number from the database. When a language extension is installed it provides all the necessary configuration like locales to detect the language

Offline OneMore

  • Newbie
  • *
  • Posts: 46
  • Karma: +13/-0
    • View Profile
Re: Setting id of languages according to the alphabetic list ISO 639-1
« Reply #2 on: December 11, 2023, 12:14:30 PM »
Hello,

Yes, I am aware that extensions do the job of matching language IDs and language codes.
But making a new installable extension requires some time.

Often, I simply create datasets as SQL queries that I inject through the SQL tab of phpMyAdmin, without taking the time to create an extension.

In such a case, having a unequivocal "language_id <> language_code" relationship would make sharing datasets between users easier.
One would only have to copy-paste the dataset in phpMyAdmin's SQL tab, without having to care about the id to language code relationship.
Hence, the idea of using the ISO 639-1 alphabetical list.

E.g. if creating some SQL dataset in French language, the language_id would be set to 48.

 

Powered by SMFPacks Social Login Mod