having multiple language switchers in a single node for Drupal 9 - drupal

So I am still getting the hang of drupal and i would like to know if this is possible.
I want to have 2 language switchers in my site. One is for the whole site. the other switcher will be exactly in one of my content types and it should only translate the content and nothing else.
So the main language switcher will translate the entire site based on URL. The second language switcher should only change the content. Is this possible? if so then what is the best way to achieve this?
I am using Drupal 9.

Related

Can't translate block in Drupal

I am building site in Drupal and I need your help. I have an assignment to make one more language translation of the site, and so far so good. However, I have one trouble with one block which isn't going to get translated, even though in the settings I translated it.
Also one strange activity I noticed is that when I try to go to VIEW section of all the other languages, I get dropped to front page (where that block is actually located) but if I press VIEW from my language translation (Swedish) of the block I get to completely new page.
If I go to front page and my language is selected, that block is actually using default language.
Any help what may cause it?
For desire url aliasing you need to install pathauto drupal module. then you can configure alise from below url
admin/config/search/path/patterns
OK, I have found a solution to this problem.
It appears that Drupal 7 by default sets your new language homepage to the default homepage and that's why this block was using default language since it was relying on the front page. Anyway, to fix the issue follow the steps:
Login to adming account, go to Configuration, System, Site Information and in the field Default front page for the language you have chosen navigate to your specific node page. That's it.

Can plone.app.multilingual work for partially translated sites?

I'm trying to get plone.app.multilingual to work with a site which is currently in English, but will become partially translated. I'm using plone.app.multilingual rather than the more familiar LinguaPlone because of Dexterity content types used by the site which LinguaPlone does not support.
I have a test site to play with. As soon as I translate one page it seems to create a /en folder for the English content and (e.g.) /fr one for the French. I can switch back and forth between the two language variants of the page, but once I'm in the French language I can't see all the other English pages. As a site visitor this is no use and it ignores the fact that although a browser may be set to prefer French, it might also accept English. I have selected what I believe to be the relevant options to allow fallback to the default site language and it lets me view them if I know the URL of the page, but that's not much use if I don't see that the content is there in the first place.
Can plone.app.multilingual be made to work in such a way that a user can see a page of content in some language even if it's not their own, or is my only option to convert the site to use Archetypes?
Thanks.
LinguaPlone would handle this case the same way: Make all content 'language neutral', except for where there is a translation.
By marking all your content 'language neutral', it'll be found and displayed to the end-user no matter what language preference has been set. Now, if any of your content does have a translsation, you do need to set English as the language for the original version so that it'll only be displayed when English is selected.
To do this, you probably can use a subscriber to the plone.multilingual.events.IObjectTranslatedEvent.
As for the creation of en/ and fr/ locations for your content, that's the task of the ITranslationLocator adapter (from plone.multilingual.interfaces, you can override that adapter to provide your own choices. See the default implementations for how this currently works.

Is it possible to translate view path/title of custom content type?

