dev.obliquid.com: obliquid
[ class tree: obliquid ] [ index: obliquid ] [ all elements ]

Class: locale

Source Location: Program_Root/classes/obliquid/locale.php

Class Overview


Locale class. Localization and internationalization support.


Methods


Inherited Variables

Inherited Methods


Class Details

[line 35]
Locale class. Localization and internationalization support.

In the session we have $_SESSION["_oblocale"] and $_SESSION["_oblang"]






[ Top ]


Class Methods


method decodeMessage [line 63]

text decodeMessage( text $encoded)

Decodes a serialized and base64 encoded multilingual message Chooses automatically the current language. If it's not available, then uses another language according to site priorities.

If even with this it still can't find a message, returns an empty string




Tags:

return:  decoded message


Parameters:

text   $encoded   encoded message string

[ Top ]

method formatDate [line 260]

text formatDate( text $isodate, mixed $fmt, [text $locale = ""])

Formats an ISO date with a specified format, according to locale settings

m Numeric representation of a month, with leading zeros values 01 to 12 d Day of the month, 2 digits with leading zeros values 01 to 31 Y A full numeric representation of a year, 4 digits examples 1999 or 2003 y A two digit representation of a year examples 99 or 03 M A short textual representation of a month, 3 letters values Jan to Dec (in English) this string will be translated according to the locale selected




Tags:

return:  formatted date


Parameters:

text   $isodate   date in ISO format (Ex. 2004-12-31)
text   $locale   an optional locale in which to format the date, if it's not specified use the current locale

[ Top ]

method import_po [line 108]

array import_po( text $fname, text $table, text $lang, [boolean $verbose = false])

Imports a given PO file of the given lang into the db.

Fuzzy messages are ignored




Tags:

return:  an array($insert, $update, $fail)


Parameters:

text   $fname   file name
text   $table   table to update, without prefix
text   $lang   language abbreviation, or language underscore country
boolean   $verbose   prints out dupes

[ Top ]

method intLabel [line 89]

text intLabel( text $label)

Internationalize a label.

Looks inside the message for a string in the format "#message" and substitutes this message with the appropriate translation. only one message per label can be translated. Before and after message label is possible to add others strings that won't be translated. Those strings must be separated by a space from the message label. This may be useful for placing an asterisk beside compulsory fields, for example.




Tags:

return:  internationalized label


Parameters:

text   $label   original label

[ Top ]

method languageName [line 44]

text languageName( text $locale)

Gets the language name, as defined in xml.

for example $locale=en_US may return English if the specified locale could not be found returns an empty string




Tags:

return:  language name


Parameters:

text   $locale   locale abbreviation (ex. en_US)

[ Top ]

method longDate [line 230]

text longDate( text $isodate, [text $locale = ""])

Formats an ISO date as a long date according to locale settings



Tags:

return:  formatted date


Parameters:

text   $isodate   date in ISO format (Ex. 2004-12-31)
text   $locale   an optional locale in which to format the date, if it's not specified use the current locale

[ Top ]

method shortDate [line 206]

text shortDate( text $isodate, [text $locale = ""])

Formats an ISO date as a short date according to locale settings



Tags:

return:  formatted date


Parameters:

text   $isodate   date in ISO format (Ex. 2004-12-31)
text   $locale   an optional locale in which to format the date, if it's not specified use the current locale

[ Top ]

method unquote [line 192]

text unquote( text &$str)

unquote a string: removes starting and ending quote characters and

removes backslashes from meta chars




Tags:

return:  the unquoted string


Parameters:

text   $str   the string to be unquoted

[ Top ]


Documentation generated on Tue, 29 Mar 2005 09:03:57 -0800 by phpDocumentor 1.2.0rc2