Skip to main content
17 events
when toggle format what by license comment
Apr 7, 2015 at 13:20 vote accept KeoP
Mar 27, 2015 at 7:47 comment added Free Radical There is no need to duplicate the work if you use the shortcut I suggest (wrap the target English strings in t() and make sure the original Spanish phrase is in Drupal's translation interface). You can have Spanish phrases in t() until you have time to translate them. Drupal doesn't care what language is inside t() it just returns that as a default is no translation exists or the page's language is English.
Mar 26, 2015 at 21:22 comment added KeoP Well, ok, I just saw your edited answer and now I understand what you mean. It is a bit tricky and I would have to duplicate the work (translating from 'Ingles' to English and 'Ingles' to Spanish), but if I don't find another simplier way I will use your approach. Thanks!
Mar 26, 2015 at 21:11 comment added KeoP I think you are wrong, acording to the docs it has to be an english string: api.drupal.org/api/drupal/includes%21bootstrap.inc/function/t/7 In fact, I tried with t('Hola mundo') but in the translation interface it only let me translate it to Spanish, not ot English.
Mar 25, 2015 at 21:35 history edited Free Radical CC BY-SA 3.0
added 2102 characters in body
Mar 25, 2015 at 21:31 comment added Free Radical The default parameter doesn't have to be English - it just works simpler that way.
Mar 25, 2015 at 21:30 history edited Free Radical CC BY-SA 3.0
added 2102 characters in body
Mar 25, 2015 at 19:44 comment added KeoP Hi, that is exactly what I need. How can I use t() to show translated strings from Spanish (default language in my site) to English? As the docs says, the input parameter has to be in English, but I'd like to find a way to use the parameter as a Spanish string, that would be perfect for me. Thanks.
Mar 25, 2015 at 15:20 comment added Free Radical There is no problem using t() to translate from Spanish to English. You just have to do it in a way that is not very intuitive.
Mar 25, 2015 at 15:19 history edited Free Radical CC BY-SA 3.0
deleted 36 characters in body
Mar 25, 2015 at 15:09 history edited Free Radical CC BY-SA 3.0
deleted 141 characters in body
Mar 25, 2015 at 15:02 history edited Free Radical CC BY-SA 3.0
deleted 141 characters in body
Mar 25, 2015 at 14:45 comment added KeoP Thanks for your answer anyway. I'm still looking for some way to translate from Spanish to English (maybe another Drupal module?)
Mar 25, 2015 at 14:42 comment added KeoP As I commented in the Patrick answer, I am not expecting to be translated automatically by Drupal, I know I have to translate it manually in admin/config/regional/translate/translate (maybe I didn't explain myself right, so sorry for my bad english). I have set Spanish as the default Drupal language hoping to make it work, but I wasn't able to translate from Spanish to English with t() function.
Mar 25, 2015 at 11:17 history edited Free Radical CC BY-SA 3.0
added 80 characters in body
Mar 25, 2015 at 10:50 history edited Free Radical CC BY-SA 3.0
added 1 character in body
Mar 25, 2015 at 10:45 history answered Free Radical CC BY-SA 3.0