laravel-translatable | A Laravel package for multilingual models | Translation library

 by   Astrotomic PHP Version: v11.12.1 License: MIT

kandi X-RAY | laravel-translatable Summary

kandi X-RAY | laravel-translatable Summary

laravel-translatable is a PHP library typically used in Utilities, Translation, Laravel applications. laravel-translatable has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

This is a Laravel package for translatable models. Its goal is to remove the complexity in retrieving and storing multilingual model instances. With this package you write less code, as the translations are being fetched/saved when you fetch/save your instance. The full documentation can be found at GitBook.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              laravel-translatable has a medium active ecosystem.
              It has 1056 star(s) with 132 fork(s). There are 16 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 12 open issues and 206 have been closed. On average issues are closed in 34 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of laravel-translatable is v11.12.1

            kandi-Quality Quality

              laravel-translatable has 0 bugs and 69 code smells.

            kandi-Security Security

              laravel-translatable has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              laravel-translatable code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              laravel-translatable is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              laravel-translatable releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.
              laravel-translatable saves you 1155 person hours of effort in developing the same functionality from scratch.
              It has 2608 lines of code, 281 functions and 25 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed laravel-translatable and discovered the below as its top functions. This is intended to give you an instant insight into laravel-translatable implemented functionality, and help decide if they suit your requirements.
            • Get the translation .
            • Lists all translations .
            • Fill attributes .
            • Load translations .
            • Set the available locales .
            • Format the rule .
            • Query scope to order by a translation .
            • Get the translation model name .
            • Sets a country .
            • Get relation foreign key .
            Get all kandi verified functions for this library.

            laravel-translatable Key Features

            No Key Features are available at this moment for laravel-translatable.

            laravel-translatable Examples and Code Snippets

            No Code Snippets are available at this moment for laravel-translatable.

            Community Discussions

            QUESTION

            Laravel application hang on Google Cloud Run but runs fine on home setup
            Asked 2021-Nov-24 at 13:59

            I am testing out Google Cloud Run as a platform to run a new project. Project is developed using NodeJS and Laravel. Created a docker images based on php-fpm. This image runs fine on my dev environment running Ubuntu 21.04 and Docker 20.10.8. When running the same image deployed on Google Cloud Run the application hangs randomly. I have narrowed it down to a specific line in imported symfony http send function, class called from laravel index.php. Application will hang a function call to fast_cgi_finish_request(). It will hang on that line 70% of cases and call to timeout after 300 seconds when nginx times out.

            Hanging line in ./vendor/symfony/http-foundation/Response.php:

            ...

            ANSWER

            Answered 2021-Sep-14 at 12:56

            I encountered the same problem recently (specifically, using Laravel Passport).

            We were also making use of mounted secrets, and noticed that every 10-30 minutes our application would hang and time out after 60s (our configured timeout in Cloud Run). One of my colleagues noticed that every time our application started hanging, one of the first things to start failing was the reading of the mounted secret.

            I asked about this behaviour in the Google Cloud Community Slack workspace, and one of the Cloud Run PM's replied indicating that they were rolling back a recent implementation change.

            I suspect that you encountered the same issue that we did (running our application in GKE also worked fine).

            If it's at all possible, switch to mounting your secrets into your environment. This should resolve the issues of your application hanging.

            Source https://stackoverflow.com/questions/68951645

            QUESTION

            Laravel translations
            Asked 2021-Nov-23 at 16:34

            can someone tell me how can I search (with livewire) products which have a translatable title? Currently, I am using astrotomic/laravel-translatable package. Translations are working just fine and I can statically pull the right data but when I try to search it I have an issue because the package is expecting to have a title in a different table and not in the main products table.

            Here are the code snippets.

            Translatable product fields table:

            ...

            ANSWER

            Answered 2021-Nov-23 at 16:34

            I didn't test it but can work

            Source https://stackoverflow.com/questions/70079977

            QUESTION

            Laravel search from translation table and relationship
            Asked 2021-Sep-15 at 14:43

            I have three tables: products, products_translations and products_attributes. I'm also using laravel-translatable.

            So far I can search by the name of the product with the following code of my controller:

            ...

            ANSWER

            Answered 2021-Sep-15 at 14:43

            QUESTION

            Laravel-scout : ElasticSearch with Translatable Entities (astrotomic/laravel-translatable)
            Asked 2021-Feb-25 at 23:51

            I'm trying to use "babenkoivan/scout-elasticsearch-driver" with "astrotomic/laravel-translatable", but i don't understand how I could index the translated words.

            My Model looks like :

            ...

            ANSWER

            Answered 2021-Feb-25 at 23:50

            I found a solution with the override of the method public function toSearchableArray() with something like:

            Source https://stackoverflow.com/questions/66348404

            QUESTION

            spatie / laravel-translatable shows the default locale when I try to retrieve the translation that does not exist yet
            Asked 2020-Dec-11 at 14:28

            The problem is that I want a title with 3 languages (English, Italian, German). The user can add 3 titles on a form for each language which only the Italian is required. After that the titles are saved in db like this using spatie / laravel-translatable:

            ...

            ANSWER

            Answered 2020-Dec-11 at 14:28

            Can you try to $useFallbackLocale=false param for not getting default locale string.

            You can check method usage from source code.

            As: $product->getTranslation('description_locale', 'de', false)

            Source https://stackoverflow.com/questions/65252615

            QUESTION

            Can't update a translatable model in Laravel
            Asked 2020-Oct-04 at 12:09

            I am using https://github.com/Astrotomic/laravel-translatable to make my models translatable.

            While I am trying to update the model using below method to update the mode along with its associated translated content.

            ...

            ANSWER

            Answered 2020-Oct-04 at 12:09

            I figured out that The issue was in the setup of the productTranslation model.

            the 'product_translations' table primary key is a composite of 'product_uuid' and the 'locale'.

            so in the 'ProductTranslation' model I defined the primary key as an array

            Source https://stackoverflow.com/questions/64184320

            QUESTION

            How can I implement I18n as a JSON object for a JPA or Hibernate entity?
            Asked 2020-Sep-16 at 16:20

            I have a Spring-boot application that uses JPA and Hibernate. You can find the whole code on this GitHub repository.

            My question is how can I add internationalization functionality to a specific column without any foreign keys and by using JSON structure?

            For example I would like to define a JPA entity like this:

            ...

            ANSWER

            Answered 2020-Jun-23 at 10:09

            Since this is a very common requirement, this answer is based on this article I wrote on my blog, which explains how the Hibernate Types project adds support for mapping Map entity attributes as JSON column types.

            Hibernate Types project

            First, you need to add the Hibernate Type project dependency.

            Afterward, you could use either an HStore column or a JSONB column to store the locate-specific titles:

            Source https://stackoverflow.com/questions/62409871

            QUESTION

            How can I executing query to only one?
            Asked 2020-Jul-09 at 10:58

            Here's the story, I'm using this package (laravel-translatable) for model Translations.

            I used it for the governorates in select box and every thing is good and works, BUT when I open the debugger I found there is 21 queries run!!

            There is 1+N issue, How can I executing to one query!

            just for info:

            There is two models for translate ( Governorate, GovernorateTranslation ) first one contains just (id) and the second contains ( id , local , name, governorate_id).

            ...

            ANSWER

            Answered 2020-Jun-26 at 19:08

            you can try to call all ids in just one query

            Some ways to do this

            Source https://stackoverflow.com/questions/62601060

            QUESTION

            Composer won't install even though there's no apparent conflict
            Asked 2020-May-10 at 13:02

            I've been struggling with this issue for a while. I'm upgrading from Laravel 6 to 7, and composer is not cooperating here. It outputs an enormous dependency story which doesn't make any sense to me at all.

            I made sure my dependencies support Laravel 7.0, and I might've missed something, but composer is surely not highlighting it if I did.

            I removed composer.lock and vendor as well.

            Here's my composer.json:

            ...

            ANSWER

            Answered 2020-May-10 at 13:02

            At the end of the conclusion list, it tells you it wants to install php-tmdb/api: 2.1.x-dev.

            If you go to that project's repo, you'll notice there's a v3 available.

            v2 of php-tmdb/api wants "symfony/event-dispatcher": ">=2.4,<5" - that collides with laravel's constraint.

            Solution: require php-tmdb/api: 3.0

            https://github.com/php-tmdb/api/releases

            Source https://stackoverflow.com/questions/61711589

            QUESTION

            Laravel 7 ignore global scope when creating
            Asked 2020-Apr-25 at 22:08

            I have a model Publisher that has a many to many relationship to Collection

            Both have a property called approved that is set to false when initially created

            I have a global scope that hides any Publisher or Collection where approved === false

            ...

            ANSWER

            Answered 2020-Apr-25 at 22:08

            After careful investigation and some help, it came to light this was the result of the koenhoeijmakers/laravel-translatable package on the Collection

            I have solved the issue by not applying the middleware that applies the ApprovedScope on the store routes where this was causing issues.

            Source https://stackoverflow.com/questions/61384691

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install laravel-translatable

            You can download it from GitHub.
            PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.

            Support

            Please see CONTRIBUTING for details. You could also be interested in CODE OF CONDUCT.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/Astrotomic/laravel-translatable.git

          • CLI

            gh repo clone Astrotomic/laravel-translatable

          • sshUrl

            git@github.com:Astrotomic/laravel-translatable.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link