Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Can i use field validation with field translation(part of i18n) somehow?
I am using field validation for "When" field, which is a date field and when i hit the "Add another item" button i get the original field name what is "Mikor". "Mikor" field is in hungarian and i made the english translation for this that is "When".
Here is my field validation settings for "When" field: When field validation settings
So [field-name] should be replaced to the correspondig language using field tranlation. On english page it should be "When field is required.". THX
Comment | File | Size | Author |
---|---|---|---|
#4 | 1960134-field_validation-translate-label-4.patch | 687 bytes | rodrigoaguilera |
#3 | field_validation.1960134.patch | 909 bytes | NicA109 |
when-validation.png | 20.48 KB | mibfire | |
field-translation.png | 47.54 KB | mibfire |
Comments
Comment #1
g089h515r806 CreditAttribution: g089h515r806 commentedCould you translate it at admin/config/regional/translate/translate?
All custom error message have been passed to t() function.
Comment #2
mibfire CreditAttribution: mibfire commentedError messages can be translated yes, but the problem is the token that is the field label what should be ran through the field translation module.
Comment #2.0
mibfire CreditAttribution: mibfire commentedlink fix
Comment #3
NicA109 CreditAttribution: NicA109 as a volunteer and commentedComment #4
rodrigoaguileraIn order to use i18n you have to call its API. Otherwise you will get the built-in interface translations instead of the translation you configured for the given field.
Patch attached.