Tuesday 28 February 2012

Language order

probably you have solved it yourself, but in case somebody else needs a solution, this can be useful:
in the /module/blocklanguages/blocklanguages.php file put



function cmp($a, $b)
{
  //language iso_code in the desired order:
  $new_order = array("fr", "es", "en", "de");
  foreach($new_order as &$value)
  {
    if ($a["iso_code"]==$value) return -1;
    if ($b["iso_code"]==$value) return 1; 
  }
}




Paste this code:


usort($languages,"cmp");
$smarty->assign('languages', $languages);

11 comments:

  1. Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts
    Data Science Course in Indira nagar
    Data Science Course in btm layout
    Python course in Kalyan nagar
    Data Science course in Indira nagar
    Data Science Course in Marathahalli
    Data Science Course in BTM Layout

    ReplyDelete
  2. This is very interesting blog,thanks for sharing this information.

    English Spoken Classes in Aurangabad

    ReplyDelete
  3. I can set up my new idea from this post. It gives in depth information. Thanks for this valuable information for all,..
    data science institutes in hyderabad

    ReplyDelete
  4. Nice blog and informative content. Keep up this awesome work in your further blogs. Thank you. If you want to become a data scientist, then follow the below link.
    Best Data Science Training with Placements

    ReplyDelete
  5. Great post. keep sharing such a worthy information.
    SEO Training in Chennai
    SEO Course

    ReplyDelete