Download the PHP package nabila/laravel-translation-sync without Composer

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

Laravel Translation Sync

A powerful Laravel package that automatically detects untranslated strings in your application and provides automatic translation capabilities using free translation services.

โœจ Features

๐Ÿš€ Quick Start (5 minutes!)

1. Install the Package

2. Publish Configuration

3. Start Translating! (No API keys needed!)

That's it! ๐ŸŽ‰ Your Laravel app now has automatic translation capabilities using completely free services.

Requirements

๐Ÿš€ Quick Start (5 minutes!)

Installation

Install the package via Composer:

Publish the configuration file:

โšก Zero-Configuration Setup

The package comes pre-configured to work with free translation services. No API keys, no billing setup required!

Start using it immediately:

๐Ÿงช Testing Your Installation

After installation, test that everything works:

Configuration

The package comes with a comprehensive configuration file. Here are the key settings:

Environment Variables

Add these to your .env file:

๐ŸŽ‰ No billing, no API keys, no setup required! The package uses free translation services by default.

๐Ÿ“‹ Need help getting a Google Translate API key? Check out our Quick Setup Guide for step-by-step instructions!

Usage

Basic Scanning

Scan for missing translations:

Automatic Translation

Enable automatic translation with the --translate flag:

Advanced Options

Translation Services

๐Ÿš€ Free Services (No API Keys Required!)

LibreTranslate (Default - Recommended)

Completely free, open-source translation service

MyMemory

Community-driven translation service

๐Ÿ’ฐ Paid Services

Google Translate

Professional translation service

๐Ÿ“‹ Need help with Google Translate API? Check out our Quick Setup Guide

Follow these steps to obtain your Google Translate API key:

  1. Go to Google Cloud Console

  2. Create or Select a Project

    • Click on the project dropdown at the top
    • Either select an existing project or click "New Project"
    • If creating new: Enter project name and click "Create"
  3. Enable the Cloud Translation API

    • In the left sidebar, go to "APIs & Services" > "Library"
    • Search for "Cloud Translation API"
    • Click on "Cloud Translation API" from the results
    • Click the "Enable" button
  4. Create API Credentials

    • Go to "APIs & Services" > "Credentials"
    • Click "Create Credentials" > "API key"
    • Your API key will be generated and displayed
    • Important: Copy and save this key securely
  5. Secure Your API Key (Recommended)

    • Click on the API key name to edit it
    • Under "API restrictions", select "Restrict key"
    • Choose "Cloud Translation API" from the list
    • Under "Application restrictions", you can:
      • Set HTTP referrers for web apps
      • Set IP addresses for server apps
      • Or leave unrestricted for development
  6. Set Up Billing (Required)

    • Google Translate API requires a billing account
    • Go to "Billing" in the left sidebar
    • Link a billing account or create a new one
    • Note: Google provides free credits for new accounts
  7. Add to Your Environment

Pricing Information

API Limits

๐Ÿงช Testing Service

Dummy Service

For development and testing

The dummy service is useful for testing and development. It simply appends the target language code to the original text.

๐Ÿ†“ Using FreeTranslateApi (Self-hosted, Free)

1. Host the API

2. Configure the Package

3. Usage

4. Notes

Supported Translation Patterns

The package automatically detects these translation patterns in your code:

File Formats

JSON Format (default)

PHP Format

Advanced Features

Translation Statistics

Get detailed statistics about your translation coverage:

This shows:

Context-Aware Detection

The package provides context for each missing translation, showing:

Placeholder Preservation

The package intelligently handles Laravel translation placeholders:

Examples

Basic Usage

Run the sync command:

This will:

  1. Detect the missing translations
  2. Automatically translate them to your configured target languages
  3. Save them to your translation files

Configuration Example

Troubleshooting

Common Issues and Solutions

1. Google Translate API Key Issues

Problem: "Google Translate service is not properly configured"

Solutions:

Test your API key:

2. Permission Issues

Problem: "Failed to create translation file" or permission errors

Solutions:

3. Missing Translations Not Detected

Problem: Known untranslated strings are not being found

Solutions:

4. Quota Exceeded Errors

Problem: "Quota exceeded" or rate limit errors

Solutions:

5. Composer Dependencies

Problem: Package installation fails

Solutions:

6. Configuration Not Loading

Problem: Configuration changes not taking effect

Solutions:

Debugging Commands

Environment Validation

Create a simple test to validate your setup:

Error Handling

The package includes comprehensive error handling:

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This package is open-sourced software licensed under the MIT license.

Support

If you discover any security vulnerabilities or bugs, please send an e-mail to the package maintainer.

Changelog

v2.0.1 (Compatibility Update)

v2.0.0 (Enhanced Version)

v1.0.0 (Original Version)


All versions of laravel-translation-sync with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.0
stichoza/google-translate-php Version ^5.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 nabila/laravel-translation-sync contains the following files

Loading the files please wait ...