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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jose Reyero’s picture

Status: Needs review » Needs work

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...

adrianmak’s picture

I'm facing this problem too. You're not alone.

klonos’s picture

Are you sure this is not a duplicate of any of these:

#305639: i18n support for the tokens?
#344794: i18n support for the term and vocab node tokens
#290421: pathauto patch to provide localized and entity translated taxonomy through i18n
#736178: Add a [node:source] token for source node of a translated node

I mean, perhaps a combination of the above might offer a solution to your issue or it is simply a subset of one of them(?). If so, then please mark this one as a duplicate and lets move the talk over there in order to keep things in one place. Thanx.

klonos’s picture

yang_yi_cn’s picture

Version: 6.x-1.1 » 6.x-1.4
Status: Needs work » Needs review
FileSize
990 bytes

patch reworked as per comment #1

Jose Reyero’s picture

Component: Code » Blocks
Status: Needs review » Closed (won't fix)

No new features for 6.x

bohemier’s picture

Is there a way to do it with Drupal 7? Still can't get a translated node type...

candelas’s picture

neither do i

schifazl’s picture

Version: 6.x-1.4 » 7.x-1.x-dev
Issue summary: View changes
Status: Closed (won't fix) » Active

Should we reopen this for Drupal 7?

kitikonti’s picture

Status: Active » Needs review
FileSize
1.96 KB

I have created a patch for 7.x-1.x-dev which adds a new file like the i18n_taxonomy.tokens.inc to add two new localized tokens.

  • [node:content-type:i18n-description]
  • [node:content-type:i18n-name]
Toki’s picture

I tried to use the last patch with Panels and I did not see where I can access these new tokens. Panels is working with Chaos tools tokens, if I am right (%node:content-type and not [node:content-type]?
Is there any way to use these tokens inside Panels to have content type tokens finally translated?
Thanks for any tip.

kitikonti’s picture

I have not used panels bevore so, sry but i could not help you.

gonssal’s picture

Component: Blocks » Node
Status: Needs review » Reviewed & tested by the community

First things first, thanks kitikonti.

Seeing as the patch only adds a new file for the token api hooks, I tried patching i18n version 1.11. It works flawlessly. This could be commited to 1.11 without any problem and without breaking anything, adding crucial functionality for some sites. I tried it in a site with ~30 content types, all worked and had no problems, so I'm marking it as reviewed.

The last submitted patch, i18ncontent.module.patch, failed testing.

The last submitted patch, 5: 535522-i18n-type-name.patch, failed testing.

Jose Reyero’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

RAWDESK’s picture

Hi,

I tried to fix a similar symptom using tokens in a Display Suite custom wrapper setting, reported here :
https://www.drupal.org/node/2092509#comment-11832618
but i realized this patch only solves the content-type path translation and not the actual node path alias.

Any suggestions how i could solve this ?

#UPDATE

Fixed at https://www.drupal.org/node/2475743#comment-11833928