Actions

Difference between revisions of "Developer Area/Core Subsystems/Form API (Pieforms)/Form API i18n"

From Mahara Wiki

< Developer Area‎ | Core Subsystems‎ | Form API (Pieforms)
 
Line 1: Line 1:
Form rules can be internationalised to different languages. This is still a work in progress, but basically either a rule can export a function named <code>form_rule_$rulename_i18n</code> that returns a language string, or they can mash it into the Form class itself. Nigel still has to add support for getting strings from elsewhere, if necessary.
+
Form rules can be internationalised to different languages.
 +
A rule can set it's own language string on the element itself. But generally we allow the form rule to fetch the language string based on the pieform plugin, pluginname, key. For example for the required rule we have a language string  $string['rule.required.required'] = 'This field is required.';
 
[[Category:Developer Area]][[Category:Pieforms]]
 
[[Category:Developer Area]][[Category:Pieforms]]

Latest revision as of 15:56, 18 September 2020

Form rules can be internationalised to different languages. A rule can set it's own language string on the element itself. But generally we allow the form rule to fetch the language string based on the pieform plugin, pluginname, key. For example for the required rule we have a language string $string['rule.required.required'] = 'This field is required.';