Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Translation Issues
Hi Vanilla Team + folks,
I am trying the Vanilla 2 beta on my server, and wanted to translate it to German.
Following the post http://vanillaforums.org/discussion/comment/96613/ I figured out how to get the strings for the translation. I changed all definitions within definitions.php to my language, e. g. $Definition['Welcome, %s!'] = 'Willkommen, %s!';
It works fine, however:
- [in Activity] -> "changed your profile picture".
- [Search-Box input field] -> "Search"
- [discussion] "Cancel" button
- [activity] "Comment" button
- [profile] tab 'Activity'
- and "Remember me on this computer"
Edit: See solutions below!
Thanks guys for the great beta!
If we fix some more things, beta will be gone soon
I am trying the Vanilla 2 beta on my server, and wanted to translate it to German.
Following the post http://vanillaforums.org/discussion/comment/96613/ I figured out how to get the strings for the translation. I changed all definitions within definitions.php to my language, e. g. $Definition['Welcome, %s!'] = 'Willkommen, %s!';
It works fine, however:
Issue 1
Some language strings are missing, I cannot find them (and thus don't know how to overwrite them in definitions.php):- [in Activity] -> "changed your profile picture".
- [Search-Box input field] -> "Search"
- [discussion] "Cancel" button
- [activity] "Comment" button
- [profile] tab 'Activity'
- and "Remember me on this computer"
Edit: See solutions below!
Issue 2
BUG "Tab-Link-Bug caused by translation": I put this into the issue tracker at http://github.com/lussumo/Garden/issues/#issue/120Issue 3
How can I actually change the time format from am/pm to 24 hours? Could not find an option.Thanks guys for the great beta!
If we fix some more things, beta will be gone soon
0
Comments
Maybe by changing the configuration:
The default parameters are:
$Configuration['Garden']['DefaultDateFormat'] = 'F j, Y'; $Configuration['Garden']['DefaultDayFormat'] = 'F j'; $Configuration['Garden']['DefaultYearFormat'] = 'F Y'; $Configuration['Garden']['DefaultTimeFormat'] = 'g:ia';
Add the following lines to \vanilla\conf\config.php
German format would look like this:
$Configuration['Garden']['DefaultDateFormat'] = 'j. F Y'; $Configuration['Garden']['DefaultDayFormat'] = 'j. F'; $Configuration['Garden']['DefaultYearFormat'] = 'F Y'; $Configuration['Garden']['DefaultTimeFormat'] = 'H:i';
This helps on more formats: http://de.php.net/manual/en/function.date.php
Cheers
@Mark + Vanilla team: Could you consider this for the next release please?
Good morning greetings from Berlin!
Kai Kajus
Hope the work will be of help!
e.g. there is no effect after changing: Checking the SQL database shows me that "GDN_ActivityType" is holding all strings that have to be translated.
So how can we solve that?
As for the activity type strings, we can translate them before spitting them out (in the Format class).
OLD: return sprintf($ProfileUserID == $Activity->ActivityUserID || $ProfileUserID == '' ? $Activity->FullHeadline : $Activity->ProfileHeadline, $ActivityName, $ActivityNameP, $RegardingName, $RegardingNameP, $RegardingWall, $Gender, $Gender2, $Route); NEW: return sprintf($ProfileUserID == $Activity->ActivityUserID || $ProfileUserID == '' ? Gdn::Translate($Activity->FullHeadline) : Gdn::Translate($Activity->ProfileHeadline), $ActivityName, $ActivityNameP, $RegardingName, $RegardingNameP, $RegardingWall, $Gender, $Gender2, $Route);
One remark: Since Vanilla-2 is using placeholders within the syntax, e.g.
%1$s changed %6$s profile picture.
their might be problems with other languages. In German the verb is changing as well:
user1 changed his profile picture → user1 hat sein Profilbild geändert
you changed your profile picture → du hast dein Profilbild
I can find workarounds for that, but you like to consider other languages that are even more problematic!
I have to check github, it's new for me. But will try so on the weekend.
Have a great day,
Kai
1. library/core/class.format.php
OLD: $Gender = Translate($Activity->ActivityGender == 'm' ? 'his' : 'her'); $Gender2 = Translate($Activity->ActivityGender == 'm' ? 'he' : 'she'); NEW: $Gender = Translate($Activity->ActivityGender == 'm' ? Gdn::Translate('his') : Gdn::Translate('her') ); $Gender2 = Translate($Activity->ActivityGender == 'm' ? Gdn::Translate('he') : Gdn::Translate('she') ); OLD: $Gender = $Gender2 = 'your'; NEW: $Gender = $Gender2 = Gdn::Translate('your'); OLD: $Route = Anchor($Activity->RouteCode, $Activity->Route); NEW: $Route = Anchor(Gdn::Translate($Activity->RouteCode), $Activity->Route);
2. applications/garden/views/activity/helper_functions.php
OLD: echo Anchor('Delete', 'garden/activity/delete/'.$Activity->ActivityID.'/'.$Session->TransientKey().'?Return='.urlencode(Gdn_Url::Request()), 'Delete'); NEW: echo Anchor(Gdn::Translate('Delete'), 'garden/activity/delete/'.$Activity->ActivityID.'/'.$Session->TransientKey().'?Return='.urlencode(Gdn_Url::Request()), 'Delete'); OLD: echo $Activity->AllowComments == '1' && $Session->IsValid() ? '<span>•</span>'.Anchor('Comment', '#CommentForm_'.$Activity->ActivityID, 'CommentOption') : ''; NEW: echo $Activity->AllowComments == '1' && $Session->IsValid() ? '<span>•</span>'.Anchor(Gdn::Translate('Comment'), '#CommentForm_'.$Activity->ActivityID, 'CommentOption') : ''; OLD: echo $Activity->AllowComments == '1' && $Session->IsValid() ? '<span>•</span>'.Anchor('Comment', '#CommentForm_'.$Activity->ActivityID, 'CommentOption') : ''; NEW: echo $Activity->AllowComments == '1' && $Session->IsValid() ? '<span>•</span>'.Anchor(Gdn::Translate('Comment'), '#CommentForm_'.$Activity->ActivityID, 'CommentOption') : ''; OLD: echo $Session->UserID == $Comment->InsertUserID || $Session->CheckPermission('Garden.Activity.Delete') ? '<span>•</span>'.Anchor('Delete', 'garden/activity/delete/'.$Comment->ActivityID.'/'.$Session->TransientKey().'?Return='.urlencode(Gdn_Url::Request())) : ''; NEW: echo $Session->UserID == $Comment->InsertUserID || $Session->CheckPermission('Garden.Activity.Delete') ? '<span>•</span>'.Anchor(Gdn::Translate('Delete'), 'garden/activity/delete/'.$Comment->ActivityID.'/'.$Session->TransientKey().'?Return='.urlencode(Gdn_Url::Request())) : '';
edit: I am ready for support.
Hope to be fit again next week.
because it is the greate script
vanilla vs punbb and phpbb
vanilla is win
OLD: if ($Label != '') $Input = '<label for="' . ArrayValueI('id', $Attributes, $this->EscapeID($FieldName, FALSE)) . '" class="CheckBoxLabel">' . $Input . ' ' . $Label . '</label>'; NEW: if ($Label != '') $Input = '<label for="' . ArrayValueI('id', $Attributes, $this->EscapeID($FieldName, FALSE)) . '" class="CheckBoxLabel">' . $Input . ' ' . Translate($Label) . '</label>';
Translate('Hello, %s. Your email is %s', $Username, $Email)
instead of
sprintf(Translate('Hello, %s. Your email is %s'), $Username, $Email)
public static function ActivityHeadline($Activity, $ProfileUserID = '') { $Session = Gdn::Session(); + // translate the Types + $Activity->FullHeadline = Gdn::Translate($Activity->FullHeadline); + $Activity->ProfileHeadline = Gdn::Translate($Activity->ProfileHeadline); - $RegardingWall = Anchor('wall', '/profile/activity/' . $Activity->RegardingUserID . '/' . $RegardingNameD . '#Activity_' . $Activity->ActivityID); + $RegardingWall = Anchor(Gdn::Translate('wall'), '/profile/activity/' . $Activity->RegardingUserID . '/' . $RegardingNameD . '#Activity_' . $Activity->ActivityID); - $Route = Anchor($Activity->RouteCode, $Activity->Route); + $Route = Anchor(Translate($Activity->RouteCode), $Activity->Route);