The latest version of the i18n module (6.x-1.0) provides a Switch interface for translating option to...

...switch interface language to fit node language when creating or editing a translation. If not checked the interface language will be independent from node language

This is very convenient for multiple reasons, e.g. for using views with a Node translation: Language filter set to Current user's language for node reference selections.

It would be nice if the translation overview also checks whether the user wants to switch the interface language to the node language. I created a minor patch which takes care of this. It seems to work fine.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drewish’s picture

Category: bug » task
Status: Needs review » Needs work

humm. the code all looks good but i've got some issues with the comments, also i can't get the patch to apply for some reason.

couple of small things to fix:

+  // for the "i18n_translation_switch", we need the complete language objects.
+  // Other parts of this module might be adapted to use this list as well?

Capitalize the F in for. The question might be better as a TODO...

+ * @param $interface_language to indicate that the interface language should be
+ *  switched to the translations language (see i18n module since 6.x-1.0)

I think we need to indicate the type of $interface_language, perhaps by saying "$interface_language Boolean indicating that"
The second line needs another space after the *.

+  // We may need to switch interface language for translations (see i18n.pages.inc line 35 since i18n version 6.x-1.0)

Needs a period at the end of the sentence. Comments should wrap at 80 character long lines.

netsensei’s picture

Version: 6.x-2.0 » 6.x-2.x-dev
FileSize
3.13 KB

We needed this functionality for a project.

If you use Node References in nodes that can be translated, the entire interface needs to switch if you want to translate a node. Otherwise you might end up referring node A in language 1 from node B in language 2. Node reference will not play with i18n and trying to save the node will throw a "cannot save this node" error.

i.e. #186539: Node reference fields- This post can't be referenced

I've rerolled the patch against the dev version of translation_overview.

FiNeX’s picture

The same issue is valid on the D7 version: "switch interface" setting is not honoured by translation overview.

miro_dietiker’s picture

Status: Needs work » Needs review

needs review again then.

jmones’s picture

As #3 I have the same issue on D7. Patch on #2 doesn't apply on D7 code. Target code has changed.
Thank you for your work.

ali_b’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev

same issue in 7. could someone fix it?

james.williams’s picture

Issue summary: View changes
Related issues: +#1698840: Wrong links on node translations overview page

Issue #1698840: Wrong links on node translations overview page is also covering the same problem, though without offering it as an toggleable option.