orkhan/InkTranslatable — pull request #14 by dimsav (2013-11-29 22:50:45+00:00)
Title: Convention over configuration

I think would be better to follow some conventions in order to keep the models cleaner.
The conventions I propose are taken by the configuration in the documentation:

```php
// Translation model
// example: PostTranslation
get_called_class().'Translation';

// Locale field
'lang';

// Relationship field
// example: post_id
snake_case(get_called_class()).'_id'; // same as laravel relationship convention
```

I also propose the usage of a new public variable `static::$translatables` used in case we wish to use the above conventions. In this case, `$translatables` is an array containing the names of the fields.

Finally, note the array casting in the following lines. This allows us to use a string instead of an array in the configuration.

```php
private function getTranslatableFields()
{
return isset(static::$translatable['translatables'])
? (array) static::$translatable['translatables']
: (array) static::$translatables;
}

// Configuration in model
public static $translatables = 'title';

// Or
public static $translatable = array(
'translatables' => 'title'
);
```