Drupal, Translating menu PATHS - drupal

Is it possible to translate a menu path in Drupal using i18n? In other words, basically creating two different links, namely:
www.mysite.com/english -- www.mysite.com/german
In other words, not just altering the paths, but supporting external links for translation.
And if so... how?

I think I don't understand completely - if you enable multiple languages, every link gets a language prefix automatically, like /en, /it etc. You can anyway alter every URL via an URL alias, a seperate one for each language.

you can't translate menu path but you can translate their alias, when you activate path module you can manually set a different path for every defined language.

if you're talking about external urls, based on the language you are viewing in your drupal site - you'd just create a different language specific menu item points to the external site. So when you're viewing your site in spanish, you'd only see the external spanish link, and the english, german, etc counterparts would be hidden

Related

Drupal 8 custom menu item different URI

In Drupal 8 I have a multi language menu. I'm able to translate the title, but how can I point to a URI specific for that language?
When I change it in one language (e.g. http://www.example.com), it is also changed in the other language, where I want a different domain (e.g. http://www.example.nl).
Is it really necessary to build a menu per language to work around this problem?
Yes, without contrib modules you need a separate menu.
However, there is a module for this: translatable_menu_link_uri.

Symfony change website's language

I am building a website using Symfony. I am wondering how can I change the language of my website by pressing a button.
Say I have two links in the footer (English and German) and when I click any of them, the whole website and all future views I access will remember my choice of language.
There are numerous websites who have this facility and I am wondering how can I achieve this goal.
Thank you!
Recommend checking out the jms/i18n-routing-bundle. You can use buttons or links to change the locale (language) and once changed the site will remain on that language. Just a bit of advice, use the "prefix" strategy when you set it up so that your site's urls will always be domain.com/language/.....
You'll have to learn how to use the translation bundle and setup translation files as well as having to learn how to setup Twig for translations, using the translation in your services and forms, but once you get the hang of it, it is really easy but time consuming.

WP plugin Polylang "copy" articles to all languages by default

I'm trying to figure out if there is a way how to set up Polylang (or some other translation plugin for WordPress) so that when I write an article or a page in one language (the default one) it will just make an exact copy of it and set it for the other languages. So the article/page is at least visible until I get my translator guy to translate it. Also he doesn't have to copy or write the article again and he just translates which is much more convenient.
Also, I'm struggling a bit with the translation of media. I know that I can turn it off, but I it would be awesome if I could use the same image and just add different translations to it, instead of uploading the same image for each language and just changing the description.
Thank you for your time :)

Multilingual drupal website with views

I'm trying to make a multilingual website in Drupal. My languages that I need are german, dutch, english and french. I've added the i18n module and added the languages.
I work with views to show my content on the website. For the moment I have one page that I want to translate in the 4 languages. I've created a view for each translation. Now I want to link my view to the correct node. Therefore I use a view field in my content node.
PROBLEM:
My problem lies in the url. The first time everything is fine.
my url: localhost/?q=nl/activiteiten
Now when I select english in my language bar the language changes but not the url. my url: localhost/?q=en/activiteiten
Here "activiteiten" must be "activities". How do I solve this?
I've searched a while for this problem on the drupal forums but I can't seem to find a good solution to this problem. The only thing I've found is working with a view field in the content node or with input_views in the body of your node. These two won't work for me.
i18 module with no need to create a view for each
language, you have to translate content using the i18, then
charge between changing the language.
You can have problems from the beginning did not use the module
all languages ​​declared, you have to edit each
content and save it to associate it well.
Well, just reading your own answer I think you've taken a wrong turn somewhere (or you're trying to do something else and I didn't quite catch on).
To create multilingual views for pages (which is what I think you want to do) you would first create a page view (duh), specify what you want to be shown and define a path to it. Then you enable (if it's not enabled already) the URL-alias ("URL-aliassen") module and define aliases for each language (ie. FR : activites - I don't like accents in URLs :p - NL : activiteiten, DE : aktivitaten - if memory serves me right anyway, again with accents removed :p). These aliases will be used as the path from that moment on.
For an article describing this process refer to : Translating Views paths in Drupal.
BTW You could also use the Pathauto module to create these aliases based on the title of your nodes of course instead of defining them manually, you can even (re)create them in batch when you alter the settings.
Eventually I've solved my problem with a view field. I've made my view and in my node I've selected that view in the list. Then in the body you can type something for that language.

Drupal I18N - Default language of View elements

I am working on a bilingual site in the latest version of Drupal 6. I installed the Internationalization module and the Views translation module, among many others.
The problem: On /admin/build/translate/search, some elements (e.g. the view title) appear in the text group "Views" and Drupal assumes they are in German, requiring an English translation.
Other elements (e.g. exposed filter labels) appear in the text group "Built-in Interface" and Drupal assumes they are in English, requiring a German translation. But in fact all the strings are in German:
To be clear, I am not seeing an issue with the language selection or the display of the view. The issue is when the page is first parsed by the language system and any translatable strings are inserted into the translation table. Drupal assignes different source languages for elements on the same page. The result is a mix of languages, once these strings are translated.
I thought that maybe it is the language preference of the user who hits the page first that interferes with this, but once I started changing it, I ran into this issue (reading the thread was eye-opening - it should be mandatory reading for anyone considering Drupal for enterprise-class solutions). Ok, now I have the URL prefix in the mix, which means that when a user changes the language preference, the site language does not change until they manually change the URL.
Once I managed to get the page rendered in English, it turned out that Drupal does not pick up the translation strings when the display language equals the source language. So no luck there.
I am ready to code my view in 2 languages, depending on what Drupal thinks the source language is for the various elements, but even that won't work. Has anybody else experienced this?
I think that you probably had basic mistake in how Drupal multilingual system work. I did the same mistake in the first multilingual Drupal site that I've built.
The most important thing to do is - if one of your languages is English - Use English in your code. if you need to put the word 'room' in one of the template use t('room') and not t('zimmer'). Your view titles? use English. Tag names and description? use English. The primary language should be English. After you setup your English site, you can translate your site using translate interface. I know it sound strange to one that his mother tongue is other than English, but I made several multilangual sites with i18n and it is the right way to do it with minimal complications.
Changing the admin interface language only change the interface - not the value. If you change the interface to German (i.e yoursite.com/de/admin/views) it doesn't mean that you are on 'German views'. It is the same view.
There are some exceptions - Multilingual variable as I explained here: How can I set a different homepage per language in Drupal?
I hope that is helpful.

Resources