Download the PHP package getsupercode/localizater without Composer

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

Localizater

Latest Version on Packagist Total Downloads Test StyleCI

Laravel package for wrapping routes in multiple locale prefixes.

Installation

Via Composer

To detect and change the locale of the application based on the request automatically, you can add this middleware to your app/Http/Kernel:

Configuration

By default, the application locales are only going to be en and the default locale is not prefixed. If you want to prefix the default locale, please run the following command to publish the configuration file:

After installing the package, Adding the middleware and publishing the configuration file. You need to edit the configuration file config/localizater.php in order to add more locales.

Note

The default locale is app.locale located at config/app.php file.

Config: localizater.locales

Add supported locales. It's recommended to write the locale value with its native language.

Config: localizater.rtl_locales

Add RTL direction locales.

Config: localizater.prefix_default

If this option is set to true, Default locale URL will be prefixed.

Config: localizater.prefix_default_name

If this option is set to true, Default locale route name will be prefixed.

true:

Method URI URI Name
GET HEAD /page en.page
GET HEAD /fr/page fr.page

false:

Method URI URI Name
GET HEAD /page page
GET HEAD /fr/page fr.page

Usage

The package will not override the route features you already know. It's just a wrapper function that will create multiple locale routes for you.

The above example will give us:

Method URI Name
GET|HEAD / welcome
GET|HEAD /fr fr.welcome
GET|HEAD /user
GET|HEAD /fr/user fr.
POST /user

Route naming

If you add a name to a route it will be prepended by the locale key locale.name. for example: (fr.welcome)

All locales without a name will have the same prefix name like fr.. And this is normal as you don't need its names.

Localizater attributes

You can add attributes to the localizer group function as you do with the route group function.

Or:

Get route URL in a specified locale

You can get the current route URL in different locale key:

Or a named route:

You can pass the same parameters as the route() function after the locale parameter.

Get locale language name

You can get the value of the locale key in localizater.locales configuration for the current locale or a specified locale:

Get HTML dir attribute based on current locale

You can get HTML dir attribute based on current locale. The package will search for RTL locales in localizater.rtl_locales config. If the current locale is listed there, The output will be rtl or ltr if it's not listed.

You can also get dir attribute for a specified locale:

Change log

Please see the changelog for more information on what has changed recently.

Testing

Contributing

Please see contributing.md for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.


All versions of localizater with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3
illuminate/support Version ~5|~6|~7|~8
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 getsupercode/localizater contains the following files

Loading the files please wait ....