Class that loads the calendar locale.
Methods
PHP4 style constructor which calls helper methods to set up object variables
__construct() : \BB_Locale
Imports global locale vars set during inclusion of $locale.php.
_load_locale_data()
Retrieve translated version of meridiem string.
get_meridiem(string $meridiem) : string
The $meridiem parameter is expected to not be translated.
Parameters
$meridiem
string
Either 'am', 'pm', 'AM', or 'PM'. Not translated version.
Returns
string
Translated version
Retrieve the full translated month by month number.
get_month(string|integer $month_number) : string
The $month_number parameter has to be a string
because it must have the '0' in front of any number
that is less than 10. Starts from '01' and ends at
'12'.
You can use an integer instead and it will add the
'0' before the numbers less than 10 for you.
Parameters
$month_number
string
integer
'01' through '12'
Returns
string
Translated full month name
Retrieve translated version of month abbreviation string.
get_month_abbrev(string $month_name) : string
The $month_name parameter is expected to be the translated or
translatable version of the month.
Parameters
$month_name
string
Translated month to get abbreviated version
Returns
string
Translated abbreviated month
get_month_initial()
get_month_initial($month_name)
Retrieve the full translated weekday word.
get_weekday(integer $weekday_number) : string
Week starts on translated Sunday and can be fetched
by using 0 (zero). So the week starts with 0 (zero)
and ends on Saturday with is fetched by using 6 (six).
Parameters
$weekday_number
integer
0 for Sunday through 6 Saturday
Returns
string
Full translated weekday
Retrieve the translated weekday abbreviation.
get_weekday_abbrev(string $weekday_name) : string
The weekday abbreviation is retrieved by the translated
full weekday word.
Parameters
$weekday_name
string
Full translated weekday word
Returns
string
Translated weekday abbreviation
Retrieve the translated weekday initial.
get_weekday_initial(string $weekday_name) : string
The weekday initial is retrieved by the translated
full weekday word. When translating the weekday initial
pay attention to make sure that the starting letter does
not conflict.
Parameters
$weekday_name
string
Returns
string
Sets up the translated strings and object properties.
init()
The method creates the translatable strings for various
calendar elements. Which allows for specifying locale
specific calendar names and text direction.
Global variables are deprecated. For backwards compatibility only.
register_globals()
deprecated |
For backwards compatibility only. |
access |
private |
Properties
Imports the global version to the class property.
$locale_vars : array
Default
array('text_direction')
Stores the translated strings for 'am' and 'pm'.
$meridiem : array
Also the capitalized versions.
Stores the translated strings for the full month names.
$month : array
Stores the translated strings for the abbreviated month names.
$month_abbrev : array
The text direction of the locale language.
$text_direction : string
Default is left to right 'ltr'.
Stores the translated strings for the full weekday names.
$weekday : array
Stores the translated strings for the abbreviated weekday names.
$weekday_abbrev : array
Stores the translated strings for the one character weekday names.
$weekday_initial : array
There is a hack to make sure that Tuesday and Thursday, as well
as Sunday and Saturday don't conflict. See init() method for more.