AbanteCart Community

AbanteCart Development => Extensions and Add-Ons => Languages and Zones => Topic started by: Msun on March 20, 2012, 07:21:47 PM

Title: Why language files are xml?
Post by: Msun 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"

Title: Re: Why language files are xml?
Post by: abantecart 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.
Title: Re: Why language files are xml?
Post by: Msun on March 21, 2012, 07:52:49 PM
Thank you for your reply, I read the wiki and now I understand  :)
Title: Re: Why language files are xml?
Post by: gob33 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.
Title: Re: Why language files are xml?
Post by: abantecart 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.


 
Title: Re: Why language files are xml?
Post by: gob33 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.
Title: Re: Why language files are xml?
Post by: gob33 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.
Title: Re: Why language files are xml?
Post by: abantecart 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