Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Releases: vinkla/laravel-translator

2.0.1

16 Apr 17:57
Compare
Choose a tag to compare
  • Add caching to the current translated object (#23)

1.3.1

02 Mar 15:47
Compare
Choose a tag to compare

2.0.0

05 Feb 20:21
Compare
Choose a tag to compare
  • Add Laravel 5 Support

Add fallback support

29 Jan 14:35
Compare
Choose a tag to compare

Fetch the default translation if the current locale doesn't have any translated attributes yet. In the example below the current article doesn't have have the title attribute translated to Swedish yet.

App::setLocale('en');
echo $article->title; // return 'Five Ants Are More than Four Elephants'

App::setLocale('sv');
echo $article->title; // returns 'Five Ants Are More than Four Elephants'

This can be turned off/on in the config.php file.

Add possibility to fetch a specific translation

29 Jan 14:05
Compare
Choose a tag to compare

Add support to fetch a specific translation with the translate method.

$article->translate('sv')->title;

Rename Key to Column

12 Dec 10:50
Compare
Choose a tag to compare

This release renames the configuration property from key to column.

First stable version

11 Dec 22:09
Compare
Choose a tag to compare

This version is rewritten from the ground up. The session driver is removed and the documentation is updated.

Fix of crucial bug

11 Dec 07:42
Compare
Choose a tag to compare

This is a bugfix release. The locales migration used increment instead of increments.

Add locales migration

08 Dec 12:55
Compare
Choose a tag to compare

This example migration comes out of the box with this package. Run the command below to add it to your projects database.

php artisan migrate --package="vinkla/translator"

Add save, update and fill methods to the trait

29 Oct 09:13
Compare
Choose a tag to compare

It is now possible to save translated attributes on the base model. In the example below title and content are translateable attributes. The image attribute exists on the base model.

$title = 'Goa gubbar från Göteborg';
$content = 'Brödtext översatt på svenska.';
$image = 'weird-cat.jpg';

$article->update(compact('title', 'content', 'image'));

The translator package can now identify translateable attributes and save them in the current language. It compares fillable attributes with the translatedAttributes array that is set on our base model.