joedixon / laravel-translation

Translation management for your Laravel application.
MIT License
703 stars 231 forks source link

Placeholders and buttons disappeared #131

Open lluisandreu opened 3 years ago

lluisandreu commented 3 years ago

Hello! I started using this package on a Laravel 5.8.x and it works fine, but the placeholder on some inputs and buttons have disappeared. There are no errors on the console or XHR issues. I already did config:clear, cache:clear and view:clear. Also migrated all tables and published files.

I attach screenshot.

Captura de pantalla 2020-11-02 a las 13 39 09 (2)

Here is my config file:

return [
    /*
    |--------------------------------------------------------------------------
    | Package driver
    |--------------------------------------------------------------------------
    |
    | The package supports different drivers for translation management.
    |
    | Supported: "file", "database"
    |
    */
    'driver' => 'file',

    /*
    |--------------------------------------------------------------------------
    | Route group configuration
    |--------------------------------------------------------------------------
    |
    | The package ships with routes to handle language management. Update the
    | configuration here to configure the routes with your preferred group options.
    |
    */
    'route_group_config' => [
        'middleware' => ['web','admin'],
    ],

    /*
    |--------------------------------------------------------------------------
    | Translation methods
    |--------------------------------------------------------------------------
    |
    | Update this array to tell the package which methods it should look for
    | when finding missing translations.
    |
    */
    'translation_methods' => ['trans', '__', '@lang'],

    /*
    |--------------------------------------------------------------------------
    | Scan paths
    |--------------------------------------------------------------------------
    |
    | Update this array to tell the package which directories to scan when
    | looking for missing translations.
    |
    */
    'scan_paths' => [app_path(), resource_path()],

    /*
    |--------------------------------------------------------------------------
    | UI URL
    |--------------------------------------------------------------------------
    |
    | Define the URL used to access the language management too.
    |
    */
    'ui_url' => 'string/translation',

    /*
    |--------------------------------------------------------------------------
    | Database settings
    |--------------------------------------------------------------------------
    |
    | Define the settings for the database driver here.
    |
    */
    'database' => [

        'connection' => '',

        'languages_table' => 'languages',

        'translations_table' => 'translations',
    ],
gtu-myowin commented 3 years ago

You just need to keep on translating. They were disappeared because there is no translation for your selected language.

Tharavink commented 3 years ago

I face this issue after changing driver to database from file image

not only that, every other strings in my website changed like this image

however, if I change back to file driver, everything working fine image

Tharavink commented 3 years ago

Hi, I got to fix the issue by copying content of voyager's lang folder (works for any package) to resources/lang/vendor/voyager/ as mentioned in Laravel documentation https://laravel.com/docs/8.x/localization#overriding-package-language-files

And then running the following command and choosing appropriate options (Translation from: file | Translation to: database) php artisan translation:sync-translations

legreco commented 2 years ago

I have the same problem. I am using laravel 8