I'm a newcomer to Drupal.
I have a Drupal installation with i18n module.
Everything works perfectly however I faced one issue.
I created custom content type and a view to display it. Now I have a quesiton... Is there any possibility to translate view path/title?
Regards,
DaveW
Well known issue for all people starting their adventure with Drupal.
How to solve the problem? It's very, very simple. I presume you have your languages created and enabled - I'll use English as default language.
Create your view with requested title and path. I always use English language as the first language, ie. news.
Go to Administration » Configuration » Search and metadata » URL aliases and create new alias by clicking Add new alias link (if this module is disable you need to enable it).
From dropdown menu, select your second (or third etc.) language, in my case Polish.
In Existing system path field provide the English path of the view you created: in our case it's news.
In Path alias field provide your translation, ie. wiadomosci for Polish language.
Voila. Now, when Polish is the current language, it will use an alias wiadomosci for news path.
Note: Just tested on fresh latest Drupal installation - works perfectly.
If you take a look here:
http://reyero.net/en/drupal/drupal7_i18n_beta1_overview (This is the module author's page)
He shows options for enabling translation of taxonomy terms, which would be the path up to your actual page - such as categories you've set up for your content.
There is also a tickbox for node, which would be your content. One would think that this would translate the either the url or the node content.
His site doesn't seem to translate to the url to spanish, but just changes menu items. The URL falls back to the node number instead of the alias which was previously displayed.
Maybe this helps or maybe this is already obvious to you, but I would tray playing with those options.
Nice overview - http://evolvingweb.ca/story/drupal-7-multilingual-whats-new-i18n
Path Translation
The Drupal 7 Path Translation Module allows you to create translation
sets for paths. Path translations are used for generic paths (for
example, for views pages), not for node or taxonomy page paths. You
can configure multilingual paths by going to Configuration » Regional
and language » Translation sets » Paths.
Seems to imply that there is a way to translate the nodes - not sure if you have to hard code or if it will happen automatically - looks promising though.
This guide might be helpful as well: http://drupal.org/node/133977
The easiest way seems to be to go with the Internationalisation Views module: https://drupal.org/project/i18nviews.

URL alias for language frontpage

I have set Drupal to determine the language from the URL (path prefix), thus / is english and /da is Danish.
This works fine for all pages except /da
The frontpage for Danish is /node/14 but it doesnt show when I go to /da
Also content marked Language neutral is not showing for any language.
Any ideas?
p.s. I'm using Drupal 7.0 Alpha 2
As I know in D6, you can insert a record into {url_alias} table and everything will be ok then.
I don't think core has the ability to set an individual front page for each language. You'd have to use a module like http://drupal.org/project/i18n, which has yet to have any work completed with porting to Drupal 7.

how to organize my menu, taxonomy, views, pages in drupal 6

i am try to build a web site, it has a 2 level menu.
global|asia|euro|u.s (this is locaion menu)
about|home|news (this is content menu)
if a web site user clicks on global, it will show global|home page, if
the user clicks euro , it will show euro|home page, clicks on u.s it shows u.s|home page.
global|home , euro|home, u.s|home, all 3 have same format but different content.
for global|about, euro|about, u.s|about, if a user clicks on global , then clicks on about, it shows global|about page, clicks on euro, then clicks on about, it shows euro|about page, etc.
page content is different , but format same.
all things (items, nodes) in this web site have a location taxonomy attached to it.
for example, for home page,we have to show a picture, the picture has location attached to it.
so , when a user click on euro|home, the picture should comes from euro location , for asia|home, the picture should comes from asia location.
My question is, in drupal 6, how to organize my menu, taxonomy, views, pages to achieve the result.
A way to look at this problem would be to think of this as a multi lingual site. You have different languages:
global
asia
euro
u.s
Even if all the actual text is written in english, you can setup your site as though the languages are different. You can make different versions of english, so all the other text doesn't get translated to other languages. What's smart about this, is that you can translate your nodes, like the about page, and Drupal would show the one from your active language. This would be one way of fixing this, and clicking the different regions, would just change the language.
Another way to do this, would be to use taxonomy. Some of the things, like the menu system would be a bit more different to fix. There would be different solutions to solving your problem this way. In some ways, it would be more simple than making your site multi lingual. I think the easiest way would be to make a 4 different menus, one for each menu. Then you could make some logic in your template, that fx looked at the args, or looked at the taxonomy term you had associated to the node being displayed, and based on that, you would display the different menus. It would require much more coding, to get it to do what you want, and it's not exactly an ideal solution, but would make your site less complex.
Another way to solve this problem, could be using sub menus. So you made children to each region in your main menu. Then you could simply show the menu of the active one. This would probably be the easiest and most simple solution to your problem. Most of it, would be purely styling that would be needed to make it work like you wan to. There might be some issues making the right menu show all the time, but depending on how complex your site are, this shouldn't be a big deal.
These are 3 ways to solve your problem, each has it pros and cons, and the best is very much dependent on the nature of your site.

Resources