1

So i have a Content Type named "My content type" (a simple form) and it has 5 fields.Now the default language of the field names is in English.[i.e feild1 is 'Name']. I have translated the field names using the translation interface into 20 different languages.And when users fill out the form the field names are in their respective and/or preferred language.I have created a custom page template for "My content type",and print the $content of the form there,but it is English (in other words,the field names are displayed as they are written in the content type itself).

My question : How can i display the results of the filled form so that the field names are in a specific translated language ?

A little visual example :

(this is how the "My content type" results are displayed, atm) :

First Name : lorem 
Last name : ipsum
Age : 55
Hobbies : lorem ipsum

(and i want the display the field names in a specific translated language,i.e. German)

Vorname : lorem
Familienname : ipsum
Alter : 55
Hobbys : lorem ipsum

This would be a sinch to do if i could use views (but sadly i can't,client specific rule)

If anyone can help ,i'd greatly appreciate it :)

1
  • Can you show us the example of how you render the form in your custom page ?
    – pbonnefoi
    Commented Nov 6, 2014 at 11:33

1 Answer 1

0

Since you wrote a custom template for your content type. I think the problem would be rendering fields without any specific language

For Example:

In your Template to print a field:

$field_language = field_language('node', $node, 'body');

<?php print($node->body[$field_language][0]['value']); ?>

Since drupal 7 uses Entity translation . You need to select language for specific fields instead of node.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.