MailingList


 « Return to Thread: very long translation key

Re: very long translation key

by denro :: Rate this Message:

Reply to Author | View in Thread

Hi man,

i just changed the tr_key from :string to :text in the migration.
i cant use your approach in my current project as it uses the tr_key automatic fallback quite often.

otherwise it seems quite fair.

André Camargo wrote:
Hi there, globalizers.

I'm using globalize to build two multilingual sites and I saw
globalize_translations table has a tr_key string field that is 255
characteres long (I'm using MySQL), but I have some sections of text
to be translated greater than that.

The translation mechanism stop working because ViewTranslation#pick
finds by full text to be translated and tr_key is cut at 255
character.

First I changed Globalize to cut at 255 characters the translation
key, but it doesn't seems to be a good idea (we can have duplicate
keys for different texts)...

So, I monkeypatched Globalize to build a sha1 hash of text to be
translated and store it in tr_key, it seems to be working fine ;-)

But, I wrote to list because I would like to hear what do you think
about this approach.

Opinions are welcome :-)

--
andré ribeiro camargo
--
gerente de tecnologia
CanguçuCenter :: cangucucenter.com.br
PelotasCenter :: pelotascenter.com.br
--
proprietário
boa idéia software livre :: boaideia.inf.br

 « Return to Thread: very long translation key