Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Forum Statistics 0.2.8 & translate to german
As usual I'm moving the
But after doing this, the addon isn't working anymore. Well I could open the "Statistics" preferences and check/uncheck the boxes, but neither the labels beside the boxes are translated nor does pushing "Modify" change anything. In fact it resets the boxes to the state before checking/unchecking anything.
What am I doing wrong? Is it wrong to move the code (above) to definitions.php?
Cheers
Inkscape
$Context->Dictionary["Statistics"] = "Statistics";
...
...
strings to my definitions.php in vanilla/languages/Deutsch
But after doing this, the addon isn't working anymore. Well I could open the "Statistics" preferences and check/uncheck the boxes, but neither the labels beside the boxes are translated nor does pushing "Modify" change anything. In fact it resets the boxes to the state before checking/unchecking anything.
What am I doing wrong? Is it wrong to move the code (above) to definitions.php?
Cheers
Inkscape
0
This discussion has been closed.
Comments
Sorry if I sound like a freshman, but I don't know very much about PHP or Javascript. So help is appreciated very much.
Cheers
Inkscape
sorry if i dont get your question
$Context->Dictionary["Statistics"] = "Statistics"; ... ...
strings to definitions.php in the language directory. But the labels beside the checkboxes within the extension preferences screen don't get translated.Even worse is, that after this you can't configure the statistics anymore. Let's say I don't want the "categories" to appear on the list in the panel. So I uncheck the checkbox and press "modify". This is where the magic should happen. Normally it'll save the new state, but after doing the translation work I mentioned, pressing "modify" just resets all checkboxes to the state before making any changes to them. This means it doesn't save any changes at all. I can't disable any entry within the statistics after doing the translation. Do you understand what I mean?
Asked the other way round: How can I translate the statistics entries shown in the panel into another language without breaking the whole addon/extension?
Cheers
Inkscape
i mean if this doesnt work .... $Context->Dictionary["wienersausage"] = "Wienerwurst";
then you have to tweak/change the sourcecode ... and this was also one of the reasons why i stopped to use vanilla for _now_
-_-
Yeah, I hoped Chris Vincent would read this and say s.th about it. So, Chris, are you reading me? Am I doing s.th wrong?
*sigh* - this add-on has to many problems...
------------------
you need to replace
$Context->Dictionary["Statistics"] = "Statistics"; $Context->Dictionary["StatisticsModify"] = "Modify"; $Context->Dictionary["Statistic_categories"] = "Categories"; $Context->Dictionary["Statistic_discussions"] = "Discussions"; $Context->Dictionary["Statistic_comments"] = "Comments"; $Context->Dictionary["Statistic_users"] = "Users"; $Context->Dictionary["Statistic_newest_user"] = "Newest User"; $Context->Dictionary["Statistic_top_posting_user"] = "Top Posting User"; $Context->Dictionary["Statistic_top_posting_user_2"] = "Posts: "; $Context->Dictionary["Statistic_top_discussion_starter"] = "Top Discussion Starter"; $Context->Dictionary["Statistic_top_discussion_starter_2"] = "Discussions: "; $Context->Dictionary["Statistic_unique_guests"] = "Unique Guests"; $Context->Dictionary["StatisticInformation"] = "Please configure the options for the statistics on the index page to whatever your personal needs are for this forum";
with
$DictionaryArray = Array( "Statistics" => "Statistics", "StatisticsModify" => "Modify", "Statistic_categories" => "Categories", "Statistic_discussions" => "Discussions", "Statistic_comments" => "Comments", "Statistic_users" => "Users", "Statistic_newest_user" => "Newest User", "Statistic_top_posting_user" => "Top Posting User", "Statistic_top_posting_user_2" => "Posts: ", "Statistic_top_discussion_starter" => "Top Discussion Starter", "Statistic_top_discussion_starter_2" => "Discussions: ", "Statistic_unique_guests" => "Unique Guests", "StatisticInformation" => "Please configure the options for the statistics on the index page to whatever your personal needs are for this forum" ); foreach($DictionaryArray AS $key => $value) if($Context->GetDefinition($key) == $key) $Context->Dictionary[$key] = $value; unset($DictionaryArray);
and then you can put the definitions inside the definition.php file
you'll need to change line 174
$Panel->AddListItem($Context->GetDefinition('AdministrativeOptions'), $Context->GetDefinition('Statistics'), GetUrl($Context->Configuration, $Context->SelfUrl, '', '', '', '', 'PostBackAction=Statistics'), '', '', 91);
To this
$Panel->AddListItem($Context->GetDefinition('AdministrativeOptions'), 'Statistics', GetUrl($Context->Configuration, $Context->SelfUrl, '', '', '', '', 'PostBackAction=Statistics'), '', '', 91);
This has also been changed in the add-ons page
Has someone already tried to adjust this extension to his/her own language? I replace the
$Context->Dictionary["Statistic_categories"] = "Kategorien";
with german strings and the panel shows them correctly. But in the settings window for the extension the labels beside the checkboxes are still in english. For the "categories" example this means: The statistic in the panel shows "Kategorien" while the label within the settings screen still says "categories". Apart from that I can't configure the panel statistic anymore.Have you tried to replace the language strings with something else just to test this? Is it maybe me who does something wrong. How would you adjust your extension to another language?
Nevertheless a big "thank you" for your efforts and the work you put in so far.
Cheers
Inkscape
You'll now be able to have your own language definitions for the statistics add-on
the problem was that it wasn't calling the correct definition, and then it just returned the original name
The checkbox labels are translated now. But I still can't configure it after translating the language strings. This time I didn't even move the language strings to within the subfolder. They're still inside default.php in the subfolder.