Closed (fixed)
Project:
Translation Management Tool
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Jan 2013 at 13:13 UTC
Updated:
18 Mar 2014 at 16:01 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
LoyC commentedYes, this would be very usefull for sites with large amount of content.
Or is there another way to avoid searching for untranslated content by checking all pages in content overview views?
Comment #2
blueminds commented"Not translated to" filter functionality provided. Just failed to make it work for the node source overview (in the view edit preview it works, for the real display not).
Comment #3
berdirI think it would be more performant to only add the join for the specific language we need and only when we have a filter.
Unlike locale/i18n_string, where we actually need this data, here we depend on the loaded data from the entity_load() anyway.
empty is often t("- None - "), but that doesn't make sense here, nor does "Any". But just "--" is also not great.
Maybe someone else has a better idea?
What we basically want is "Do not filter" or so.
Also wondering why the test didn't fail?
Comment #4
blueminds commentedComment #5
blueminds commented-- vs None vs Any
I think the best is "Any translation status" or "Any status" but then the "Missing translation" label is off-topic.
Comment #6
berdirWhy?
You should use db_update(), same for other tests.
Just discussed the UI quite a bit with miro.
An alternative that we have been discussing is using two selects:
- Target language: Any//English/German/...
- Target status: Any/Untranslated or outdated/Untranslated/Outdated
While that is a bit more complicated at first, it is way more flexible:
- We can solve the none/any label problem more or less elegantly
- We have explicit control over the outdated flag
- We are open to adding more status options *later*, for example a "job item needs review"
- We also discussed that we could only display the selected language *later*, to be able to focus just on that.
Can you to implement that for a single source to try it out? Views is going to be a bit more complicated I guess, which leaves us with entity (the others don't have outdated).
Comment #7
blueminds commentedPlease see the patch
Comment #9
blueminds commentedComment #11
blueminds commentedComment #12
blueminds commentedFilters with status implemented for:
- entity
- i18n (we have there the i18n_status field added to the locales_target table)
- node - in this case it is ugly.
Here is how the views extension is done:
- value_form() is overidden to provide two selectboxes. One of them must have the same name as the field. The value of the second one is not passed into the query() method. Tried to send and array using #tree set to TRUE. It ended up with fatal error as it does not expect that.
- both elements show up as #states do not work there, probably custom jquery will need to be provided
- in the query() method the target_status is accessed directly via $_GET
Any ideas how to make the form part in a more standard fashion?
Comment #13
miro_dietikerThx! Some quick review here...
I guess this should only be added conditionally, if target_language is set.
Please retest including all tests.
I would stay with the same prefix:
target_language and target_language_status
Again, why not checking first for target_language and only adding the filter if present?
If a source language filter is present, those languages should not be available as target language. This possibly is a bit special as it's depending on a separately added filter.
Do we properly deal with possible key change of the exposed filters?
Comment #14
blueminds commented1. that is the case - see a few lines above
2. updated
3. the status relates to the target (the translation) not the language itself.
4. the query method will not be called unless the target language is set
5. yes. But that would require some JS. Do we want to provide such cool UX thingies? But we could at least provide validation that target/source language cannot be the same.
And no, there is no dealing with possible key change. Not sure how to do it. Basically I am not sure of anything when it comes to views :|
Comment #15
cgalli commentedI have tried the patch.
It seems to work as intended for content.
Remarks:
Comment #16
blueminds commented- locale and i18n sources do not have en language in the target language/missing translation select box
- entity/node sources have the target_language/status boxes, and validation for source/target langs to not be the same
- node source should work as expected, but the way it is implemented is basically hacking views
Comment #17
berdirThe *source* language should be unset, not "en".
Might or might not be the same. This needs to be the same logic as in getSourceLangcode()
Comment #18
blueminds commentedfixed
Comment #19
berdirThe view currently seems to have the same bug that when you go back to any language, it still uses the status and then doesn't find anything?
It's not possible that this could result in sql injection as we check that the language is valid, but it should still be passed in as an argument for the condition, we can't do anything about the alias. Well, what we could think about is using db_escape_field() instead of the custom str_replace() above?
The correct not condition for queries is <>, only MySQL understands !=
A test to verify that the source language isn't in the select would be great, basically the same as assertNoOptionSelected(), except that we don't want to find such an option. so copy and simplify the assert to verify that it doesn't find the option.
NoText, not NOText :)
Let's add some @inheritdocs. Just because views doesn't do it shouldn't mean that we don't :)
no, it's not really...
I would suggest you give it your own, hardcoded #id and then use that. That default id is just added if there's none yet. The --2 is added by drupal_html_id(), which ensures unique ID's, also on through ajax requests, but it's sometimes weird, like all forms having --2 by default.
You want expose_validate() I think, value_validate() is apparently only used in the backend.
I'll check with @dawehner if there's an example for a filter with multiple form elements.
Comment #20
cgalli commentedApplied and tested. Works as advertized.
The long list of filters makes the break ugly in smaller settings. See #2210083: Language filters break badly around color legends
In addition, the long list makes the help text obsolete on the source overview page. There is no space left!
Comment #21
berdirWhat about this for the views filter? This also fixes the reset problem mentioned above.
Comment #22
blueminds commentedplease see the patch. it also includes changes from #21
Comment #24
blueminds commenteduff, that was nice one...
Comment #25
berdirOk, committed and pushed!