Searches for multilingual phrases in Laravel project and automatically generates language files for you.

Overview

Laravel Lang Generator

Laravel Lang Generator

Build Status StyleCI Latest Stable Version Total Downloads Stable License PHP Version

Searches for multilingual phrases in a Laravel project and automatically generates language files for you. You can search for new translation keys, delete unused keys, and quickly generate new language files.


Installation

You can start the installation through the composer using the command.

composer require glebsky/laravel-lang-generator

Configuration

To create configuration file of this package you can use command:

php artisan vendor:publish --tag=config

It will create configuration file in app/config with name lang-generator

About configuration

file_type: is responsible for the type of the generated file. It is possible to generate both a json and an php array files. Posible values: array , json


file_name: is responsible for the name of the generated files. By default it is lang.


languages: is responsible for the generated languages and accepts an array. Language folders with the specified data will be created. By default it just en.


Usage

Main Command

This command starts searching for translation keys in the resource/views and app folders according to the basic settings. Existing keys will not be removed, only new ones will be added.

php artisan lang:generate

it will create new language files with found translation keys. By default name of lang file is lang

title

Parameters

In addition, the command accepts several parameters that allow you to flexibly manage the package.

php artisan lang:generate --type= --name= --langs= --sync --clear --path=

About parameters

--type= or -T:

is responsible for the type of the generated file. It is possible to generate both a json and an php array files. Posible values: array , json.
Example: php artisan lang:generate --type=json


--name= or -N:

is responsible for the name of the generated files. By default it is lang.

Example: php artisan lang:generate --name="pagination"


--langs= or -L:

is responsible for the generated languages and accepts an array. Language folders with the specified data will be created. By default it just en.
Example: php artisan lang:generate --langs="en" --langs="es


--sync or -S:

If you specify this flag, then all unused already existing translation keys will be deleted.
Example: php artisan lang:generate --sync


--clear or -C:

If you specify this flag, existing language files are removed and new ones are created. All existing translations will be removed.

NOTE! That NOT all language files are deleted, but only with the name specified in the settings.

Example: php artisan lang:generate --clear

Notes

lang:generate will update your language files by writing them completely, meaning that any comments or special styling will be removed, so I recommend you backup your files.

You might also like...
Is an Extension of Laravel View Class which compiles String Template on the fly. It automatically detects changes on your string template and recompiles it if needed.

Laravel-fly-view Is an Extension of Laravel View Class which compiles String Template on the fly. It automatically detects changes on your string temp

Record created by, updated by and deleted by on Eloquent models automatically.

quarks/laravel-auditors Record created by, updated by and deleted by (if SoftDeletes added) on Eloquent models automatically. Installation composer re

Automatically validating Eloquent models for Laravel

Validating, a validation trait for Laravel Validating is a trait for Laravel Eloquent models which ensures that models meet their validation criteria

Automatically disable Google's FLoC in Laravel apps
Automatically disable Google's FLoC in Laravel apps

Automatically disable Google's FLoC in Laravel apps This package will automatically disable Google's FLoC. Support us We invest a lot of resources int

Automatically load your helpers in your laravel application.

Laravel AutoHelpers Automatically load your helpers in your laravel application. Installation You can install the package via composer: composer requi

Automatically generate ERD Diagrams from Model's relations in Laravel
Automatically generate ERD Diagrams from Model's relations in Laravel

Laravel ERD Generator Automatically generate interactive ERD from Models relationships in Laravel. This package provides a CLI to automatically genera

Laravel Migrations Generator: Automatically generate your migrations from an existing database schema.

Laravel Migrations Generator Generate Laravel Migrations from an existing database, including indexes and foreign keys! This package is cloned from ht

GeoLocation-Package - This package helps you to know the current language of the user, the country from which he is browsing, the currency of his country, and also whether he is using it vpn
GeoLocation-Package - This package helps you to know the current language of the user, the country from which he is browsing, the currency of his country, and also whether he is using it vpn

GeoLocation in PHP (API) 😍 😍 😍 This package helps you to know a lot of information about the current user by his ip address 😍 😍 😍 This package h

A laravel package to generate class files from stub files.

Laravel Stub Generator A php laravel package to generate useable php files from given stub files . Installation Require the package using composer: co

Releases(1.0.0)
Owner
Gleb
Studying in coding
Gleb
Generates and configures facades for laravel

Laravel Facade This package makes the process of creating facades in laravel super easy and with one simple artisan command. For each facade created w

Haytham Mones 10 Aug 31, 2022
Generates and handles Modules for Laravel

L5Modular Keep Your Laravel App Organized This package allows you to organize your Laravel project in a modular manner. You can simply drop or generat

Artem Schander 212 Jan 1, 2023
Localization Helper - Package for convenient work with Laravel's localization features and fast language files generation

Localization Helper Package for convenient work with Laravel's localization features and fast language files generation. Installation Via Composer $ c

Galymzhan Begimov 0 Jul 13, 2019
Get estimated read time of an article. Similar to medium.com's "x min read". Multilingual including right-to-left written languages. Supports JSON, Array and String output.

Read Time Calculates the read time of an article. Output string e.g: x min read or 5 minutes read. Features Multilingual translations support. Static

Waqar Ahmed 8 Dec 9, 2022
A Laravel package for multilingual models

Introduction If you want to store translations of your models into the database, this package is for you. This is a Laravel package for translatable m

Astrotomic 974 Dec 23, 2022
Laravel Multilingual Models

Laravel Multilingual Models Make Eloquent model attributes translatable without separate database tables for translation values. Simply access $countr

Guido Cella 2 Feb 8, 2022
⚡ PowerGrid generates Advanced Datatables using Laravel Livewire.

?? Documentation | ?? Features | ⌨️ Get started Livewire ⚡ PowerGrid ⚡ PowerGrid creates modern, powerful and easy to customize Datatables based on La

Power Components ⚡ 962 Jan 2, 2023
Trait for multilingual resource file support

⚡ Usage This library supports MultilingualResourceTrait which can be used in PluginBase. Multilingual support of resource files is possible using this

PocketMine-MP projects of PresentKim 1 Jun 7, 2022
Simple address and contact management for Laravel with automatically geocoding to add longitude and latitude

Laravel Addresses Simple address and contact management for Laravel with automatically geocoding to add longitude and latitude. Installation Require t

Chantouch Sek 2 Apr 4, 2022
Automatically encrypt and decrypt Laravel 5 Eloquent values

Eloquent Encryption/Decryption for Laravel 5 Automatically encrypt and decrypt Laravel 5 Eloquent values. READ THIS FIRST Encrypted values are usually

Del 85 Mar 19, 2022