Download the PHP package rogervila/laravel-csv-translations without Composer

On this page you can find all versions of the php package rogervila/laravel-csv-translations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-csv-translations

Laravel CSV Translations

Build Status StyleCI Quality Gate Status

Latest Stable Version Total Downloads License

Laravel CSV Translations

Load Laravel localizations from a CSV File

Installation

To use Laravel CSV Translations you will have to replace the Laravel TranslationServiceProvider with the package one.

If your project uses Illuminate\Support\ServiceProvider, replace it via the replace method.

To make it work without modifying any configuration, Create a lang.csv file placed in the lang folder.

Translations will be loaded from the CSV file if it exists. Otherwise, Laravel's built-in translation system will handle them.

Configuration

The package allows configuring some of its features.

There is no config file published by the package. You might create it to override the package defaults:

CSV format

The CSV data should have keys on the first column, and then one column per locale with its ISO 639-1 code as a header.

keys custom column en es ca
greetings.good_morning Columns that do not match the current locale are just ignored Good morning :name! Buenos días, :name! Bon dia, :name!

CSV features

The CSV format is quite flexible. These are some of its features:

Dimensions

Laravel's PHP translation array files allow having more than one dimension that can be accessed with dots.

The CSV only allows one dimension, but it allows to use dots, as shown in the CSV Format example.

Translation keys column

While keys must be placed on the first column, its header content does not matter, so it's not necessary to name it "keys".

Column order

Except for the translation keys column, the order does not matter, so you can have N custom columns between locale columns if you need them.

Custom columns

Sometimes, business wants to have additional columns for translation files, like the view where a translation is placed, its context, etc.

You can have as many columns as you need, placed in the order you need.

CSV data resolver

By default, the package uses the CSVLocalFileResolver class that will try to load a lang.csv file from the project's lang path.

You may create your own CSV Resolver to customize the way to get the data:

Access raw data

Sometimes it is useful to access the raw data to list all available translation keys and their values.

To do so, CSVLoader comes with a handy raw method that returns an associative array with all translation keys and their raw values.

Author

Created by Roger Vilà

License

This package is open-sourced software licensed under the MIT license.

Package icon made by Freepik - Flaticon


All versions of laravel-csv-translations with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ^10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rogervila/laravel-csv-translations contains the following files

Loading the files please wait ....