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,
First thanks for this a great module. I have a problem because currently I'm maintaining a multilingual site and the [site-name] was not translated. I now use the following hack to make the sitename translated:
$page_title_pattern = str_replace('[site-name]', t(variable_get('site_name', 'Drupal')), $pattern);
but still wondering if there's any better way to do that?
Comment | File | Size | Author |
---|---|---|---|
#3 | token_tt.patch | 1.56 KB | aufumy |
Comments
Comment #1
nicholasThompsonHmmm Translated tokens! Interesting. How do other token modules get around this?
Comment #2
nicholasThompsonTurns out other modules dont get around this ;-)
Spoke to eaton on IRC and it turns out this is an issue with Token which is under discussion...
Comment #3
aufumy CreditAttribution: aufumy commentedadd i18n module tt wrapper, to allow node type info to be translated
Comment #4
Dave ReidI wrote in #545710: Token are not all translated correctly, which was marked a duplicate of this issue:
Plus, translating something that's not normally should probably be a feature, not a bug. :)
Comment #5
srobert72 CreditAttribution: srobert72 commentedSubscribing
Comment #6
Dave ReidComment #7
mediamash CreditAttribution: mediamash commentedany updates on this? Is this feature available in dev version? this would be superb for SEO reasons!
Comment #8
intyms CreditAttribution: intyms commentedsubscribing
Comment #9
klonosPing?
Comment #10
Dave ReidThe i18n module should provide its own tokens if it needs to.
Comment #11
Dave ReidComment #12
liquidcms CreditAttribution: liquidcms commentedDave, i dont think this is about tokens specifically for i18n. Its about the token framework being able to support other modules adding tokens that can be translated.
I see it used in some token code now; but when i just added some new token code and wrapped in t(). The strings never showed up in translation interface search.
Comment #13
Dave ReidThat's because doing
t($variable_or_something_that_is_not_actually_a_string);
is an invalid usage of t().Comment #14
liquidcms CreditAttribution: liquidcms commentedin mymodule_token_values()
if i have
$values['some-token'] = t("some string i would like to translate");
this string is not searchable in translation interface.