Active
Project:
Simplenews
Version:
7.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Feb 2012 at 10:39 UTC
Updated:
22 Feb 2017 at 09:13 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
berdirThat variable (and all other which contain strings that need to be translatable) need to be defined in simplenews_variable_info() to show up in i18n variables.
Have a look at http://api.worldempire.ch/api/simplenews/simplenews.module/function/simp..., should be trivial to extend that with additional variables.
The per-category blocks might need a loop similar to the one in hook_block_info() if there are variables which should be translatable, so that we can expose all of them.
Patches are welcome :)
Comment #2
berdirComment #3
miiimoooPlease find attached the patch for review.
Comment #4
miiimoooFollow up: this alone doesn't make the block message in the block configuration form a multi-lingual variable (lie this does for site slogan etc). Maybe the i18n_variable doesn't collaborate well with the block configuration form?
Comment #5
berdirAh, yes, it's is probably not detected by Variable/I18n Variable translation because it's not a system_settings_form() and we are saving the variables manually.
I suggest you look at the form_alters() of these two modules and try to see if you can find a way to enable the same behavior, e.g. be adding something to the form or by calling an API function of those modules manually.
Comment #6
webflo commentedComment #7
danyg commentedThe patch works, then You should add 2 lines of code to your theme's template.php and block message is translatable after clearing caches:
Comment #8
berdirNo, that is the wrong way to do it.
Comment #9
chrbak commentedAnother quick and more easy way (but not the appropriate one) is to just add the below function in your template.php file :
Until a clear solution be found.
Comment #10
epageperron commentednm !
Comment #11
clcl commentedHi,
I have added the function in preprocess.html.inc file since I work with Omega theme.
Since I have the newest simplenews module (7.x-1.0) I can not ad the patch #3 who is for the 7.x-1.0-beta2.
Can somebody help me out with this?
Thanks in advance!
Comment #12
clcl commentedI saw in the simplenews.module
#default_value' => variable_get('simplenews_block_m_multiple', t('Select the newsletter(s) to which you want to subscribe or unsubscribe.')
I did write in the string translations a translation in dutch and french, but the default t is staying.
Probably it is a broken language link because I changed my default language to dutch. But how to fix this?
Maybe this helps other to find a solution.
Comment #13
shaneonabike commentedFor me the variables are appearing properly in i18n.
BUT they aren't actually being translated... I think I see the problem though.
simplenews.module (line 2400)
Is doing one of two things... if no variable is set retrieve the default (translated) value set. But if it's ever been changed then just retrieve that... oops.
Would it be proper to do...
Comment #14
shaneonabike commentedOk here's the patch. I ran all the translated messages through check_plain to prevent exploits which I *think* is the correct wait to deal with that.
Comment #16
clcl commentedI have tried the changes, but it failed. Is there another solution?
Comment #17
idhard commentedThe solution #19 works fine. Thanks
Comment #18
ram4nd commentedI had a different block, but #9 worked. Although I didn't try to do this with variables.
Comment #19
clcl commentedI have the omega theme and I do not see where to put the code. I tried to put the code in the preproces.html.inc but it does not work.
Comment #20
ram4nd commentedThe easiest would be to put it in template.php. Do you use omega theme directly? You should create your subtheme, use omega tools for an example.
Comment #21
clcl commentedI have made a subtheme. And I have set the code in the template.php. But nothing happened. I changed the name of THEME in Sitranstheme wich is the name of my omega subtheme.
Do I have to do anything else? I do not see a place to translate the text. Although I changed the text into subscribe or unsubscribe on the nl pages.
Comment #22
clcl commentedIn the main time the problem is solved. The buttons subscribe or unsubscribe are available in the newest version of the newsletter. So I deleted the message for the block and the message is not showing up any more.
Comment #23
clcl commentedThe version Simplenews 7.x-1.1 is the solution for the problem 'body message in block not translated.
Comment #24
berdirThere have been no changes, so I don't think this is resolved, keeping open.
Comment #25
happyjoker commentedYou can go to simplenews-multi-block.tpl and
t() function for $message such as
if ($message):print t($message);endif;If i understand a problem since my English is vey weak
good luck
Comment #26
anybodyI can confirm this problem still exists and the variable is not translatable yet.
Comment #27
Wtower commentedI can confirm this too. Subscribing.
Comment #28
corvus_ch commentedComment #29
dorkmaneuver commentedAlso confirming - and subscribing. :)
Comment #30
eevvvv commentedI can not translate Newsletter categories. I need help. Any advice will be appreciated)