Download & Extend

Use i18n_translation_switch if set to switch interface language to fit node language

Project:Translation Overview
Version:7.x-2.x-dev
Component:Code
Category:task
Priority:normal
Assigned:corneverbruggen
Status:needs review

Issue Summary

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.

AttachmentSize
translation_overview_use_i18n_translation_switch.patch3.33 KB

Comments

#1

Category:bug report» 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.

#2

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

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.

AttachmentSize
translation_overview-390756.patch 3.13 KB

#3

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

#4

Status:needs work» needs review

needs review again then.

#5

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.

#6

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

same issue in 7. could someone fix it?

nobody click here