We want to translate "Please enter a valid full date", but when we edit the csv file, nothing happens.
This is the default Magento validation line in the one page checkout.
When a user enters the data of birth incorrect, Magento displays the default error that is written in English.
Place the line in the Mage_Core.csv file and translate it, does not work.
How can we translate this line?
Best Answer
The problem comes from a core bug.
See
js/varien/js.js
around line 450:See the problem? It's the period
.
, which does not appear in the CSV, so the translation is missed every time. The easiest solution is the edit this file directly, removing the period so that translation works again... but of course, modifying core is not best practice.Long Solution
If you have a generic
local
code pool module on your system, add or edit itsjstranslator.xml
file, and add this:Here we should effectively overwrite the entry for this message that was originally defined in
app/code/core/Mage/Core/etc/jstranslator.xml
, and include the period which core code expects according tojs/varien/js.js
. Then, you can add an entry to your CSV: