Download the PHP package wedesignit/laravel-translations-import without Composer

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

Import your language files to the database (and much more)

This package provides you with commands to deal with your lang files and your database. Instead of manually adding translations to your database, this commandset gives you the tools needed to import and export translations, find unimported translations in your php/twig files, clean empty translations from your database and to delete all translations in one go!

Usefulness and credit

It's particularly useful in the case you're using a package like
Spatie's Laravel Translation Loader. In this case the lang files can be used as 'defaults' to import into a project. When you want to add new defaults, just add them to your lang file(s), rerun the import command and the newly added translations will be added for usage, without the existing translations being modified. You can export the files if you want the updated translations to be used as default.

Credit to Barryvdh's Translation Manager for creating this package which we could build on.

Upgrading

See upgrading for details.

Usage

The import command

This command will import all translation files located in the set lang folder.

The command offers 6 options:

Command options should be split by commas.
For groups, a wildcard () can be used at the end to allow all subdirectories to be processed as well (for either ignore or only). Example: `--only-groups=admin/`.

The export command

This command will take all translations in the database, and write them to the lang folder. Existing translations will be overwritten (except for files that don't exist in the database).

The command offers 4 options:

These options work the same as explained with the import command

The find command

This command will find all translations in your php/twig files, and import them if they do not exist in the database.

Keep in mind that this command should be handled with care, imagine we have this in a blade and trans file:

The command will find this translation and import it, it will encode the value of the 'statuses'.

The command offers 1 option:

The clean command

This command will remove all translations which do not have a stored value.

The command has no options.

The delete command

This command will remove all translations.

The command has 1 option:

This options works the same as explained with the import command

Installation

You can install the package via composer:

Config

By default, the config sets the tables and columns following the language_lines table from the Spatie's Laravel Translation Loader migration, with the following structure:

Optionally you could publish the config file to change table and column names.

This is the content of the published config file:


All versions of laravel-translations-import with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.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 wedesignit/laravel-translations-import contains the following files

Loading the files please wait ....