Hello,
Decompress your module and rename silverstripe-translatable-master to translatable.
Follow install process inspired of http://www.balbuss.com/
In your mysite/code/Page.php
<?php
class Page extends SiteTree {
static $extensions = array(
"Translatable"
);
some code ...
And add this line in your _config.php
LeftAndMain::require_javascript('silverstripe-translatable/javascript/CMSMain.Translatable.js');
//My exemple is for website translate in 3 languages
Translatable::set_default_locale('fr_FR');
Object::add_extension('SiteTree', 'Translatable');
Object::add_extension('SiteConfig', 'Translatable'); // 2.4 or newer only
Translatable::set_allowed_locales(array(
'en_GB', //UK English
'nl_NL', //Ducth
'fr_FR' //French
)
);
Have a lot of fun ;)
The translation module is definitely not working or just simply page!
My error in the jquery notice in backend is :
Error Line 580 ../framework/model/MySQLDatabase.php
An Sql Error?... Just for
I can do some dev / build... nothing works...
I created a new PageType ContactPage with the code follow :
<?php
class ContactPage extends Page {
static $db = array(
'Mailto'=>'Varchar(100)',
'SubmitText'=>'Text',
'Nom'=>'Varchar(50)',
'Adresse'=>'Varchar(50)',
'Ville'=>'Varchar(50)',
'CP'=>'Varchar(50)',
'Region'=>'Varchar(50)',
'Pays'=>'Varchar(50)',
'Phone'=>'Varchar(50)',
'GPS'=>'Varchar(50)'
);
public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.SoumissionForm", $myMailTo =new TextField('Mailto', 'Email du destinataire '));
$fields->addFieldToTab("Root.SoumissionForm", $mySubmitText = new TextareaField('SubmitText', 'Texte du mail'));
$fields->addFieldToTab("Root.Coordonnees", $myNom = new TextField('Nom', 'Raison Sociale'));
$fields->addFieldToTab("Root.Coordonnees", $myAdresse = new TextField('Adresse', 'Adresse'));
$fields->addFieldToTab("Root.Coordonnees", $myVille = new TextField('Ville', 'Ville'));
$fields->addFieldToTab("Root.Coordonnees", $myCP = new TextField('CP', 'Code Postale'));
$fields->addFieldToTab("Root.Coordonnees", $myRegion = new TextField('Region', 'Région'));
$fields->addFieldToTab("Root.Coordonnees", $myPays = new TextField('Pays', 'Pays'));
$fields->addFieldToTab("Root.Coordonnees", $myPhone = new TextField('Phone', 'Téléphone'));
$fields->addFieldToTab("Root.Coordonnees", $myGPS = new TextField('GPS', 'Coordonnées GPS : Latitude,Longitude'));
$translation = $this->getTranslation(Translatable::default_locale());
if($translation && $this->Locale != Translatable::default_locale()) {
$transformation = new Translatable_Transformation($translation);
$fields->replaceField('Mailto',$transformation->transformFormField($myMailTo));
$fields->replaceField('SubmitText',$transformation->transformFormField($mySubmitText));
$fields->replaceField('Nom',$transformation->transformFormField($myMailTo));
$fields->replaceField('Adresse',$transformation->transformFormField($myMailTo));
$fields->replaceField('Ville',$transformation->transformFormField($myMailTo));
$fields->replaceField('CP',$transformation->transformFormField($myMailTo));
$fields->replaceField('Region',$transformation->transformFormField($myMailTo));
$fields->replaceField('Pays',$transformation->transformFormField($myMailTo));
$fields->replaceField('Phone',$transformation->transformFormField($myMailTo));
$fields->replaceField('GPS',$transformation->transformFormField($myMailTo));
}
return $fields;
}
}
class ContactPage_Controller extends Page_Controller {
public function init() {
parent::init();
}
}
If someone have an idea to create and traduce a new type of page.
I'm really desperate... one month to work for nothing, my client project is on standby... what has become my favorite SS version 2.4.5...