2009-04-07 11 views

Respuesta

10

De CLDR de supplemental data:

 
<firstDay day="mon" territories="001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK" /> 
<firstDay day="fri" territories="BD MV" /> 
<firstDay day="sat" territories="AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY" /> 
<firstDay day="sun" territories="AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW" /> 
<firstDay day="sun" territories="GB" alt="variant" references="Shorter Oxford Dictionary (5th edition, 2002)" /> 

(Territorio 001 es "mundo")

+0

Eso es bastante útil. Gracias por publicar eso. – Calvin

4

Ejecutar este comando en el shell (bash o sh o etc):

locale first_weekday 

En PHP , llame a un proceso para ejecutar este comando en sh, y obtenga su salida. En Python, hago algo como esto:

def getLocaleFirstWeekDay(): 
    return int(os.popen('locale first_weekday').read())-1 
+0

No funciona en OSX, aunque –

+0

PHP debería funcionar con 'intlcal_get_first_day_of_week (intlcal_create_instance())', que no requiere bifurcar otro proceso. Sin embargo, consulte https://bugs.php.net/bug.php?id=76073 –

Cuestiones relacionadas