Download the PHP package weglot/translate-laravel without Composer

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

⚠️ This package is deprecated ⚠️

Create a new project and use the subdomain integration (Technology: Other) to translate your Laravel website.


Laravel Package

WeglotSlack Latest Stable Version Maintainability License

Overview

Seamless integration of Weglot into your Laravel project.

Requirements

Installation

You can install the library via Composer. Run the following command:

To use the library, use Composer's autoload:

Getting Started

Package Register

This package use auto-discovery, when you require it from composer, you should have nothing to do and Provider gonna be added automatically to your config/app.php providers list.

If this doesn't work, you can add our provider to the config/app.php, as following:

Quick configuration

As usual for Laravel packages, you can publish configuration files by doing:

You'll find the configuration file in config/weglot-translate.php with default values. If you want to go deeper in corresponding part of this README.

Configuration

Here is a full configuration file:

This is an example of configuration, enter your own API key, your original language and destination languages that you want.

There is also a non-required parameters:

And some Laravel-related parameters:

Routing

Since we are adding routes for each destination languages we need a strong way to manipulate urls.

We choose to make that through named routes and route() helper.

When you create a route, you have to give a name as following:

Then you can use it in your blade templates as following:

Like that, we will detect current language and adjust url if needed.

Forcing language

You can force any language as following:

Like that, it will force es language for this link !

Caching

We implemented usage of Cache Facade for our package.

If you wanna use cache, just put the cache parameter to true in this package configuration. It will plug onto the Laravel cache behavior.

If you wanna clear your translation cache, just use the weglot:cache:clear command as following:

Helper reference

weglotCurrentUrlInstance

One of the core helper of this plugin it returns an instance of Weglot\Util\Url which is what manages:

Here is some usage examples:

weglotButtonRender

You can add a language button with the helper function: weglotButtonRender

Two layouts exists:

If you want to overwrite theses templates you can publish them with the following artisan command:

weglotHrefLangRender

Hreflang links are a way to describe your website and to tell webcrawlers (such as search engines) if this page is available in other languages. More details on Google post about hreflang: https://support.google.com/webmasters/answer/189077

You can add them through the helper function: weglotHrefLangRender

Just put the function at the end of your <head> tag:

weglotLanguage

Simple helper to convert ISO 639-1 code to full language name. It can takes one boolean parameter that allow you to choose having english name or original language name.

Here is a quick example:

Examples

You'll find a short README with details about example on each repository:

About

translate-laravel is guided and supported by the Weglot Developer Team.

translate-laravel is maintained and funded by Weglot SAS. The names and logos for translate-laravel are trademarks of Weglot SAS.

License

The MIT License (MIT)


All versions of translate-laravel with dependencies

PHP Build Version
Package Version
Requires weglot/weglot-php Version ^0.6
cache/illuminate-adapter Version ^0.2.0
illuminate/filesystem Version ^5.4
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 weglot/translate-laravel contains the following files

Loading the files please wait ....