Posted by monti on January 28, 2010 at 7:02pm
I use a view to show a list of nodes flagged by a global flag (any user, any language) and would like to return only current language related nodes. any idea?
I use a view to show a list of nodes flagged by a global flag (any user, any language) and would like to return only current language related nodes. any idea?
Comments
Try setting your filter to -
Try setting your filter to - Node translation: Current user's language
Node translation
I am not getting this filter option in view, even I have enabled entity translation module. Needs help please?
so simple ...
how did i miss it ?
indeed:
Node translation: Language = Current user's language
sometimes you look for a solution under the floor while it is sitting calmly right in front of you.
works like a charm. thanks !
"Current user's language" is not the same as current site langua
Just a note for anybody following up on this... The "Current user's language" is the language that a particular authenticated user has set in the user settings. It's not the same as the current browser or site language.
Current user's language
From my research, this was not based on the user profile language setting (which it sounds like it should be based on the name).
This is a bit confusing as I found when writing the book for D7 i18n (and not documented as far I as I could tell). I got the low-down from looking at the code and chatting with Gábor Hojtsy. It goes something like this:
Do you have Entity Translation module installed?
1) No. Current user's language ("content language") is the same as the "interface language" which is determined by the interface language negotiation/detection settings.
2) Yes. Current user's language ("content language") is determined by the content language negotiation/detection settings (which may or may not be set to the same settings as the interface language negotiation/detection settings... depends on how you configure it).
Note that other modules may also choose to implement the "content language" behavior but currently only the Entity Translation module does so (AFAIK).
Confusing :/
Contact: https://www.hook42.com/contact
Drupal 7 Multilingual Sites: http://www.kristen.org/book
Correct
Indeed, I'm trying to filter content by the language selected by the user via the language switcher. There doesn't seem to be an option for that in the filter criteria form. I.e. "Current user's language" doesn't seem to match the language selected via the switcher.
I've posted my question on this topic here:
http://drupal.org/node/1701854
Any suggestions welcome! :-)
Does this also work with views caching?
I get wrong results with cache + Current user's language.
Views query caching, result
Views query caching, result caching or block caching? I am guessing you would get incorrect results with the first two since the query relies on a variable that changes from page to page.
I only have a "Node
I only have a "Node translation: Language" option and it's not working. I have no caching on the view at all.... When I switch my site from spanish to english - the view still displays content from both languages. I have it set as an argument...
there is a filter "Content
there is a filter "Content Negotation" you can use but it has a bug at the moment and you have to patch the module.
http://drupal.org/node/650552
Remember: I compute you!
You may also want to take a
You may also want to take a look at http://drupal.org/project/select_translation
filter views result to the current language node in drupal 7
in your Drupal 7 filter, add Content translation: Language and the check Current user's language box option.
Thanks but where?
I am sorry, but I cannot see this, maybe I do not have the correct module I am on version 7 at the moment. I just cannot seem to see the box for current users language box!
The funny thing I had it once, but after a reinstall no idea what I used.
Sorry for being an idiot. The site is www.atletasgranada.com and functions well but this email reply is the only part missing, would prefer not to have to translate myself
Regards
Stephen
Open the views in question
Open the views in question and do the following under "Filter criteria":
Then you are done. I hope you find helpful.
A Williams
How to ask for a specific field to be in the users language
Hi!
I try to make a multilingual slideshow. I have two fields: an image field that is not translatable (as it is the same picture for all languages) and a text field that is the caption of the field. Now I only want to show the images if there is a text to it in the visitors language (The current language of the website).
I tried to put on the filter "Current user's language" but it shows all the pictures anyway, and for those without caption, it just simply leave the caption out.
Mats
Enable - Follow the user's language preference
In my case enabled "User: Follow the user's language preference"
1) Menu: Configuration » Regional and language » Languages (url: /admin/config/regional/language/configure)
Check the option: "User: Follow the user's language preference."
2) In views: add new "FILTER CRITERIA"- Content: Language (= Current user's language)
But how to manage missing translations
I'm dealing with the exact same situation than ctmun.
Setting current user's language filter does work but for a list with contents not necesseraly available in all languages, we want to be able to show some content in the default language.
For ex. if I display a list of nodes in french (user's language) but that some nodes are not available in the user's language, I still want to show these nodes in another language that is available (in English).
Do you have a solution for this?
Enable - Follow the user's language preference
Great! It is working.
I have tried the Filter
I have tried the Filter Criteria to be equal to the Current user's language and this does work. Problem is not all content on the site is (or will be) translated. So I want to show the current user's language if available but English for ones that are not available. Any ideas?
content within views block not changing with language switch
i'm trying to change the language with language switch module,
language switch is working fine but content within the views block r not changing...plz help me out..thanks in advance
@ctmun and 29axe: I did what
@ctmun and 29axe:
I did what I think you're trying to do in Drupal 6. It involved using the Views Or module, which is now built in to Views 3. My example is pretty complicated, but I think Node Translation: in Drupal 6 is much the same as Content Translation: in Drupal 7. Email me directly if you want a screenshot and the exported view.
Essentially though, you create two filters: one to limit the result set to the user's current language and another to filter the result set to to the default language. When adding the second filter, make sure to use the OR operator and create a filter group with the two filters. To filter out the overlapping results -- you only want to display content in the default language IF IT HAS NOT been translated -- I used Node Translation: Source and Node Translation: Child and Node Translation: Translation set node ID and created a Node Translation: Translations relationship.
Hopefully this is somewhat simpler to do in Drupal 7 -- I haven't tried yet -- and my use case is probably a lot more complicated than most. I think if you stack filters using the OR operator, you will be able to achieve your result.
@m_arjun
Did you try the other comments in this thread? They tell you how to do what you're trying to do, particularly:
http://groups.drupal.org/node/47478#comment-630833
I'm using Drupal 7 not 6
I'm using Drupal 7 not 6
Thanks!
Thanks Alpinist1974! The same thing can definitely be done in Drupal 7 with the filters. I will try it out on my dev site as soon as my translators are done.
Thanks for reply Alpinist1974
I'm trying it in drupal7 only. but not used two filters..now i will try this one thanks..
not able to add both options
Plz send me the screen shots, my mail id arjun.v.h18@gmail.com
Did you try this?
m_arjun,
Did you try this?
http://groups.drupal.org/node/47478#comment-630833
Read the earlier postings on this page also, they discuss how to use views with the language switcher.
My advice to ctmun and 29axe is for a different use-case and does not apply to you.
If all you want to do is make the view correspond to the language switcher, add a filter for Content: Translation: User's Current Language.
How to set if content is not translated
@Alpinist1974. Can you send your exported view? I can only get one language or all of them to show up in the views. I have one filter for the current user's language and another one to show if Node Translation: Source. I think I'm missing how to do the if the content has not been translated part. any help please?!
ctmunson@hotmail.com
Also, I have about 8 languages and some nodes are translated into 2 languages but not the other 6. So Node Translation returns that it has been translated, but that doesn't mean it was translated into the current user's language.
Right now I'm at the point where the views need to be all English or every single article node needs to be translated to every language before we can publish them. It's quite tricky. Adding the filters works for some languages but then doesn't for others.
Content Translation: Language filter not showing in views filter
I also have D7 multilingual site and have same problem in views.
Here is the detail problem.
https://drupal.org/node/2020077
awilliams can you tell me what's wrong in my system ? can you list the modules that has to be enabled to get that option in the views ?
try to add node translation :
try to add node translation : child traduction or something like this in the filter.
Following module worked for
Following module worked for me:
Internationalization Views
How do you configure Internationalization Views
Hi Shashwat Purav,
Basically i have everything setup for translation and installed Internationalization Views module.
I have 2 languages in the site. Contents without view is working fine with language switcher, when i change language content will change accordingly.
However if my page is generated using View module then translation does not work.
May i know exactly what setting have you done in the Internationalization Views?
For view to display translated contents:
What do i need to set at Relationship, Contextual Filter, Filter and Content.
Do i need to have different Body field for different language? Which is the right Body field for multi-language content?
Please advise and share. Many thanks in advance.
Regards,
SIM
@kcsimcity1 You need to add a
@kcsimcity1
You need to add a filter. In views: add new "FILTER CRITERIA"- Content: Language (= Current user's language)
You may also need to enabled "User: Follow the user's language preference"
Menu: Configuration » Regional and language » Languages (url: /admin/config/regional/language/configure)
Check the option: "User: Follow the user's language preference."
Thank you @frederickjh -
Thank you @frederickjh - thats what got it working for me!