How to translate a custom block in multiple languages?

Hello Everyone,

I have a custom made block which is working fine but my issue is I want to translate it to other language, actually I wanted in 2 languages
1. english
2. danish
Right now block is in english which is working fine, but now I also wanted that in danish for this i have a url with /dk/ where all page is in danish else then my block, So for my block I have made the languages folder inside the block folder like this : blockname/languages/da_DK/LC_MESSAGES/messages.po and but still it is not working. The block language is not getting translated. I am not sure what am I doing wrong. So can anyone please guide me that how can I solve it.


View Replies: View Best Answer
JohntheFish replied on at Permalink Reply
If you are talking about having multi language versions of the content of the block, C5DK has a development of the content block that does this currently in review by the PRB. I would expect that the same principles can be carried through to other blocks.

For translating the interface to the block, you need some of the translations experts to help you configure. This howto would be a good starting point:
savan replied on at Permalink Reply
Hello JohntheFish,

Thanks for your reply.

The link you gave which have the t('') tags around string , in my block i already have it. But my issue is my block contains the language folder of the danish language but the language is not getting translated, So cant we use the language folder inside block? For say example my block name is calculator now i have the language folder in it : blocks/calculator/languages/da_DK/LC_MESSAGES/messages.po ( and files in it. But why does my blocks strings are not getting translated? Please help to get me the solution for it.
JohntheFish replied on at Permalink Reply
You need one of the c5 users who do translations to explain this. Unfortunately thats not me :(
PatrickHeck replied on at Permalink Best Answer Reply
Hi Savan,

you can't put translation files in a block directory. Instead you can add site specific translations like described here:

savan replied on at Permalink Reply
Hello PatrickHeck,

Thats what i really wanted to know , Thanks for your reply. Fornow i have made package and used block inside it.