mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
3.1 fixes
This commit is contained in:
parent
5c7682013c
commit
ba32a53c79
@ -85,18 +85,18 @@ Alternatives:
|
|||||||
|
|
||||||
#### ThroughObject::add_extension()
|
#### ThroughObject::add_extension()
|
||||||
|
|
||||||
Enabling Translatable through *Object::add_extension()* in your *mysite/_config.php*:
|
Enabling Translatable through *add_extension()* in your *mysite/_config.php*:
|
||||||
|
|
||||||
:::php
|
:::php
|
||||||
Object::add_extension('SiteTree', 'Translatable');
|
SiteTree::add_extension('Translatable');
|
||||||
Object::add_extension('SiteConfig', 'Translatable'); // 2.4 or newer only
|
SiteConfig::add_extension('Translatable'); // 2.4 or newer only
|
||||||
|
|
||||||
|
|
||||||
#### Through $extensions
|
#### Through $extensions
|
||||||
|
|
||||||
:::php
|
:::php
|
||||||
class Page extends SiteTree {
|
class Page extends SiteTree {
|
||||||
static $extensions = array(
|
private static $extensions = array(
|
||||||
"Translatable"
|
"Translatable"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -118,7 +118,7 @@ Example:
|
|||||||
:::php
|
:::php
|
||||||
Translatable::set_default_locale(<locale>);
|
Translatable::set_default_locale(<locale>);
|
||||||
// Important: Call add_extension() after setting the default locale
|
// Important: Call add_extension() after setting the default locale
|
||||||
Object::add_extension('SiteTree', 'Translatable');
|
SiteTree::add_extension('Translatable');
|
||||||
|
|
||||||
|
|
||||||
For the Translatable class, a "locale" consists of a language code plus a region code separated by an underscore,
|
For the Translatable class, a "locale" consists of a language code plus a region code separated by an underscore,
|
||||||
|
Loading…
Reference in New Issue
Block a user