Author Topic: Why language files are xml?  (Read 10720 times)

Offline Msun

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Why language files are xml?
« on: March 20, 2012, 07:21:47 PM »
I would like to know why AbanteCart uses xml files for language translations, what are the advantages? I'm comparing to OpenCart that use simple php files (list of vars with the translated strings).

From the point of view of a translator, that is bad, there are more text susceptible to type errors, so I would like to know the advantages of xml files.

In time, the "Extenstions and Add-Ons" section is misspelled, right: "Extensions and Add-Ons"

« Last Edit: March 20, 2012, 07:26:23 PM by Msun »

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4150
  • Karma: +251/-9
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Why language files are xml?
« Reply #1 on: March 21, 2012, 09:02:07 AM »
Hello Msun,

We have covered the reason for this in the document below (look for Languages and translations):
http://www.abantecart.com/document_wiki/index.php/AbanteCart_Architecture_Overview

AbanteCart uses XML language files only for initial load and save to the database. This is needed for extension when you install them.
We want to give Shopping Cart owners ability to search and edit text in the cart as they need.

These XML files can be translated with google API V2 to get them into different language as for AbanteCart and for extensions. 

Hope this helps.
We need your help to build better free open source eCommerce platform for everyone.
See how you can help

Offline Msun

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Why language files are xml?
« Reply #2 on: March 21, 2012, 07:52:49 PM »
Thank you for your reply, I read the wiki and now I understand  :)

Offline gob33

  • Newbie
  • *
  • Posts: 43
  • Karma: +7/-0
    • View Profile
Re: Why language files are xml?
« Reply #3 on: January 02, 2014, 12:52:34 PM »
A major disavantage is the complexity introduced by storing in DB instead of flat files.
When developping extensions, each time you change a language text, you need to uninstall/install your extension for the change to take place in DB, AND then clear the cache otherwise you spend hours asking why the page dont change, like me.

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4150
  • Karma: +251/-9
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Why language files are xml?
« Reply #4 on: January 02, 2014, 08:49:07 PM »
Reason for these  due to abatecart ability to edit translations after language is loaded initially.  Language XML files act as installation files only. We could have kept them as SQLs but that would be even more harder to manage.

I can see a pain with this, that is why we started on dev tools extension to wrap process and make it easier.

Extension dev tool should help with this. We are continuously working on it.

Feel free to help with improving and adding easier process with resetting translations.


 
We need your help to build better free open source eCommerce platform for everyone.
See how you can help

Offline gob33

  • Newbie
  • *
  • Posts: 43
  • Karma: +7/-0
    • View Profile
Re: Why language files are xml?
« Reply #5 on: February 06, 2014, 06:43:47 AM »
In OpenCart, they are many language editors as extensions which do the same thing on flat files. Faster speed access and no dependant of a DB crash.
« Last Edit: February 06, 2014, 06:45:33 AM by gob33 »

Offline gob33

  • Newbie
  • *
  • Posts: 43
  • Karma: +7/-0
    • View Profile
Re: Why language files are xml?
« Reply #6 on: May 18, 2014, 11:51:31 AM »
Important: Use an external XML validator or parser when you write language files. The smallest error in an XML file (missing tag <definition> or </definition>, missing closing [!CDATA[ ]], syntax error, typo, ...) stops the php parser and the rest of file is ignored and you dont see it. Extremly long to check.
« Last Edit: May 19, 2014, 11:13:03 AM by gob33 »

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4150
  • Karma: +251/-9
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Why language files are xml?
« Reply #7 on: May 23, 2014, 02:46:26 PM »
Important: Use an external XML validator or parser when you write language files. The smallest error in an XML file (missing tag <definition> or </definition>, missing closing [!CDATA[ ]], syntax error, typo, ...) stops the php parser and the rest of file is ignored and you dont see it. Extremly long to check.
Great point. Thanks
We need your help to build better free open source eCommerce platform for everyone.
See how you can help

 

Powered by SMFPacks Social Login Mod