mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-08-29 22:16:01 +02:00
API CHANGE Deprecated Translatable::get_langs_by_id() - use getTranslations() MINOR Removed Translatable::is_default_locale() - no deprecation necessary, was recently added MINOR Removed commented out methods in Translatable: augmentNumChildrenCountQuery(), augmentAllChildrenIncludingDeleted() and augmentStageChildren() MINOR Removed fieldsInExtraTables() and extendWithSuffix() git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75742 467b73ca-7a2a-4603-9d3b-597d59a354a9
33 lines
704 B
PHP
33 lines
704 B
PHP
<?php
|
|
/**
|
|
* Locale database field, mainly used in {@link Translatable} extension.
|
|
*
|
|
* @todo Allowing showing locale values in different languages through Nice()
|
|
*
|
|
* @package sapphire
|
|
* @subpackage i18n
|
|
*/
|
|
class DBLocale extends Varchar {
|
|
|
|
function __construct($name, $size = 16) {
|
|
parent::__construct($name, $size);
|
|
}
|
|
|
|
function Nice() {
|
|
return $this->getShortName();
|
|
}
|
|
|
|
function RFC1766() {
|
|
return i18n::convert_rfc1766($this->value);
|
|
}
|
|
|
|
function getShortName() {
|
|
$common_names = i18n::get_common_locales();
|
|
return (isset($common_names[$this->value])) ? $common_names[$this->value] : false;
|
|
}
|
|
|
|
function getLongName() {
|
|
return i18n::get_locale_name($this->value);
|
|
}
|
|
}
|
|
?>
|