Needs work
Project:
Term Fields
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Dec 2010 at 20:53 UTC
Updated:
8 Mar 2012 at 18:08 UTC
I recently needed support for translations in Views with the term_fields module. Rather than hacking the module, I created a new one to override the original views handlers and add a hook_locale_refresh that exposes term fields to i18n. It doesn't do anything to standard taxonomy pages, as I only needed it to work with Views. Thought I would share it in case anyone else needs the same functionality. I don't have CVS access and I'm really not sure if this module should exist, or if the term_fields module should be patched to include something like it, but here it is for the community to decide. :)
| Comment | File | Size | Author |
|---|---|---|---|
| i18nterm_fields.tgz | 3.33 KB | John Carbone |
Comments
Comment #1
b-prod commentedYour post sounds bizarre to me, but I will have a look soon on your handler. Actually I cannot figure exactly what you are speaking about, but after reading your code it may be clearer...
Thanks for your help.
Comment #2
John Carbone commentedIn a nutshell, I needed to be able to translate term fields when used in Views. My module exposes term fields to i18n, allowing the text to be translated in the "translate interface" (provided by the locale module). Then it overrides the term_fields Views handlers to output the translated version. :)
Comment #3
rar9 commented@John
Do I install this just as a normal module in order for it to work?
Comment #4
b-prod commentedThe files in the archive are supposed to be a module apart from term_fields, so you have to install it normally.
The integration into term_fields will probably be done some days, but not in the very next weeks.
Comment #5
colanYes, let's get this integrated into Term Fields instead of having a separate module.
Comment #6
John Carbone commentedVery cool glad to hear it's being merged. Sorry I haven't checked this issue in a while. @B-Prod: Do you have any interest in a patch or would you rather integrate it yourself?
Comment #7
b-prod commented@John Carbone: yes I would prefer a patch against the DEV version, because I have very few time now for maintaining the module, so any help is really appreciated.
Thanks a lot.
Comment #8
John Carbone commentedOK cool, I'll try to set aside some time to make a patch for your DEV version.
Comment #9
b-prod commentedThanks for your help!
Comment #10
b-prod commentedUser defined strings translation still need to be translatable, using i18nstring.
Some work has began for 'choice' widget, but need to be ported to all the remaining code.
Comment #11
Thomas_Zahreddin commentedthere are two things to keep apart:
translation of strings in the user interface (UI) and translation of taxonomy terms and additional fields.
e.g.
'description' => 'This widget handles only integers.'is not found for version 6.x-2.1
http://localize.drupal.org/translate/languages/de/translate?project=term...
use
'description' => t('This widget handles only integers.')see http://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/t
( in the moment i don't know if i use this module, so i don't provide a patch).
Content a user or administrator enters is handled by the module i18n_strings.
Comment #12
b-prod commentedThe i18n_strings support only concerns the name of field labels and other things that are created by users. And for those the support is not full and need to be improved. The current issue talks about that.
If there is some parts of code where I forgot to use the
t()function, it is a bug, so you are welcome to provide a patch against such omissions, in a separate issue, or tell me exactly (file and line number) where I missed that.