Magento – How to Override en.xml in zend/locale/Data with custom module

magento-1.9module

Hi have an issue like currency format. with multi language.

My currency showing in base store english language : 6,084 CAD $

But when i change franch language its showing like : 6 084 CAD $

I resolved the issues to change Zend/Locale/Data/fr.xml

<symbols numberSystem="latn">
   <decimal>,</decimal>
   <group> </group>

<symbols numberSystem="latn">
    <decimal>.</decimal>
    <group>,</group>

But I feel like change directly in lib/zend folder is not a good way. So i need to create a custom module to achieve this.

So please could you share your idea to create a custom module.

Thanks,

Best Answer

Class files located in the code pools will take precedence over files in the lib directory. To alter a locale file without directly editing the library, copy the files to the local code pool and edit the copy:

mkdir -p app/code/local/Zend/Locale/
cp -r lib/Zend/Locale/Data/ app/code/local/Zend/Locale/Data
cp lib/Zend/Locale/Data.php app/code/local/Zend/Locale/Data.php
editor app/code/local/Zend/Locale/Data/fr.xml

All locale data should now be read from the copied files.

  • If necessary, the edited copy can be bundled in a module.
  • Alternatively, the edited copy can be placed into the community code pool.

From this moment, updates of the original library locale files will not have any effect. The local edit will still be in place but the installation will no longer benefit from improvements or bug fixes.

Related Topic