Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Problems with documentation #20

Closed
jufy opened this issue May 27, 2014 · 3 comments
Closed

Problems with documentation #20

jufy opened this issue May 27, 2014 · 3 comments

Comments

@jufy
Copy link

jufy commented May 27, 2014

Hello, according to your documentation this code must work

 $data = array(
    'iso' => 'gr',
    'en'  => array('name' => 'Greece'),
    'fr'  => array('name' => 'Grèce'),
  );
  $country = Country::create($data);
  echo $country->translate('fr')->name; // Grèce

But actually it does not :( Translations are not saved to DB.
However, smth like this works:

$album = new Album;
$album->translate('fr')->title = Input::get('fr_title');
$album->translate('en')->title = Input::get('en_title');
$album->save();

Thank you!

@dimsav
Copy link
Owner

dimsav commented May 28, 2014

Hi @jufy,

did you set the fillable attribute in your model?

The code has being tested, so there is probably something wrong with your configuration.

@ghost
Copy link

ghost commented Jun 15, 2014

Documentation seems lacking about configuration, one thing I've noted browsing the test is the locales config entry. Without that nothing will work except en. Add an array with all the locales accepted by your app and you should be ok.

dimsav added a commit that referenced this issue Jun 15, 2014
@dimsav
Copy link
Owner

dimsav commented Jun 15, 2014

@gpasci Ooops, I sorry about the confusion. Fixed now :)

@dimsav dimsav closed this as completed Jun 18, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants