FORMfields, the premiere web framework
Login
Support Home | Knowledge Base | Documentation | Forums | Contact Us
Info
FORMfields & FORMgen :: Languages

Translating Values of a CheckboxField

(1977 views. Last Updated: 2008-02-05 3:08 PM)

FORMfields 3 contains a few limitations on translating the value of a CheckboxField. The best way to present a boolean (yes or no) question is using a RadioButtonField. For example, if you are presenting a True/False question in Spanish your RadioButtonField values would be "Verdadero" and "Falso".

Alernatively, you can make the following modifications to use a CheckboxField. In the following example we will assume that you are translating the value of the CheckboxField to Spanish, i.e. "True" becomes "Verdadero".
1. Edit FORMfields/src/fields/CheckboxField.php and replace:
if ($this->getValue())
    return "True";
with:
if ($this->getValue())
    return "Verdadero";
2. Use phpMyAdmin or the command line to edit the type of the database attribute that corresponds with your CheckboxField from "ENUM('True')" to "ENUM('Verdadero')".
Info
Support | Earn Money
Copyright © 2005-2020 Brain Book Software LLC.
Built with FORMfields, the premiere web framework.