Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Translator Laravel Package

vinkla/translator

View on GitHub
Deep Wiki
Context7
7.0.0
  • Added laravel 5.7 support
  • Removed laravel 5.6 support
  • Updated eloquent translation saving
6.0.0
  • Added laravel 5.6 support
  • Added optimized database queries
  • Removed laravel 5.5 support
  • Removed php 7.0 support
5.0.0
  • Added laravel 5.5 support
  • Removed laravel 5.4 support
  • Updated translation cache variable
  • Updated translation lookup
4.2.2
  • Fix empty translations
4.2.1
  • Fix with translations query
4.2.0
  • Added eager loading support
  • Dropped laravel 5.3 support
4.1.0
  • Added laravel 5.4 support
4.0.0
  • Added custom exception
  • Dropped laravel 5.1 and 5.2 support
  • Rename translatable property
3.3.0
  • Drop php 5.5 support
3.2.0
  • Added laravel 5.3 support
3.1.3
  • Fix bug where local was overridden
3.1.2
  • Fix bug with cached fallback
3.1.1
  • Fix bug with fallback and update
3.1.0
  • Add Laravel 5.2 support
  • Updated translated attributes
3.0.1
  • Fix fallback bug
3.0.0
  • Better test suit
  • Official Lumen support
  • Remove configuration
  • Remove providers
  • Remove migrations
  • Simplified codebase
  • Add extensive documentation
2.2.1
  • Added ability to refuse the fallback translation
2.2.0
  • Support both Laravel 5.0 and 5.1
  • Dropped PHP 5.4 support
2.1.1
  • Add cached locales to minimize number of queries executed (#31)
2.1.0
  • Add translated attributes to arrayable attributes (#28)
  • Allow multiple languages to be cached (#27)
2.0.1
  • Add caching to the current translated object (#23)
1.3.1
  • Add existing check and fixes typo in #19. Thanks to @AlexLombry
2.0.0
  • Add Laravel 5 Support
1.3.0

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.

1.1.0

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

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

This release renames the configuration property from key to column.

1.0.0

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

0.5.1

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

0.5.0

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"
0.4.0

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky