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.
Follow-up to #2544544: Translate «The term '@term' will be added.»
«The term '@term' will be added.» — It is displayed regardless of the language. We need to do a line with the possibility of translation into other languages.
For the 8.x branch, many of the message strings are already translated, but there are still a few which aren't, both in .js and .php files.
Grepping for 'message' should locate all of them.
Refer to #8 for the D7 issue for how to translate message in .js files, if needed.
Comment | File | Size | Author |
---|---|---|---|
#2 | not_found_message_translation-2903961-2.patch | 1.2 KB | thomjjames |
Comments
Comment #2
thomjjames CreditAttribution: thomjjames at Ramsalt Lab commentedHi,
"not_found_message" was using $element array rather than $settings array in the field widget so the custom message wasn't showing, this patch fixes that and some related translation fixes. I'm not 100% sure the custom message should be translatable though?
Probably more translation fixes not covered by this patch but it does fix the "not_found_message" at least.
Cheers
Tom
Comment #3
oriol_e9gThe bug is out of scope and is fixed here: #3014259: Fix bug for custom Not Found Message
Comment #4
oriol_e9gThis text should not be translated here because @term param should be passed with t() function.
This string is used in an ajax call and passed through Drupal.t() in autocomplete deluxe.js with the correct @term param. If you translate before is double translated.
Comment #5
oriol_e9gIn teory is translated here:
autocomplete_deluxe.js:
Comment #6
oriol_e9g@thomjjames can you try this ? #3025308: Drupal.t cannot translate strings passed through vars
Comment #7
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedComment #8
sickness29 CreditAttribution: sickness29 at DevBranch commentedThis is working on 2.0.x-dev without any patches.
The strings are configured on form display, so you can simply create config for specific language and specify translated values for not_found_message and no_empty_message.
For example, you have Ukrainian as second language on site and want to translate this values for
field_tags
onarticle default
form display, then you need to put new filecore.entity_form_display.node.article.default.yml
into[your_config_sync_folder]/language/uk/
wtih something like that:
After config import your strings will be translated when page displayed in Ukrainian.
Comment #9
sickness29 CreditAttribution: sickness29 at DevBranch commentedHi @rajab-natshah
this can be simply "Closed (works as designed)" as it is possible to translate all those texts through config translation