nodus-it/laravel-translation-manager

TranslationManager is a package for easy management translation strings in laravel. It has the ability to perform the translation on the console or to create an export with all the strings that can later be imported again.

0.1-beta 2018-12-13 08:04 UTC

This package is auto-updated.

Last update: 2024-11-06 20:09:55 UTC


README

License Latest Unstable Version Latest Stable Version StyleCI

About

TranslationManager is a package for easy management translation strings in laravel. It has the ability to perform the translation on the console or to create an export with all the strings that can later be imported again.

Requirements

  • Laravel 5.5+

Installation

Require this package with composer. It is recommended to only require the package for development.

composer require nodus-framework/translation-manager --dev

Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

Usage

The default language is automatically adopted by laravel. If you want to change the language, you can use the "--default-locale" option. The default language is always considered complete for the translation and is used as the basis for the translation into other languages

Show translation status

Shows all languages with count of files and values

php artisan nodus:translate

de: Found 65 files with 1880 values *primary locale
en: Found 1 files with 6 values

Export

The export generates a CSV file with the translation key, the translation in the standard language and an empty column for the desired language. The file is stored in the main directory. Currently only the missing values are exported

php artisan nodus:translate export

In which language do you want to translate? [en]:
 > 

Import

The import processes a CSV file according to the structure of the export. Only one language is imported per file. If the file can be read in, all files and folders for the new language are automatically created. If a file already exists, it will be merged. With duplicate values, the value is taken from the import.

php artisan nodus:translate import --file=translation_de-en.csv

Automatic translation

This option allows you to automate your translations. An implemented provider is currently available: Amazon AWS Translate. After entering the command below, the provider and target language are queried. Subsequently, the costs for this translation are displayed and must be explicitly confirmed. Special features and requirements for the providers are listed below.

php artisan nodus:translate auto-translate

AWS

Requirements:

  • AWS-Account
  • Package aws/aws-sdk-php
  • ENV-Variables: NODUS_TRANSLATION_MANAGER_AWS_KEY, NODUS_TRANSLATION_MANAGER_AWS_SECRET

Costs

  • 15$ per 1 Million Characters
  • Free Tier for 2 Millions Characters per month for 12 month after start using this service

ToDo-List

  • Inline translation service
  • More export/import formats