Download the PHP package topview-digital/laravel-translation-helper without Composer

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

[GitHub release]() Scrutinizer Code Quality Build Status Code Intelligence Status Language [License]() Total Downloads HitCount

Laravel Translation Helper

Localize the terms in your code and store translations in the tables or export to text files.

Implementations of inline translation for your strings required localization and archiving the translations int tables or exporting to text files, while you have google access and queue function enabled for default queue, it will help you to generate the other required languages automatically via google translation.

Requirements

Installation

Require the package via Composer:

Laravel will automatically register the ServiceProvider.

Publish Package

After installation, please publish the assets by below commands

Configure Package

Please config your settings in config/trans-helper.php file, it should looks like below

Once you confired your settings, you may run install command to setup the tables for the package.

Configure Queue

If you want use the auto translation feature, please also config your queue config file and .env file. If you have enabled the queue feature for default queue, please skipp below instructions. config/queue.php[example]

.env[queue section]

After your configuration done, please ensure the your queue is up and running. Simple way is run

and make it running all the time in the background.

Mark the Cited Code Feature

You could follow up on the translation later by setup the web interface to fine-tuning the interpretations. However, sometimes it's difficult to recall where the terms are used. You can turn on the feature of cite, and it will help you to record the place you cited the term in your code.

Define Your Own Translator

You can define your own translator by reference the code below, and set it in config.

Usage

For the following examples

Translation

You can wrap your strings, NO parameters invovled, in helper function localize()

And the helper will translate the string into relavent languages accroding to your current locale of laravel user while you have laravel queue function enabled and queue default is running in background.

Sweep

As the process of development the strings in the code changes a lot, you may manually run command

or call the sweep action in your code by helper function sweep()

And you also can manually trigger the auto translation without/before running your code by calling command

or call the translation in your code by calling helper function translate($locales=[]), the inbound parameter is the locale codes you want to translate like ['en','zh-CN','br','de'...], default locales are the config('app.locale'), config('app.fallback_locale'), config('app.faker_locale').

Export

You can use the translation feature without text lang files, you really need them. You can use export command to get them

or call it in your code or tinker enviroment by helper command export($path=null,$locales=null), it will help your to export all locales that has translated in the tables or the locales that your assigned. Noticed: if the locale that you assigned not have any tranlsations yet, it will use the translations of locale config('app.locale').

The export language files will named with the helper function localize() called file namespace.

Hope you enjoy it! Thanks!

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-translation-helper with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.0
laravel/framework Version ^5.5.0
campo/random-user-agent Version ^1.3
stichoza/google-translate-php Version ^4.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 topview-digital/laravel-translation-helper contains the following files

Loading the files please wait ....