0

i have a question about a multilanguage feature which i don't find. I have contenttype with many fields (about 20 fields). Now i want to translate this page in a few languages. My problem is that some fields (the content of the fields) are only visible for a specific language like italian for example.

So the first idea could be to add additional fields to the contenttype for the specific languages. In aspect to the code i would render the specific field depending of what language is selected on the page.

But in relating of adding a content this could be very confusing with many languages.

So my question is: Is it possible to show fields when adding a content depending on what language is selected for the new content. For example when i have a field which should only visible for the italian translation.

Is this a known problem?

0

If you have some specific fields which only should be viewed based on language , the best way to do that is by using page manager and panels .

  1. Download and enable this modules
  2. go to Structure -> pages
  3. enable node_view
  4. add a variant and select Selection Rules
  5. now add a rule based on user->language and node->type
  6. and now you can make a custom view based on language
  • Ok that sounds good. The main problem in my opinion is the confusing backend page (when adding the content) with all the fields. I will try your solution – Stephan Hofmann Jun 17 '15 at 8:31
  • in this case "node_edit" option of page manager can help. hope that works – Alireza Tabatabaeian Jun 17 '15 at 8:47
  • i think your answer is the solution. Just one question: As mentioned above i have many fields. In the overview were i can the fields which i want to show, is there a way to select all and then diselect the fields which are language specific. Cause now i must add all things like the submit buttons, the publish option etc.. individual. And sorry that i can't upvote your answer – Stephan Hofmann Jun 17 '15 at 11:33
  • I hope this will help a bit : drupalize.me/videos/quickly-duplicating-variants-cloning?p=1137 not to import all fields very fast but at least you can use what you have done now in the future. – Alireza Tabatabaeian Jun 17 '15 at 13:01
  • i have another question. On the pages overview where all the pages with url are listed (for example the Url: /node/%node/edit). How can i add the /node/add/%node Url to the list? Cause when i try to add this Url it always said that the Url is already in use. I can't get it to work. Is this Url possible to add? – Stephan Hofmann Jun 17 '15 at 14:19
0

I think it would be easier for you to have only one field that you would be translated with the appropriate function : t()

https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/t/7

You may then translate it directly via the code or with the translation interface in the admin menu.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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