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

farbridges - March 4, 2009 - 11:43
Project:Translation Overview
Version:6.x-2.0
Component:Code
Category:task
Priority:normal
Assigned:farbridges
Status:needs work
Description

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

#1

drewish - March 27, 2009 - 18:00
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.

 
 

Drupal is a registered trademark of Dries Buytaert.