Hi
I'm trying to translate Vanilla to polish and found that polish (and probably other Slavic) "activities" translation will be quite difficult, because verbs in the past tense are inflected for gender.
It can be done by changing ActivityHeadline and ProfileHeadline functions in /library/core/class.format.php
Is there other way to implement Slavic conjugation , like adding some functions to definitions.php
1 • •
Comments
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Plugin Smart Localization will save you.
update: Oh, sorry. Didnt read carefully. It will not save you. It is for other translate problems.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I added 1 line to /vanilla/applications/dashboard/models/class.activitymodel.php
public function ActivityQuery() {
$this->SQL
->Select('a.*')
->Select('t.FullHeadline, t.ProfileHeadline, t.AllowComments, t.ShowIcon, t.RouteCode')
->Select('t.Name', '', 'ActivityType')
->Select('au.Name', '', 'ActivityName')
->Select('au.Gender', '', 'ActivityGender')
->Select('au.Photo', '', 'ActivityPhoto')
->Select('ru.Name', '', 'RegardingName')
->Select('ru.Gender', '', 'RegardingGender')
->From('Activity a')
->Join('ActivityType t', 'a.ActivityTypeID = t.ActivityTypeID')
->Join('User au', 'a.ActivityUserID = au.UserID')
->Join('User ru', 'a.RegardingUserID = ru.UserID', 'left');
}
This modification will allow to format string depending on gender in /vanilla/library/core/class.format.php in function ActivityHeadline. This hard-coded suffixes works for me ;-)
But now, how to overwrite (overload??) ActivityHeadline function from definitions.php ?
- Spam
- Abuse
- Troll
1 • Off Topic Insightful Awesome LOL •If it is possible this should be implemented in V2.01, bacause all eastern Europe has this kind of conjunction...
In our languages we use different verbs he and she.
He says: / On je rekao:
She says: / Ona je rekla:
Nice add on.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •GenderSuffix.Second.m = 'eś'
GenderSuffix.Second.f = 'aś'
GenderSuffix.Third.m = ''
GenderSuffix.Third.f = 'a'
Also, I'm going to be putting support for translating the activities in your language files so they will be portable.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •And another small mod
Feel free to make changes more generic.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •If you want to try the fix, but don't want to copy everything then the only file affected is /library/core/class.format.php.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Line 113 $GenderSuffixCode = "GenderSuffix.$GenderSuffix.{$Activity->ActivityGender}";Should be
$GenderSuffixCode = "GenderSuffix.$GenderSuffixCode.{$Activity->ActivityGender}";to get suffix gender like GenderSuffix.Third.m
Another problem is, that gendersuffix depends on Regarding user gender(if any)!
ie i get
# GenderSuffix.Third.f -- my debug
Misiek utworzyła konto użytkownikowi Michalina.
Misiek(male) created account for Michalina(female)
This shoud be
Misiek utworzył konto użytkownikowi Michalina.
But
Michalina dołączyła
Michalina joined
And
Misiek dołączył
Misiek joined.
So this is why i added
->Select('ru.Gender', '', 'RegardingGender')to /vanilla/applications/dashboard/models/class.activitymodel.php- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •It would really be great if someone here can get their own branch going in github and send us pull-requests. It will go much faster.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I propose rewriting ActivityHeadline to get it clear.. It works for me, but please test it before committing. Especially Eastern and Central Europe translators could help. I tried to get all conditions , but simply could miss something.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
1 • Off Topic Insightful Awesome LOL •Russian suffixes for varius male/female verbs are different. You can't just specify one suffix and be happy with that. For example:
Joined - зарегистрировался/зарегистрировалась.
Edited - отредактировал/отредактировала
With current code it's quite hard to get into it and impossible to do these varying suffixes.
I think you should create some api for locales, so that locale developers might write their code. For instance:
function formatActivityString(<all parameters, including activity code, all names, genders and so on>) {
Then somewher in the core:switch ($ActivityCode) {
case "Joined":
return "$ActivityUserName зарегистрировал"
. ($ActivityUserGender=='m' ? "ся" : "ась")
. " на форуме."
case "Some":
case "Other":
case "Activities":
case "WIth":
case "Common":
case "Suffixes":
$codes = array('containting activity lines and codes');
return sprintf($codes[$ActivityCode], $ActivityUserName, $ActitvyUserGender=='m' ? "" : "а", $somethingElse);
default:
return false; // so that we might know that we should return default string;
}
}
if (!function_exists('formatActivityString')) {// Fallback to currently used code
}
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Don't PM about development, I'm not currently taking on clients.
grep is your friend.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Fb adds "użytkownik" before each username in polish. "Użytkownik" means "user" and is sex independent. Reading "użytkownik" in every post makes me angry ;-). They are my friends, not just users.
I like @TiGR's way of making translators responsible for quality of translation. AFAIK we have about 20 activities and only some of them are problematic.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •TiGRs idea is messy IMO. Function overrides are not the best way to extend. I think you should only be extending local conventions, as they apply to output.
Don't PM about development, I'm not currently taking on clients.
grep is your friend.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Has this problem been solved in the new version?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I don't think this has been solved, but I want to make sure it is solved before we release version 2.1. Here is what needs to be done though:
I need to come up with some proposed solutions.
I will need feedback from the community on whether or not it will work with various languages.
I'll be posting a thread on it this week so if you know how to speak a language that needs this feature then please keep an eye open.
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •@Todd, please, drop a link to that discussion here once you create it.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Will be happy to contribute as well if I only can. I don't have any specific issues with gender related translations other than they are not used in my language at all, problems are merely with plurals and personal pronouns. And especially the activity feed is hard to translate fluently.
I have reported these already and Todd is aware of them, but in case other languages are facing same kind of problems, here's a link to that thread: http://vanillaforums.org/discussion/20650/personal-pronouns-plurals-you-vs-username-and-possible-other-issues-with-localization#latest
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Hey all, we are discussing a solution to activity translation here.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •