HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Slavic conjugation
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
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
Tagged:
1
Comments
Plugin Smart Localization will save you.
update: Oh, sorry. Didnt read carefully. It will not save you. It is for other translate problems.
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 ?
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.
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.
And another small mod Feel free to make changes more generic.
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.
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 to /vanilla/applications/dashboard/models/class.activitymodel.php
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.
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.
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: Then somewher in the core:
grep is your friend.
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.
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.
grep is your friend.