Download the PHP package statikbe/laravel-chained-translator without Composer

On this page you can find all versions of the php package statikbe/laravel-chained-translator. 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-chained-translator

Laravel Chained Translator

Latest Version on Packagist Total Downloads

The chained translator can combine several translators that can override each others translations. Typically, at some point during the development phase, a content manager wants to translate or finetune the translation strings added by developers. This often results in merge and versioning issues, when developers and content managers are working on the translation files at the same time.

The Chained Translator package allows translations created by developers to exist separately from translations edited by the content manager in separate lang directories. The library merges the translations of both language directories, where the translations of the content manager (the custom translations) override those of the developer (the default translations).

For instance, the default translations created by developers are written in the default Laravel lang directory in resources/lang, and the translations by the content manager are added to resources/lang-custom. When a translation key exists in the resources/lang-custom directory, this is preferred, otherwise we fallback to the default translations.

We offer two package that provide a UI to let content managers edit translations.

Installation

Via composer:

Commands

Merge the custom translations back into the default translation files

If you want to combine the translation files made in the current environment by the content manager with the default translation files, you can use the following command. You need to pass the locale as a parameter, since this library is agnostic of the locales supported by your Laravel application. Laravel sadly does not have a default supported locales list. So if you want to merge all files for all supported locales, run this command for each locale.

For example, for French:

This command can be useful to merge the translation work of a translator back into the default translation files.

Configuration

You can publish the configuration by running this command:

The following configuration fields are available:

1. Custom lang directory

By default, the custom translations are saved in resources/lang-custom. This can be configured using custom_lang_directory_name.

2. .gitignore in custom lang directory

If add_gitignore_to_custom_lang_directory is set to true, a .gitignore file is added to the custom language directory.

3. Group keys in nested arrays

If group_keys_in_array is set to true, dotted translation keys will be mapped into arrays.

Set to true: saved as nested arrays, f.e.

Set to false: saved as dotted keys, f.e.

4. Custom json group name

You can edit the group name of all json translations with the json_group.

TODO's & Ideas

Credits

We used Joe Dixon's translation libraries as a source of technical expertise and inspiration:

Thanks a lot for the great work!

License

The MIT License (MIT). Please see license file for more information.


All versions of laravel-chained-translator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1|^8.2
brick/varexporter Version ^0.4
laravel/framework Version ^9.0|^10.0|^11.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 statikbe/laravel-chained-translator contains the following files

Loading the files please wait ....