Step by Step: Making the Flag Module Work with Multi-Lingual Websites
Last modified: August 15, 2009 - 12:54
The flag module can be used with the i18n package. It requires some extra configuration of the default module settings, but eventually you can get to a point where:
- Flagging a node actually flags the original source node (essentially flagging all the node's translations).
- Loading the "My bookmarks" page will show the current language flagged nodes' translations.
Here are the steps:
- Install the Translation helpers module.
- Go to the Flags admin page and add/edit a flag (for this manual we'll use the default bookmarks flag).
- Under "Internationalization", check the "Flag translations of content as a group" option (this option become available with the Translation helpers module) and save the flag. Now, when a user flags a node, the source node will be flagged and all of the node's translations will appear flagged as well.
- Now edit the "My bookmarks" View.
- In "Relationships" add the "Node translation: Translations" relationship, and in its configuration set the "Translation option" to "Current language".
- Edit each field you're displaying in "Fields" and set its Relationship to "Translations".
- Save the View.
That's it! Now when the user browses to his "My bookmarks" page in language X, only flagged nodes with the X translation will appear and in the right language.
