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.
Problem/Motivation
Currently a number of strings are translated as a variable, for example:
$text = 'Add new !title';
if ($max >= 0) {
$text = 'Add another !title';
}
'#value' => t($text, array('!title' => t($instance['settings']['title']))),
These strings are not extracted by template extractors such as potx.
Proposed resolution
Update the calls to t()
with strings instead of variables, so the text can be translated by the community.
Remaining tasks
- Write a patch
- Review
- Commit
User interface changes
None
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#3 | paragraphs-string_translations-2855652-3.patch | 3.26 KB | idebr |
| |||
#3 | interdiff-2-3.txt | 330 bytes | idebr |
Comments
Comment #2
idebr CreditAttribution: idebr at ezCompany commentedAttached patch updates the calls to
t()
with strings instead of variables, so they can be translated by the community.Comment #3
idebr CreditAttribution: idebr at iO commentedThe change for the newline at the end of the file is included in several patch, so I have removed this change for this issue.