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.
I have been trying for a while but the strings defined in a custom format preset do not show up for translation. Is this correct?
Sorry if I am missing something, but the only close relevant post I found was #973564: formatPlural, which is not exactly my case.
Thanks for an excellent module btw.
Comments
Comment #1
AndyThornton CreditAttribution: AndyThornton commentedI'd be interested to know if there are any translations possibilities too, please.
Comment #2
AndyThornton CreditAttribution: AndyThornton commentedI figured out a way around it. It may help some people who are okay writing a tiny bit of PHP.
Somewhere where you can output PHP (a custom block? a module? a node?) you can use one of the example in the readme file.
e.g. (didnt try this exact code ... pls forgive any typos). as you can see the word 'hours' get passed through the translate function. you can follow this pattern for mins, secs etc
echo '
2014-10-26T10:28:00-07:00
down
%hours%' . t('hours') . '
';
Comment #3
jvandervort CreditAttribution: jvandervort commentedYou are all correct, there is no provision for translating strings input as custom formats. Translating "user entered data" is a tricky thing. If the workaround works for you, GREAT:)