devon2018 / azure-translate by devon2018

Create azure translations for lumen
53
0
0
Package Data
Maintainer Username: devon2018
Maintainer Contact: devon@devonray.net (Devon Ray)
Package Create Date: 2019-02-27
Package Last Update: 2020-01-26
Language: PHP
License: Unknown
Last Refreshed: 2025-02-06 03:10:24
Package Statistics
Total Downloads: 53
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 0
Total Forks: 0
Total Open Issues: 0

Lumen Azure translation package

Installation

This package requires lumens local file storage to be setup How to setup lumen local strage

    composer require devonray/azuretranslate

Add the following to your bootstrap/app.php file to register the service provider

    $app->register(Devonray\AzureTranslate\AzureTranslatorServiceProvider::class);

Copy the language file into your config/ directory

add your Azure api key to your enviroment file Get Azure key

  AZURE_KEY=secret

add a new storage option to your filesystems.php

  'local_r' => [
    'driver' => 'local',
    'root' => base_path()
  ],
!important Make sure the resources/lang/ directory exists

Usage

You can use the packge from the terminal like follows

    php artisan translation:create "translation.key" "String to translate"

Adding the "." in the name will split the translations into files e.g user.name will create a line in the user.php translation with the name key

If no "." are present in the string then they get put into the main.php file