Hi I would like to know if there is anyway to get the attributes to be translatable.

CommentFileSizeAuthor
#12 storm-translatable-attributes.patch687 bytesseutje

Comments

Magnity’s picture

Title: Tranlatable Attributes » Translatable Attributes

If 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.

iamjon’s picture

Hi Magnity,
Thank you for the quick reply. You are awesome!
Unfortunately we are running two languages. Any ideas?

iamjon’s picture

Hi Magnity,
Were you able to look into the issue. Any clues?
Best regards

Magnity’s picture

Afraid I'm not 100% on it. It will take some research.

Any guidance from anyone would be gratefully received.

iamjon’s picture

I'll post on IRC, maybe someone there knows.
Thank you for the quick reply.

iamjon’s picture

Hi,
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?

Magnity’s picture

The problem is that these strings are stored in the database - not code.

Magnity’s picture

PS - 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.

iamjon’s picture

Hi 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

iamjon’s picture

Here 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

iamjon’s picture

Hi 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

seutje’s picture

StatusFileSize
new687 bytes

initial 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

Magnity’s picture

Status: Active » Needs review

NR. Question is: is putting t() around a variable drupal-kosher.

If ok, then sounds ok to be committed.

seutje’s picture

sure, 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

iamjon’s picture

Seutje, 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?

Magnity’s picture

Status: Needs review » Fixed

Committed. Many thanks, iamjon and seutje.

seutje’s picture

Status: Fixed » Needs work

uhm, this only handles having a multi-lingual input interface, it doesn't handle output yet afaik

iamjon’s picture

Hi Seutje it out putted the translated values on my screen. Cause it be because I have internationalization installed, or am I missing something?

Magnity’s picture

I 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.

seutje’s picture

Status: Needs work » Fixed

oh my bad :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.