Closed (fixed)
Project:
Case Tracker
Version:
6.x-1.0-beta4
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Mar 2007 at 01:40 UTC
Updated:
8 Sep 2010 at 00:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
jmiccolis commentedBumping version to HEAD, as this is something I'd like to see addressed.
Comment #2
artol commentedUpdate table strings in casetracker_case_states. Chears, Arto
Comment #3
boobaaPlease find the attached patch, which makes use of i18nstrings.module (if available) to make Case Tracker states translatable. (This is the first time I make strings translatable, so please correct me if I was following Making your custom data translatable the wrong way.)
Comment #4
boobaaPrevious patch had a bug: with that one there were wrong locale locations in the DB. Now this rerolled one has removed this bug, and it even has "refresh" capability.
Comment #5
boobaaSorry for submitting a git patch - I'm not too used to ancient things like cvs. Attaching a "proper" cvs patch now.
Comment #6
svendecabooterPatch in #5 works as advertised.
That seems like the best approach as far as I can tell.
Comment #7
jose reyero commentedThe patch looks good. Just some tips:
- Instead of module_exists('i18nstrings') it's easier to implement some module's wrapper like
Read about this here: http://drupal.org/node/609364
- The hook_locale($op = 'refresh') is deprecated, not needed anymore
- Maybe you'd save some code and improve performance by making the casetracker_realm_load() and/or casetracker_case_state_load() return the translated names. You can do it either by passing a $translate parameter or by adding a new property. I.e.
Comment #8
boobaaReworked the patch following Jose's advices above.
Comment #9
jose reyero commentedThis latest one looks great. Just added some minor improvements:
- The textgroup 'casetracker' can be added by casetracker_tt(), will save some text
- The same function can be used too for casetracker_state_save(), saving some code
- The string id namespace: "[realm]:[csid]" replaced by "case_states:[csid]" (This is to avoid clashes in the future in case you have other types of objects translatable in this module, and other realms)
Re-rolled and tested. It works for the basic case of state names translation though may use some improvements in the future (translate other stuff, take a language parameter for cron/mails, etc, etc...)
Comment #10
svendecabooterThat works like a charm Jose
Comment #11
castawaybcn commentedworks great for me too, thanks!
Comment #12
jmiccolis commentedThanks all, this is committed.
Comment #14
jose reyero commentedThis is an update for the latest i18nstrings (6.x-1.3) changes.
Right now it still works though it is using an obsoleted API, soon to be dropped.
Comment #15
jmiccolis commentedThanks Jose, this has been committed.
Comment #17
sepla commentedSubscribing.