Hi,

I translated the following strings, but the translations don't appear on the stream :

<p><a href="[message:author:url:relative]">[message:author:display-name]</a> created an event in <a href="[message:gurl]">[message:gtitle]</a></p>

<p><a href="[message:author:url:relative]">[message:author:display-name]</a> created an event</p> 

<p><a href="[message:author:url:relative]">[message:author:display-name]</a> created a topic</p>

<p><a href="[message:author:url:relative]">[message:author:display-name]</a> created a topic in <a href="[message:gurl]">[message:gtitle]</a></p>

<p><a href="[message:author:url:relative]">[message:author:display-name]</a> posted</p>

<p><a href="[message:author:url:relative]">[message:author:display-name]</a> posted in <a href="[message:gurl]">[message:gtitle]</a></p>

<p><a href="[message:author:url:absolute]">[message:author:display-name]</a> posted on your profile</p>

<p><a href="[message:author:url:absolute]">[message:author:display-name]</a> posted on your <a href="[message:recipient-user-url]">profile</a></p>

Any idea on what's going on? My guess is the string translatable should not contain any html?

Comments

FleurJ created an issue. See original summary.

FleurJ’s picture

Hi!

I still have this issue. I don't understand why these translated strings still appear in English in the stream while they are well in French in the messages templates.

thanks for your help!

slowflyer’s picture

Hi FleurJ,

do you still have this issue? As far as I know Activity Actions created before you translate will still be in English.

Only new Activity Actions will use your translation.

bramtenhove’s picture

Hi FleurJ,

Ulrich is right about the current situation. However I also have some good news for the old Activity items.

I put some effort last week into making the activity stream items available for proper translation. This should land in the upcoming release.
The strings will be properly translatable, as far as I can tell it will also work for items created in the past!

Next to that it will also work for emails. If the site default language is for example English, but the preferred language of user X is French, then notification emails send to user X will be in French.

FleurJ’s picture

Hi,

Thank you both for your answers. I'm sorry, I should have closed this issue since the problem was fixed after updating. But I still have issues with translations here : https://www.drupal.org/project/social/issues/2939221

Arnaud01’s picture

Hello,

I wonder how to translate messages properly, because after an update, I have losted all my translations.

@bramtenhove Is your update available in the 1.12 version of OpenSocial ?

Thank you :)

Arnaud01’s picture

Ok, I can see that it works also with older messages :) ! Thank you @bramtenhove !

ronaldtebrake’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

vladem’s picture

Hi,
I've just made a fresh installation with composer and get the same problem. Please help to fix.

achikas’s picture

Hi,
same here.
The translation seems not to be recognized.

I looked around the files but cant find the source string
<p><a href="[message:author:url:absolute]">[message:author:display-name]</a> created a topic in <a href="[message:gurl]">[message:gtitle]</a></p>

I need a hint, where to lookup for edit it until this isnt fixed.

achikas’s picture

For now, I decided to did it this way:

Search in the database for the string:

<p><a href="[message:author:url:absolute]">[message:author:display-name]</a> created a topic in <a href="[message:gurl]">[message:gtitle]</a></p>

gave me that hex string data:

613a313a7b733a343a2274657874223b613a313a7b693a303b613a323a7b733a363a22666f726d6174223b733a393a2266756c6c5f68746d6c223b733a353a2276616c7565223b733a3134353a223c703e3c6120687265663d225b6d6573736167653a617574686f723a75726c3a6162736f6c7574655d223e5b6d6573736167653a617574686f723a646973706c61792d6e616d655d3c2f613e2063726561746564206120746f70696320696e203c6120687265663d225b6d6573736167653a6775726c5d223e5b6d6573736167653a677469746c655d3c2f613e3c2f703e223b7d7d7d

I decoded it and get:

a:1:{s:4:"text";a:1:{i:0;a:2:{s:6:"format";s:9:"full_html";s:5:"value";s:145:"<p><a href="[message:author:url:absolute]">[message:author:display-name]</a> created a topic in <a href="[message:gurl]">[message:gtitle]</a></p>";}}}

now I edit text to my needs and converted it back to a hex string.

I did this with 3 hex strings and paste them into the tables, where I found them:

cache_config
config
locales_source

After a cache clear I got my translation problem fixed for now.

I have no idea why this was made this way by the maintainers.

ohmdesbois’s picture

is there anything new about this?

for my case, despite the import of complete translation files, and despite the fact that the translations appear in the message translation interface at /admin/structure/message/manage/*/translate, for a site in French by default (set at installation) when the language selected is French , they appear in English but when the selected language is German, they appear in German.

More strange, but this is perhaps an indication of the problem, when the selected language has no translation (for example Spanish) they will appear in French!

the issues referenced or marked as duplicated are certainly linked, but different because the rest of the interface translates normally.

Thanks

corn696’s picture

Same problem.

I took a look and what happens in my case, is that the original config gets updated with the translation but not the translation config under e.g. /config/language/de

The german string is present in the "original" config and the english string in the "language" config.

If you edit the language configs and perform an import the translations show up.

If i get it right there shouldn't be any language configs if there is just on default language or? Only the "original" configs should be updated.

To reproduce this issue i setup another site with the default language english and added german later and translations work as expected.
Another new site with the default language german has this issue as well.

Just out of interest, on my way to this i took a look at the activity_creator.module and on Line 267 no language code gets passed to the getMessageText() function. But it seems to work anyway.