0

I followed this tutorial: https://www.damianculotta.com.ar/magento/bug-en-los-locales-es-en-magento-1-y-2/ which suggested to override this file: src/lib/Zend/Locale/Data/es_419.xml. I created the new file in this location: features/Multivac_Theme/app/code/local/Zend/Locale/Data/es_419.xml, but it doesn't work. How can I properly override the file? Thanks!

2
  • 1
    I think this should work as expected. Did you flush all the caches ? Jan 16, 2019 at 15:43
  • @JulienLoizelet yes, the cache is clean
    – glafche
    Jan 17, 2019 at 8:49

1 Answer 1

4

To alter a locale file without directly editing the library, copy the files to the local code pool and edit the copy: Make a directory :

app/code/local/Zend/Locale/

Copy Data.php file from :

lib/Zend/Locale/Data.php

To :

app/code/local/Zend/Locale/Data.php

And Now here you can copy the file which you have to override. Like :

features/Multivac_Theme/app/code/local/Zend/Locale/Data/es_419.xml

Finally you have to change path In Data.php. Replace code from line 155-159

  $filename = dirname(__FILE__) . '/Data/' . $locale . '.xml';
if (!file_exists($filename)) {
    #require_once 'Zend/Locale/Exception.php';
        throw new Zend_Locale_Exception("Missing locale file '$filename' for '$locale' locale.");
}

With :

    $filename = dirname(__FILE__) . '/Data/' . $locale . '.xml';
if (!file_exists($filename)) {
    $filename = realpath(__DIR__ . '/../../../../../lib/Zend/Locale/Data') . '/' . $locale .'.xml';
    if (!file_exists($filename)) {
        #require_once 'Zend/Locale/Exception.php';
            throw new Zend_Locale_Exception("Missing locale file '$filename' for '$locale' locale.");
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.