Giter Club home page Giter Club logo

hichemtab-tech / langifylaravel Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 39 KB

LangifyLaravel is a powerful Laravel language generation library that automates the process of creating language files for multilingual support. With just one language file, it generates translations for multiple languages, making localization a breeze.

License: MIT License

PHP 100.00%
laravel laravel-framework laravel-lang laravel-language laravel-localization laravel-multi-language laravel-package laravel-php localization multilingual

langifylaravel's Introduction

LangifyLaravel

LangifyLaravel is a powerful language generation library for Laravel developers. It simplifies the process of creating multilingual applications by automatically generating language files for various languages based on a single source language (e.g., 'en'). Enjoy effortless localization with LangifyLaravel.

Table of Contents

Features

  • Generate language files for multiple languages based on a single source language.
  • Command-line tool langs:generate to manage language file generation easily.
  • Choose between two generation modes: complete the missing translations or force overwrite existing translations.
  • Progress bar for tracking the language generation process.

Installation

To install LangifyLaravel, use Composer:

composer require hichemtab-tech/langify-laravel

Usage

Once installed, you can use LangifyLaravel to generate language files for your Laravel application. Here's an example of how to use it:

1- Create the source language file: Start by creating the language file for your source language (e.g., 'en') with all the string resources you want to translate. This will act as the base for generating other language files.

2- Generate language files: Use the generate command provided by LangifyLaravel to generate language files for other languages. For example, if your source language is 'en', you can run the following command:

php artisan langs:generate en

This will generate language files for all the languages defined in your application. By default, LangifyLaravel will complete the missing translations in the generated files based on the source language.

Command options

overwrite existing translations

Force overwrite (optional): If you want to force overwrite existing translations in the generated files, you can use the --overwrite option:

php artisan langs:generate en --overwrite

This will force overwrite existing translations with the ones from the source language.

generate language files for specific languages

Customizing language generation: If you have some languages already created and want to generate translations only for specific languages, you can specify them as a comma-separated list:

php artisan langs:generate en
> Which languages do you want to generate? (comma separated) fr,es,it

This will generate language files only for the specified languages (in this case, 'fr', 'es', and 'it').

Example

Assuming you have already set up the language files for 'en', and you want to generate language files for 'fr', 'es', and 'it', you can use the following command:

php artisan langs:generate en
> Which languages do you want to generate? (comma separated) fr,it

You want to generate language files for 'fr', 'es', and 'it', so you can answer :

> fr,es,it

Contributing

Contributions are always welcome!

If you have any ideas, improvements, or bug fixes, please open an issue or submit a pull request.

Authors

License

MIT

langifylaravel's People

Contributors

hichemtab-tech avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

mertdaver

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.