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 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 commentedSubscribing
Comment #6
dave reidComment #7
mediamash commentedany updates on this? Is this feature available in dev version? this would be superb for SEO reasons!
Comment #8
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 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 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.