Download the PHP package vnuswilliams/laravel-autolang without Composer

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

Latest Version Total Downloads PHP Version Laravel Version License Tests Code Style

Laravel AutoLang

Laravel AutoLang automates the internationalization of your Blade views by:

The goal is to reduce manual work when setting up or maintaining multilingual support in a Laravel project.


Table of Contents


Features


Requirements


Installation

`


Configuration

Publish the configuration file:

The config/lang-auto.php file exposes:

paths

List of directories to scan for *.blade.php files.

Example with multiple locations:

extensions

List of allowed file extensions during scanning.

Default:

locale

Target locale for translation files.

output

Output format: json (default) or php.

When output = php, the PHP translation filename is automatically derived from the scanned Blade filename — no extra configuration is required.


Automatic PHP Translation File Naming

When output = php, the translation file name is generated from the Blade filename according to these rules:

Blade File Translation File
welcome.blade.php lang/<locale>/welcome.php
leave-balance.blade.php lang/<locale>/leavebalance.php
⚡welcome-to.blade.php lang/<locale>/welcometo.php
My_Cool View.blade.php lang/<locale>/mycoolview.php

Applied rules:

  1. Extensions are removed (.blade.php → two passes).
  2. The result is converted to lowercase.
  3. Any non-Unicode letter or digit character is removed.

With --all, each Blade file produces its own PHP translation file.


Available Command

Example paths:

Options:

With --all, an extra confirmation is requested before starting the global scan (unless --force is present).

Full signature:


Usage Examples

1) First Translation Migration (JSON)

2) PHP Output — Automatic Naming

3) Global PHP Scan

4) Verification Before Commit (Local CI)

5) Non-Interactive Execution (Scripts / CI)


Supported Scenarios

Simple HTML Text

Before:

After:

Preserving Surrounding Spaces

Before:

After:

Apostrophes

Before:

After:

JSON Translation Deduplication

If a key already exists in lang/<locale>.json, it is not duplicated. The file is alphabetically sorted to keep clean diffs.


Ignored Cases / Known Limitations

To avoid false positives, some blocks are ignored during extraction:

Important Limitations


Recommended Team Workflow

  1. Create a dedicated branch.

  2. Run a dry-run:

  3. Execute for real:

  4. Review diffs for:

    • modified Blade views,
    • lang/<locale>/*.php or lang/<locale>.json files.
  5. Commit clearly (example: chore(i18n): auto-wrap blade strings).

Troubleshooting

"No Blade files found."

"No new translatable strings found."

PHP translation file is not created


Laravel i18n Best Practices


License

MIT


Reverse Command — --reverse

The --reverse command allows reverting changes: it reads translation values, replaces {{ __('...') }} helpers with raw text in Blade views, then removes used keys from translation files.

The flag does not take any value. Everything relies on the configuration (locale, output).


Workflow Depending on output

json mode

  1. Load lang/<locale>.json
  2. In targeted Blade files, resolve each {{ __("...") }} → replace with raw value
  3. Remove used keys from the .json file and rewrite it

php mode

  1. List available .php files in lang/<locale>/ and ask for selection interactively
  2. Load translations from the selected file
  3. In targeted Blade files, resolve each {{ __("...") }} → replace with raw value
  4. Remove used keys from the .php file and rewrite it

Key Resolution

The last segment after the final . is used as the lookup key inside translation files.

Blade Helper Resolved Key
{{ __("welcome") }} welcome
{{ __("messages.welcome") }} welcome
{{ __("a.b.c.myKey") }} myKey

If a key is not found in the translation file, the helper remains unchanged.


Full Example

Blade before:

lang/fr.json:

After:

Blade result:

lang/fr.json after cleanup:


Compatible Options With --reverse

Option Behavior
--dry Preview without modifying files
--force Apply without confirmation
--all Process all configured views
--locale=fr Temporarily override locale
--output=json\|php Temporarily override output format

Limitations


All versions of laravel-autolang with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2||^8.3||^8.4
illuminate/support Version ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/console Version ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/filesystem Version ^10.0 || ^11.0 || ^12.0 || ^13.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 vnuswilliams/laravel-autolang contains the following files

Loading the files please wait ...