cares0107/translatable

This is laravel translatable package

1.1.11 2024-04-18 06:23 UTC

This package is not auto-updated.

Last update: 2024-05-02 06:31:35 UTC


README

The Translatable package is a powerful tool designed for Laravel applications that require dynamic translation management across multiple languages. It automates the process of scanning your Laravel project for translation keys and ensures that each key is properly defined in the corresponding JSON translation files for every language specified in your configuration. With Translatable, you can easily maintain and update your application's translations, making it an essential package for developers aiming to provide a multilingual user experience.

Key features include:

  1. Automatic Scanning: Scours PHP files throughout your Laravel application to identify all instances of translation keys.
  2. Dynamic Translation Management: Automatically updates JSON translation files for each configured language, ensuring that no translation key is left undefined.
  3. Configurable and Extensible: Offers flexible configuration options, including customizable paths for scanning and exclusion rules to skip directories like vendor or node_modules.
  4. Streamlined Localization Workflow: Simplifies the localization process, making it easier to manage translations across large and complex applications. Whether you're building a small project or a large enterprise application, Translatable helps keep your translations organized and in sync, facilitating a smoother development process and a better user experience for multi-language applications.

Installation

You can install the package via composer:

composer require cares0107/translatable

You can publish the config file with:

php artisan vendor:publish --tag="translatable-config"

This is the contents of the published config file:

return [
    'available_countries' => [
            'en', 'nl',
        ],

    'translation_files_path' => base_path(),

    'exclude_paths' => [
        '/vendor/',
        '/node_modules/',
        '/frontend/',
        '/website/',
        '/database/',
        '/.git/',
        '/.github/',
    ],
];

Usage

php artisan app:check-translations

Testing

composer test

Credits

License

The MIT License (MIT). Please see License File for more information.