Download the PHP package netcore/translations without Composer

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

Keep and edit all Laravel translations in a database

By default Laravel translations are kept in language files under resources folder. This makes standart CRUD operations very cumbersome, so we decided it would be better to store all translations in a database. Benefits of this are:

  1. Easy CRUD operations and nice UI for admin
  2. Avoid GIT conflicts if lang files are edited in filesystem
  3. Performance is still great. Database is accessed only once and then translations are cached
  4. Import/export translations as Excel files for storing on Google Spreadsheets or locally

screenshot

Installation

Require this package with composer:

composer require netcore/translations --dev

Add our service provider to "providers" array in config/app.php:

\Netcore\Translator\ServiceProvider::class

Run migrations to create "translations" and "languages" tables:

php artisan migrate

Add routes to RouteServiceProvider.php. Choose middleware that will allow admins only to edit translations:

Route::group([
    'middleware' => ['web', 'isAdmin'],
    'namespace'  => null,
    'prefix'     => 'admin',
    'as'         => 'admin.'
], function (Router $router) {
    \Netcore\Translator\Router::adminRoutes($router);
});

Package uses cache tags. You can check out laravel documentation to find out more about cache tags . https://laravel.com/docs/5.4/cache#cache-tags

One of the options is to use redis.

First of all, install redis package by running this composer command.

composer require predis/predis

Then you need to change your cache driver in .env file to redis like this

CACHE_DRIVER=redis

Publish config files for defining your Admin layout to extend, translating ACP UI and more:

php artisan vendor:publish --tag=config

How to download translations from live server to development

We often want to get exact copy of translations from live server to either development or our local server. In order to do that, we must expose API routes in RouteServiceProvider.php:

Route::group([
    'middleware' => ['api'],
    'namespace'  => null,
    'prefix'     => 'api',
    'as'         => 'api.'
], function ($router) {
    Router::apiRoutes($router);
});

After that, point this .env variable to your live server:

NETCORE_TRANSLATIONS_DOWNLOAD_FROM=https://project.eu/api/translations/index

And then run on your development or local machine.

Is it battle tested?

This package has already been battle tested in numerous Netcore projects. We finally got tired of copying the code over to new projects, so code has been extracted to installable package.

Future plans

  1. Unit tests
  2. Different branches for different versions of Laravel
  3. Rewrite ACP UI with Vue.js

All versions of translations with dependencies

PHP Build Version
Package Version
Requires illuminate/translation Version ^5.3
illuminate/database Version ^5.3
illuminate/cache Version ^5.3
illuminate/routing Version ^5.3
illuminate/support Version ^5.3
illuminate/console Version ^5.3
rmccue/requests Version ^1.7
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 netcore/translations contains the following files

Loading the files please wait ....