Hi guys,
I am using latest dev version in a multilingual site. I'd like to be able to automatically translate the Label field for an Extra Address Field using default Interface Translation functionality. Unfortunately that doesn't seem to have been implemented.
I am looking for some guidance in what the best place would be to patch this.
Adding t( ) in function generate() for the field.class works but it might be better to do this in the function output.
Any thoughts?
Willem
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | patchfile.patch | 769 bytes | wjroes |
Comments
Comment #1
megachrizI have no experience with multilingual sites. Is it just as simple as adding a t()? The coder module complains about not using literal strings in t() in this case.
I think the best location to do translation, is indeed in the method output() in ucxf_field.class.php. I would like a patch. Probably the description should also be translatable. Also, maybe you want to test if your fix doesn't result in strings to be double translated.
Places where the label is outputted:
- checkout page
- order review page
- order page
- order edit page
- address fields setting page
Comment #2
maurizio.ganovelliI think it's better to use the i18nstrings function (http://drupal.org/node/789286) to translate user defined strings.
Comment #3
ucefh commentedany solution for the translation of these fields because im unable to define theme as i18n strings
Comment #4
megachrizHi ucefh,
Because of my lack of experience with multilingual sites and because I'm currently busy with Ubercart Addresses integration I won't have time to implement this soon. Did you try to implement a solution with i18n? If so, can you explain to me why it didn't work?
Comment #5
wjroes commentedI have attached a patch that just adds translation functionality in the
function output. This seems to be the most straight-forward and simple solution at this time.Comment #6
megachrizThanks for the patch, but I prefer to see this fixed with a i18n implementation, as that seems the best way to fix it. But I can commit the patch as a temporary solution if you don't have interest/time to fix this with i18n. Setting status to "needs work".
Comment #7
maurizio.ganovelliIn last commit, there is a patch for i18nstrings integration: now user defined strings for field (label and description) can be translated (added "Ubercart Extra Fields" text group).
Please let me know if you encounter problems using this new feature.
Comment #9
W.M. commentedSame applies to Drupal 7 version. The proper way to do fix this is by making similar modifications as outlined under #5 to
/class/UCXF_Field.classby implementingt()function.Comment #10
megachriz@W.M.
It has been a while since I last looked inside the Extra Fields Pane code, but I thought that I fixed this in the dev version?
Comment #11
W.M. commented@MegaChriz
I have just downloaded the development version. Yes, the issue is indeed fixed there by using i18n string translation. Thank you.
Comment #12
megachrizI hope I find the time to make a new release someday and I would like to create a new release of Ubercart Addresses on the same day. In order to keep Extra Fields Pane in optimal sync with Ubercart Addresses, I first need to test #2461417: Implement new hook hook_uc_addresses_order_load() against the latest dev of Ubercart Addresses again.