Using translated content type from i18ncontent as a token for pathauto
| Project: | Internationalization |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Jump to:
This may be a duplicate, although I searched through the issues and could not find support for this feature.
When building mutlilingual websites (in our case Chinese and English), we translated content types and wanted to use this translation in the url alias. For example, http://example.com/node/123 which has the content type "Company", translated "公司" ("gongsi") in Chinese, was intended to have the following paths:
- For English: http://example.com/company/title-of-the-english-node.
- For Chinese: http://example.com/gongsi/title-of-the-chinese-node (gongsi is the transliteration of the Chinese into its pinyin equivalent).
To do so, transliteration aside, we needed a token that takes into account the language of the node and try to translate the content type into this language before using it in the path.
I guess this could be extended to i18ntaxonomy and other modules providing translation features for content that may be used as a token.
The path is attached.
| Attachment | Size |
|---|---|
| i18ncontent.module.patch | 1.05 KB |

#1
Ok for tokens, but we need some uniform naming for i18n tokens. Please see #344794: i18n support for the term and vocab node tokens
Basically, we'll use the 'i18n-' namespace for all our tokens, we don't want to clash with any other module...