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.

Language file, international characters CSS-weirdness

fuarfuar New
edited August 2005 in Vanilla 1.0 Help
I've spent most of the day tinkering around with the language file to create a Norwegian.php, and stumbled onto som weirdness.

I may be wrong, but it seems like you are using some of these

$Context->Dictionary["OffCaps"] = "AV"; $Context->Dictionary["OnCaps"] = "PÅ"; $Context->Dictionary["Off"] = "av"; $Context->Dictionary["On"] = "på";

in the creation of the CSS, and that doesn't go very well with international characters. It results in a somewhat mangled Text-only box.
«1

Comments

  • Um. From what i understand of what you're saying, you need to replace wierd characters with their html equivalents. I posted a link of where to find these in the localisation thread if you need them.
  • Yep, that would solve the problem, but it's really boring to keep writing all the international characters like that when I'm translating, so i was hoping for an easier solution.
  • Well, i'd say the easiest way is to write the translation as normal and then use a search+replace. I'm sure if it'd make it easier someone would be able to write a regex statement or a script or something that would convert it all for you.
  • Did some search and replacing now, but it seems to still be broken, it looks like this:

    broken_text-only.jpg

    any idea what could be causing that?
  • sorry, i dont see what the problem is. What should it say?
  • the line shouldn't break where it says "skru av", it should be like the text-only box is on this page.
  • hmm. that is strange. Paste the exact content of the definition and see if anyone can pick out the error.
  • i think these are the only one that are used there:

    $Context->Dictionary["Turn"] = "skru"; $Context->Dictionary["OnCaps"] = "På"; </code
  • I don't think the problem is with international characters at all, it happens when i edit these:

    $Context->Dictionary["OffCaps"] = "OFF"; $Context->Dictionary["OnCaps"] = "ON"; $Context->Dictionary["Off"] = "off"; $Context->Dictionary["On"] = "on";

    no matter what i replace them with, the line breaking occurs.
  • MarkMark Vanilla Staff
    Uh oh. I hope I didn't do what I think I might have done... *checks* Yep. I did. That's a bug. Don't sweat the style screwup right now. I'll issue a fix it for the next revision and everything will fix itself.
  • weee, :-D
  • MarkMark Vanilla Staff
    edited July 2005
    If you want to fix it yourself in the meantime, you can do it by opening up library/Vanilla.functions.php and changing this:
    function AddTextModeToPanel(&$Context, &$Panel) {
    if ($Context->Session->UserID > 0 && $Context->Session->User->Setting("ShowTextToggle", 1)) {
    $Params = $Context->ObjectFactory->NewObject($Context, "Parameters");
    $Params->DefineCollection($_GET);
    $Params->Remove("PageAction");
    if ($Context->Session->User->Setting("HtmlOn", 1)) {
    $Params->Set("h", 0);
    $CurrentMode = $Context->GetDefinition("OffCaps");
    $OppositeMode = $Context->GetDefinition("On");
    } else {
    $Params->Set("h", 1);
    $CurrentMode = $Context->GetDefinition("OnCaps");
    $OppositeMode = $Context->GetDefinition("Off");
    }
    $Panel->AddString("<div class=\"PanelInformation TextMode".$CurrentMode."\">".$Context->GetDefinition("TextOnlyModeIs")." ".$CurrentMode." (<a class=\"PanelLink\" href=\"".$Context->SelfUrl.$Params->GetQueryString()."\">".$Context->GetDefinition("Turn")." ".$OppositeMode."</a>)</div>");
    }
    }
    to this:
    function AddTextModeToPanel(&$Context, &$Panel) {
    if ($Context->Session->UserID > 0 && $Context->Session->User->Setting("ShowTextToggle", 1)) {
    $Params = $Context->ObjectFactory->NewObject($Context, "Parameters");
    $Params->DefineCollection($_GET);
    $Params->Remove("PageAction");
    if ($Context->Session->User->Setting("HtmlOn", 1)) {
    $Params->Set("h", 0);
    $CurrentMode = $Context->GetDefinition("OffCaps");
    $CurrentModeCSS = "OFF";
    $OppositeMode = $Context->GetDefinition("On");
    } else {
    $Params->Set("h", 1);
    $CurrentMode = $Context->GetDefinition("OnCaps");
    $CurrentModeCSS = "ON";
    $OppositeMode = $Context->GetDefinition("Off");
    }
    $Panel->AddString("<div class=\"PanelInformation TextMode".$CurrentModeCSS."\">".$Context->GetDefinition("TextOnlyModeIs")." ".$CurrentMode." (<a class=\"PanelLink\" href=\"".$Context->SelfUrl.$Params->GetQueryString()."\">".$Context->GetDefinition("Turn")." ".$OppositeMode."</a>)</div>");
    }
    }
  • MarkMark Vanilla Staff
    *pardon my horizontal scrolling*
  • sweet!
    works like a charm.
  • mark, what in the world have you done to the code blocks?! it's like light grey text on a white bg.

    eeek
  • Didn't want to start another thread since this is a similar bug.

    Changing this one:

    $Context->Dictionary["Applicant"] = "Applicant";

    will make it impossible to get the list of new applicants since it will use role:Applicant for the search no matter what you put in there.
  • oooh, well spotted, i noticed the applicant search messed up on mine but i couldnt work out why - and since i'd been messing with bits of code i didnt want to bother people over what was probably my fault.
  • It's easily fixed by changing the role that users are assigned when filling out the registration form, but it gave me a little headache :D
  • MarkMark Vanilla Staff
    Can someone add these two bugs to the bug list?
  • You know, if you spent half the time adding bugs to the list as you did telling people to, you'd get stuff done quicker. consider it done.
This discussion has been closed.