forked from northcreation-agency/multilingual
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_config.php
70 lines (56 loc) · 1.57 KB
/
_config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/******************************************************************************************************
* Multilingual module with i18n support
*
/******************************************************************************************************/
Multilingual::set_default_lang("sv");
Multilingual::set_langs(array(
"Swedish"=>array(
"sv"=>"sv_SE"
),
"English"=>array(
"en"=>"en_GB"
),
"German"=>array(
"de"=>"de_DE"
)
));
/*------------------------------------------------------------------------------
* Global multilingual fields. If found in any child class it will translate
* them (new fields will be created on the object).
* Ex: the field "Title" will create a new db field with name "Title_XX",
* where XX is the lang-id, ex "es" for spanish
*/
// Global multilingual fields for SiteTree and its descendants
Multilingual_SiteTree::set_multilingal_fields(
array(
"Title",
"MenuTitle",
"Content",
"MetaTitle",
"MetaDescription",
"MetaKeywords",
"ExtraMeta",
));
// Global multilingual fields for all MultilingualDataObject and its descendants
Multilingual_DataObject::set_multilingal_fields(
array(
"Title"
));
/*
* For SiteConfig to work properly, you have to sadly hack the SiteConfig.php class.
* The upside is that its a small hack. Change the following:
*
* "class SiteConfig extends DataObject" To:
*
* "class SiteConfig extends MultilingualDataObject"
*
*/
// Global multilingual fields for siteconfig
Multilingual_SiteConfig::set_multilingal_fields(
array(
"Tagline",
));
//ENABLE last!
Multilingual::enable();
?>