My favorites | Sign in
Project Logo
                
Search
for
Updated Oct 19, 2009 by jim.mayes
LanguageLocalization  
How to localize the calendar output for your language

Introduction

Output of the calendar class can be localized to your language. Use PHP's setlocale() function to output the calendar customized for your local language

Localized Language Example

/* include the calendar class */
require_once('calendar.class.php');

/* create the calendar object */
$calendar = new Calendar('2012-12-21');

/*
 to localize the output to your language use 
 PHP's setlocale() function before you call the 
 output_calendar() method. 

 For example this will localize the calendar for German

 View PHP documentation to find the value appropriate to your location
 */
setlocale(LC_ALL, 'de_DE');

/* now output the calendar as normal */
print($calendar->output_calendar());

View Working Example at Style-vs-SUBSTANCE.com


Sign in to add a comment
Powered by Google Project Hosting