Download the PHP package ixudra/translation without Composer

On this page you can find all versions of the php package ixudra/translation. 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 translation

ixudra/translation

Latest Version on Packagist [license]() Total Downloads

Custom PHP translation library for the Laravel framework - developed by Ixudra.

This package can be used by anyone at any given time, but keep in mind that it is optimized for my personal custom workflow. It may not suit your project perfectly and modifications may be in order.

Note before posting an issue: When posting an issue for the package, always be sure to provide as much information regarding the problem as possible.

Why use this package?

The Laravel internationalization system is an amazing feature that makes translating messages in different languages incredibly easy. Unfortunately, I found that it has one big downside: since a lot of error messages (particularly with regards to model validation) are very similar, it encourages duplication in language files. This is particularly frustrating when adding a new language to your application. This package attempts to address that issue by applying a well-known programming construct: recursion.

This package provides functionality to include placeholder values in your translation messages that will be identified, translated and replaced at runtime. This makes the Laravel translation system more dynamic and reduces overall duplication in language files.

Installation

Pull this package in through Composer.

or run in terminal: composer require ixudra/translation

If you want to use this package with Laravel 4, change the above line to "ixudra/translation": "1.*" instead.

Laravel 5.5+ Integration

Laravel's package discovery will take care of integration for you.

Laravel 5.* Integration

Add the service provider to your config/app.php file:

Add the facade to your app.php file

Laravel 4.* Integration

Add the service provider to your app/config/app.php file:

Add the facade to your app/config/app.php file:

Usage

Once included, the package can easily be used in any Laravel application. In order to translate a message, simply use the facade and pass in the key to the translation value which is stored in your language files:

The package will automatically scan language files both your application and the package itself to find a match for this key. It is important to know that the package will give priority to application keys to allow the user to specify custom message instead of those provided by the package. If no value can be found for the provided key, the package will simply return the key itself, just as the Laravel Lang facade would.

Translating models

Since translation messages are commonly used for models, this package provides a specific method to make this even more easier:

When this method gets called, the package will:

The result of this interaction is (by default): The user has been created successfully.

Recursive translations

Recursive translations work similar to the other methods mentioned above. Upon finding the translation key, the package will then scan the value for recursion identifiers that need to be translated. These are highlighted by adding ## to the front and back of the translation key (e.g. ##common.submit##).

For example, see the following values in the lang/admin.php file that you can find in the package:

These values can be translated using the recursive method, passing the in model parameter as you would using the Laravel Lang facade:

When this method gets called, the package will:

The result of this interaction will be (by default): New user.

You can include as many recursion identifiers as you want in one translation value. It is important to note however that the recursion is currently limited to one level. This feature will be added in the near future.

Publishing the language files

The package has several language files that contain translations that can be used in your code. These translations can be used out of the box, but can also be modified if they don't match your needs. In order to modify these, you will have to publish the config file using artisan:

That's all there is to it! Have fun!

Support

Help me further develop and maintain this package by supporting me via Patreon!!

License

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

Contact

For package questions, bug, suggestions and/or feature requests, please use the Github issue system and/or submit a pull request. When submitting an issue, always provide a detailed explanation of your problem, any response or feedback your get, log messages that might be relevant as well as a source code example that demonstrates the problem. If not, I will most likely not be able to help you with your problem. Please review the contribution guidelines before submitting your issue or pull request.

For any other questions, feel free to use the credentials listed below:

Jan Oris (developer)


All versions of translation with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0
illuminate/support Version >=6.0
illuminate/translation Version >=6.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 ixudra/translation contains the following files

Loading the files please wait ....