Hi I would like to know if there is anyway to get the attributes to be translatable.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | storm-translatable-attributes.patch | 687 bytes | seutje |
Hi I would like to know if there is anyway to get the attributes to be translatable.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | storm-translatable-attributes.patch | 687 bytes | seutje |
Comments
Comment #1
Magnity commentedIf your site is only running one language, then you could go through the attributes, and for each attribute where it is domain=>key=>value, replace the value with the translated version but keeping the domain and key the same.
Comment #2
iamjon commentedHi Magnity,
Thank you for the quick reply. You are awesome!
Unfortunately we are running two languages. Any ideas?
Comment #3
iamjon commentedHi Magnity,
Were you able to look into the issue. Any clues?
Best regards
Comment #4
Magnity commentedAfraid I'm not 100% on it. It will take some research.
Any guidance from anyone would be gratefully received.
Comment #5
iamjon commentedI'll post on IRC, maybe someone there knows.
Thank you for the quick reply.
Comment #6
iamjon commentedHi,
I'm posting my experts from IRC maybe it will get us closer to a solution...ps I'm completely over my head on what any of this means...but I guess that is the best way to learn
iamjon: look, if you have any sort of variable that is not in code then you need i18n
chx, um, i'm still confused as to what you're saying. if the module lists/has it's own variables and they are in code we need il8n module (which is installed)...and if it doesn't pick up the variable then I should assume that the variable is not wrapped around t()?
iamjon: so
iamjon: t() is for constant strings
iamjon: t('this is a string')
iamjon: t($foo) is not valid.
iamjon: you need i18n for that
iamjon: for example, i18nstrings
iamjon: my limited knowledge on this ends there.
Does this help at all?
Comment #7
Magnity commentedThe problem is that these strings are stored in the database - not code.
Comment #8
Magnity commentedPS - I'm sometimes go into IRC. Which room are you using? Perhaps if we're in there together at somepoint then we could sort it out.
Comment #9
iamjon commentedHi Magnity,
I'm generally find myself in #drupal, #drupal-support, between 9:30-19:00 Tel Aviv time.
I think this post by Gabor may be helpful to us possibly:
http://hojtsy.hu/blog/2007-nov-15/make-jump-ensure-your-drupal-modules-a....
See you in IRC
Comment #10
iamjon commentedHere is an exerpt from a chat I had with quicksketch on the subject. I hope it was helpful. Am I asking the right questions? Have I understood the problem accurately? Maybe I've missed something in what I'm asking for.
quicksketch, so in a general sense for the module to be translateable out of the box, it should register variabels in the variables table...essentially I'm trying to understand what do we have to change in a module to make 'stuff' it uses translateable
iamjon yes storing things using variable_set() and variable_get() is a very easy way to make user strings translatable
quicksketch, awesome...any other general tips on making things translateable? thank you so much for you time
iamjon even though it's considered bad practice, it's also possible to just put t() around variables. CCK is a common example of translating things like this
it uses t() for it's field labels, but that's because they're considered to be "part of the site"
you don't frequently delete or rename fields once the site is set up
quicksketch, do youk know how s taxonomy goes about making tags translateable...because the issue we're having is with "attributes" that have a lot in common with terms?
iamjon i think that i18n provides a separate table for storing the translation of terms
Comment #11
iamjon commentedHi Magnity,
How are you? I was wondering if you're interested in setting up an irc meeting so we can discuss this issue. I'm still a super noob but maybe I can help it along the process.
I would also like to let you know that I appreciate how active you are as a module maintainer, you regularly answer posts and set a great example to the greater drupal community. I will browse through the issue queue and see if there is anything I can add.
Best regards
Comment #12
seutje commentedinitial crack at this, note that this is only for input and for the 6.x-dev version, but will prolly apply to 6.x-1.30 as well
Comment #13
Magnity commentedNR. Question is: is putting t() around a variable drupal-kosher.
If ok, then sounds ok to be committed.
Comment #14
seutje commentedsure, as long as the variable ur passing isn't in constant flux or is already being translated trough better mechanics like $block->title for instance
but as an example, CCK uses
t($field['widget']['label'])-> http://drupalcode.org/viewvc/drupal/contributions/modules/cck/content.mo...once this value is set, it's not suppose to change all the time
Comment #15
iamjon commentedSeutje, Magnity, I would really like to thank you for the work you put into this. It was awesome to watch you both work.
If no one has anything else to say I'll mark this as closed, and we will all eagerly await for it to be rolled in the next version. Yes?
Comment #16
Magnity commentedCommitted. Many thanks, iamjon and seutje.
Comment #17
seutje commenteduhm, this only handles having a multi-lingual input interface, it doesn't handle output yet afaik
Comment #18
iamjon commentedHi Seutje it out putted the translated values on my screen. Cause it be because I have internationalization installed, or am I missing something?
Comment #19
Magnity commentedI believe it does cover the output because the function within which the change has been made is a helper function that returns a list of attributes.
This same function is called on both input and output.
Comment #20
seutje commentedoh my bad :)