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.
Options

Forum Statistics 0.2.8 & translate to german

edited September 2006 in Vanilla 1.0 Help
As usual I'm moving the $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

Comments

  • Options
    Anyone?

    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
  • Options
    problems with the translation itself?

    sorry if i dont get your question
  • Options
    edited September 2006
    >> problems with the translation itself?
    Yes and no. :) The list within the panel is translated correctly when moving the $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
  • Options
    phew .... complex

    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_


    -_-
  • Options
    >> then you have to tweak/change the sourcecode

    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?
  • Options
    Sorry for late responce, i've been away from my computer for a while so i'll check it out tonight

    *sigh* - this add-on has to many problems...
  • Options
    considering the extensions are called after the definitions, i've checked it out and hopefully the following vode will work, if not, please say so

    ------------------

    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
  • Options
    Sorry that didn't work. The index page is translated just as before, but the settings page is still in english. I'm talking about the labels beside the checkboxes. And I can't configure it anymore after translating. I can check/uncheck the boxes but after pressing "Modify" it just resets to the state before making any changes.
  • Options
    ok, you can forget what i've done above because i've found a solution

    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
  • Options
    Hmm, sorry but I think I'm stuck. I tried your last tip, but can't see any progress. It's still not working.

    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
  • Options
    ok, i've found the problem and fixed it.

    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
  • Options
    edited September 2006
    Well, little progress. :)

    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 definitions.php within the ./languages/Deutsch subfolder. They're still inside default.php in the ./extensions/Statistics/ subfolder.
This discussion has been closed.