Блогчетање

Данилово блогче

Mon, 07 Mar 2005

Sun, 12 Dec 2004

Rodney, below is a function I use to test if visitor prefers Croatian (hr) over Serbian (sr) when she visits Prevod.org web pages to provide Latin transcription of the pages.

function header_language_compare($default = 'sr', $comparewith = 'hr') {
  $languages=split(',',$_SERVER["HTTP_ACCEPT_LANGUAGE"]);
  $qdefault=0;
  $qcompare=0;
  foreach ($languages as $lang) {
    if (ereg("^$default$",$lang,$regs)) {
      $qdefault=1;
    } elseif (ereg("^$comparewith$",$lang,$regs)) {
      $qcompare=1;
    } elseif (ereg("^$default;[ ]*q=([0-9.]+)$",$lang,$regs)) {
      $qdefault=$regs[1];
    } elseif (ereg("^$comparewith;[ ]*q=([0-9.]+)$",$lang,$regs)) {
      $qcompare=$regs[1];
    }
  }

  if ($qcompare>$qdefault) return 1;
  else return 0;
}

If "hr" is more desireable than "sr" (i.e. there's no "sr" at all, or it has lower "quality" than "hr") according to "Accept-Language" header, this function will return 1, otherwise 0. You might want to use something similar to compare 'en' and 'sq', letting most people default to 'en' for your blog.

[13:50] | [] | # | G | | TB

Sun, 28 Mar 2004

Here's my fancy quoting function for Gnus.

It supports two languages (Serbian/Serbian transcription in Latin script and English), and I use the "current-group-language" as a group parameter to set the language per-group (so, for instance, gnom@prevod,org has it set to "sr", lugy@linux,org,yu set to "sr@Latn", and Gnome lists to "en").

As you might notice, I'm using local time for quoting, which makes sense since I don't want to put a timezone in the time. Also, it makes it easier to see how much time difference there was between a post and an answer (I find relative time measurements much easier, others may disagree ;).

So, no need to worry about quoting any more.

[16:28] | [] | # | G | | TB

Wed, 17 Mar 2004

Take a look at this comparison of basic features between CVS (mostly as a reference point, it's not explained — it's assumed that reader is familiar with it), Subversion and GNU arch.

And it comes down to: use GNU Arch.

Update on 2016-10-05: fix links (reported by Marilyn Shaw—thanks!)

[04:40] | [] | # | G | | TB
Contact
Danilo Segan

This is blog (web log) of Danilo Šegan (or Данило Шеган).

Archives
2017-Jan
2013-Dec
2011-Nov
2011-Oct
2011-Aug
2011-Jul
2011-Jun
2011-May
2010-Oct
2010-Aug
2010-Jul
2010-Apr
2010-Mar
2010-Feb
2010-Jan
2009-Dec
2009-Oct
2009-Aug
2009-Jun
2008-Oct
2008-Aug
2008-Jul
2008-Jun
2008-May
2008-Apr
2008-Mar
2008-Feb
2007-Dec
2007-Oct
2007-Aug
2007-Jul
2007-May
2007-Apr
2007-Feb
2007-Jan
2006-Nov
2006-Oct
2006-Aug
2006-Jul
2006-Apr
2006-Mar
2006-Feb
2006-Jan
2005-Sep
2005-Jun
2005-May
2005-Apr
2005-Mar
2005-Feb
2004-Dec
2004-Nov
2004-Oct
2004-Sep
2004-Aug
2004-Jul
2004-May
2004-Apr
2004-Mar
2004-Feb
2004-Jan
2003-Dec
2003-Nov
2003-Oct
2003-Sep
1983-Mar

< March 2005 >
MoTuWeThFrSaSu
  1 2 3 4 5 6
7 8 910111213
14151617181920
21222324252627
28293031   
Categories

Links
Kvota.net
Prevod.org
My study page
Srpski.org
GNOME
Friends' Blogs
alex (en)
bc (en)
Bojan Živanović (sr)
Carlos (en)
Goran (sr)
imp (sr)
lilit (sr)
Oskuro (en)
Zombie (sr/en)
Feeds
RSS