Language dependant sidebars vice-versa
You missed the position of the string operator . You can try the code mentioned below.

    global $language;
    switch ($language-&gt;language) {
    case "en":
    if ($page["sidebar_first"]):
    print "&lt;aside id='sidebar-first' role='complementary' class='sidebar clearfix'&gt;".print render($page['sidebar_first'])."&lt;/aside&gt;"; 
    endif;
    if ($page["sidebar_second"]):
    print "&lt;aside id='sidebar-second' role='complementary' class='sidebar clearfix'&gt;".print render($page['sidebar_second'])."&lt;/aside&gt;"; 
    endif;      
    break;
    case "ar":
    if ($page["sidebar_second"]):
    print "&lt;aside id='sidebar-first' role='complementary' class='sidebar clearfix'&gt;".print render($page['sidebar_second'])."&lt;/aside&gt;"; 
    endif;  
    if ($page["sidebar_first"]):
    print "&lt;aside id='sidebar-second' role='complementary' class='sidebar clearfix'&gt;".print render($page['sidebar_first'])."&lt;/aside&gt;"; 
    endif;
    break;
    }