Translation for Activity items not getting picked up
Hi everyone,
I'm using Vanilla 2.1.3.
I have trouble translating the Activity messages into Korean. The translation is not getting picked up and everything is still in English.
For example, for user registration, I have the following lines in my /locales/Korean/definitions.php file:
$Definition['Activity.Join.FullHeadline'] = '%1$s님이 가입하셨습니다.'; $Definition['Activity.Join.ProfileHeadline'] = '%1$s님이 가입하셨습니다.'; $Definition['HeadlineFormat.Registration'] = '{ActivityUserID,You}님이 가입하셨습니다.';
But when I go to the Activity page, all the messages still appear in English.
I have fully read the following discussions:
http://vanillaforums.org/discussion/21001/help-make-activities-and-notifications-more-localizable
http://vanillaforums.org/discussion/13766/activity-translation-problem
http://vanillaforums.org/discussion/27666/a-sentence-sometimes-translated-sometimes-not
I still can't seem to figure out what I'm doing wrong. Is there something else I have to do in addition to putting the above lines in my definitions file? Any help would be appreciated.
And thank you for a great platform!
Best Answer
-
hgtonight MVP
Welcome to the community!
Have you checked that the translations show up on new activity items?
The activity table stores the headline in the db, so translation changes won;t be reflected in existing activity items.
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
5
Answers
Welcome to the community!
Have you checked that the translations show up on new activity items?
The activity table stores the headline in the db, so translation changes won;t be reflected in existing activity items.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Oh wow, thank you @hgtonight , I just confirmed new messages are successfully translated!
Um, so if the messages are hard-coded into the db, does it mean I can never make them switch between the two languages with the Multilingual switch? (I am serving both Korean and English in my forum) As in, any particular activity item can only be displayed in one language?
Thanks again!
You are correct. You write a plugin that looks at the activity type ID and use the translation code to display an updated headline.
I don't know how messy that would be, but I would guess it would be quite the feat to get all the edge cases.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
I see, that resolves much of the mystery.
This might slightly diverge from my original question, but do you know which definition I should use if I want to translate the "and" in the multiple-user activity message?
Say, when 2 users join, my message currently looks like this:
"UserA and UserB님이 가입하셨습니다."
I would be content to just replace the "and" with a comma, so that the sentence appears as
"UserA, UserB님이 가입하셨습니다."
I tried adding $Definition['and'] = ','; to my localization file to no avail...
I don't have any grouped notifications on my forum.
What version of Vanilla are you running?
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
I'm running 2.1.3. I can see that this forum itself shows the same grouping behaviour on http://vanillaforums.org/activity so I guess that's the default behaviour.
If I can't replace the "and" with a comma - alternatively, can I just disable the grouped notification like your forum? Did you have to use a plugin to disable it?
I appreciate all your help!
I don't have a high volume forum. I don't think activity has been recorded close enough to be grouped.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.