Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MINOR Documentation (from r113241)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@114522 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit c3fa7406abe7a68a9a1fa85c570a49bc11c17c1f 1 parent 24f2c51
@sminnee sminnee authored
Showing with 19 additions and 4 deletions.
  1. +19 −4 core/i18n.php
View
23 core/i18n.php
@@ -1736,10 +1736,15 @@ static function validate_locale($locale) {
}
/**
- * Set the current locale
- * See http://unicode.org/cldr/data/diff/supplemental/languages_and_territories.html for a list of possible locales
+ * Set the current locale, used as the default for
+ * any localized classes, such as {@link FormField} or {@link DBField}
+ * instances. Locales can also be persisted in {@link Member->Locale},
+ * for example in the {@link CMSMain} interface the Member locale
+ * overrules the global locale value set here.
*
- * @param string $locale Locale to be set
+ * See {@link Translatable::set_locale()}.
+ *
+ * @param string $locale Locale to be set. See http://unicode.org/cldr/data/diff/supplemental/languages_and_territories.html for a list of possible locales.
*/
static function set_locale($locale) {
if(!self::validate_locale($locale)) throw new InvalidArgumentException(sprintf('Invalid locale "%s"', $locale));
@@ -1774,7 +1779,14 @@ static function default_lang() {
}
/**
- * This is the locale in which generated language files are (we assume US English with "en_US" by default).
+ * This is the "fallback locale", in case resources with the "current locale"
+ * (set through {@link set_locale()}) can't be found.
+ *
+ * If you just want to globally read/write a different locale (e.g. in a CMS interface),
+ * please use {@link get_locale()} and {@link set_locale()} instead.
+ *
+ * For example, {@link Requirements::add_i18n_javascript()} and {@link i18n::include_by_class()}
+ * use this "fallback locale" value to include fallback language files.
*
* @return String
*/
@@ -1783,6 +1795,9 @@ static function default_locale() {
}
/**
+ * See {@link default_locale()} for usage.
+ *
+ *
* @param String $locale
*/
static function set_default_locale($locale) {

0 comments on commit c3fa740

Please sign in to comment.
Something went wrong with that request. Please try again.