Needs review
Project:
Country code
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
3 Nov 2008 at 18:42 UTC
Updated:
15 Dec 2008 at 23:14 UTC
Jump to comment: Most recent file
Now that we've reworked country_code to set the global language to a country-specific language (e.g., fr-CA for Canadian French), the views filter that implements a language fallback is no longer in any way country specific.
Previously, the filter detected the current country and current language and said: show me all content for the current country-language or for the current language if there is no country-language version.
Now, the filter says: show me all content for the current language (e.g., fr-CA) and as a fallback any content for a two-digit version of that language (fr). In other words, it has no direct tie to country and could be implemented separately.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | views_language_fallback.tar_.gz | 1.38 KB | recidive |
| #6 | views_language_fallback.tar_.gz | 1.22 KB | recidive |
| #6 | country_code_move_language_filter.patch | 3.11 KB | recidive |
Comments
Comment #1
nedjoYes, this needs to be done. The filter is not tied to country and so belongs in a new module.
What should we call such a module? "Views language fallback" would be descriptive but long.
Comment #2
nedjoThe patch in #325887: Lack of indexes produces hugely slow query should go into the new module.
Comment #3
nedjoIssue #328194: Switch to all lower case language codes is also relevant. We should ensure the filter treats language codes as case insensitive.
Comment #4
nedjoThe filter should go in the "Node translation" group rather than the "Node" one.
Comment #5
recidive commentedWorking on this.
Comment #6
recidive commentedI've moved language filter to a new module. I called it 'views language fallback' for now (name suggestions are welcome).
Patch and new module attached and need testing.
Question: do we need an upgrade path?
Comment #7
nedjoLooks good. We should incorporate the indexes from #325887: Lack of indexes produces hugely slow query, see this patch: http://drupal.org/node/325887#comment-1090586
Comment #8
nedjoAs for updating... That would be pretty challenging, since we can't count on the new module being installed. Should we instead have a script that can be manually run?
We need to identify just what needs to be changed. I guess it's data in views tables. Possibly just a straight sql update substituting the new module's filter name?
Comment #9
recidive commentedAdded a .install file and hooks to create the indexes.
Comment #10
recidive commentedAssigning back to me. I don't know why it got unassigned.
Comment #11
nedjoBefore posting as a contrib module, we should check in with merlinofchaos about whether this might go in Views.
Comment #12
recidive commentedPosted a feature request to views queue.
Comment #13
catchWe can't put it in views due to the indexes - views is read only. Should it live in its own small module, or maybe the i18n package?
Comment #14
nedjoToo specific for i18n I think. Probably this belongs in its own small module.