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.
Hi,
I couldn't translate a string, so I tracked it down in the code, and found the following line in date_api.module, line 463:
$this->errors[$part] = t("The @part is missing.", array('@part' => $part));
I think this should be better:
$this->errors[$part] = t("The @part is missing.", array('@part' => t($part)));
Thanks,
David
Comment | File | Size | Author |
---|---|---|---|
#7 | date-untranslated-strings-month-day-1844092-7.patch | 752 bytes | Spleshka |
#6 | date-date_api_l18n-1844092-6.patch | 1.29 KB | dboulet |
#4 | date-date_api_l18n-1844092-4.patch | 547 bytes | dboulet |
#1 | date-1844092-date_api-i18n.patch | 514 bytes | kardave |
Comments
Comment #1
kardave CreditAttribution: kardave commentedI added a t(), now I can translate separately the 'year' 'month', 'day' strings. Patch attached.
Comment #2
kardave CreditAttribution: kardave commentedOops, forgot to change status to needs review.
Comment #4
dboulet CreditAttribution: dboulet commentedI ran into this problem as well. Here is the same patch as in #1, but reformatted.
Comment #5
dboulet CreditAttribution: dboulet commentedI’m wondering now if we should output a different, specific message for each possible value for
$part
. Having one generic error message for all values makes translation hard.For example, the French translation for the error is:
The resulting text makes sense when, for example,
$part = 'day'
:It doesn’t make sense for other options though. For example, the correct translation would be the following when the part is “year”:
or for “minute”:
Il try submitting a new patch as a second option.
Comment #6
dboulet CreditAttribution: dboulet commentedI think that this makes more sense…
Comment #7
SpleshkaSuppose we can make patch more compact.
Comment #8
berdyshev CreditAttribution: berdyshev commentedlooks good for me
Comment #9
SpleshkaAny updates here? Patch seems to be almost obvious.
Comment #10
cafuego CreditAttribution: cafuego commentedApplied to 7.x-2.x.
Comment #11
SpleshkaNice, thanks a lot! :)
Please, next time do not forget to add a commit's author. This is a common community agreement.
Comment #12
cafuego CreditAttribution: cafuego commentedYour name, as well as that of others who worked on the issue, is in the dreditor-generated commit message, as is normal on drupal.org.