You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
It is not very easy to translate field and box labels into multiple languages when registering them.
Describe the solution you'd like
I think this should be implemented into the PMPro RH codebase (and ultimately merged into PMPro).
Introduce a new get_label() method to the PMProRH_Field class — This would check for a new property called $this->label_translations which could contain an array of translated labels by locale. The method would check get_user_locale() and return that label if the translation exists, otherwise return the normal $this->label.
Anywhere we call the $box->label ($cb->label in one place) and $field->label should be replaced with the ->get_label() method call
Introduce a new PMProRH_Box class which works similar to PMProRH_Field but just has the main properties for a box. The main point of this class would be to allow us to use similar logic to what we add to PMPro_Field for get_label()
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
It is not very easy to translate field and box labels into multiple languages when registering them.
Describe the solution you'd like
I think this should be implemented into the PMPro RH codebase (and ultimately merged into PMPro).
get_label()
method to thePMProRH_Field
class — This would check for a new property called$this->label_translations
which could contain an array of translated labels by locale. The method would checkget_user_locale()
and return that label if the translation exists, otherwise return the normal$this->label
.$box->label
($cb->label
in one place) and$field->label
should be replaced with the->get_label()
method callPMProRH_Box
class which works similar toPMProRH_Field
but just has the main properties for a box. The main point of this class would be to allow us to use similar logic to what we add toPMPro_Field
forget_label()
The text was updated successfully, but these errors were encountered: