Download the PHP package edeoliv/gpt-translate without Composer

On this page you can find all versions of the php package edeoliv/gpt-translate. 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 gpt-translate

GPT-Translate for Laravel

gpt-translate is a package for Laravel that allows you to generate and translate language files using the power of OpenAI's ChatGPT API. The package supports translations in multiple languages, including English, Spanish, French, German, Italian, and Portuguese. You can call these strings using __(), @lang(), $t(), or trans(), and they can be located in php, js, ts, or vue files.

Furthermore, gpt-translate enables you to translate your base language file, whether you previously had it or generated it using the package, to other languages using the ChatGPT API. Supported languages for translation include English, Spanish, French, German, Italian, and Portuguese.

New Features

Automatically generate base translation files by scanning your application for translation strings. Translate your base language file to other languages using the ChatGPT API. Provide custom context for more accurate translations. Exclude specific words or phrases from being translated. Support for different models (e.g., GPT-3.5, GPT-4).

Getting Started

Installation
Install the package using composer:

Add Service Provider Add the following to your config/app.php file:

Publish the Configuration File
You need to publish the openai.php configuration file:

Environment Configuration
Add the OPENAI_API_KEY and OPENAI_ORGANIZATION and GPT_TRANSLATE_DEFAULT_CONTEXT and GPT_TRANSLATE_EXCLUDE_WORDS variables to your .env file with the details from your OpenAI account.

Generate Base Translation File
If you don’t already have a base translation file, generate it using:

As shown, this command creates a lang/en.json in your root folder. If your application is in another language, pass the appropriate lang parameter, e.g., for French:

Translate with ChatGPT
After having your base translation file, whether generated by the package or otherwise, run the translation command for ChatGPT to do the translation, e.g.:

This translates the original en.json to French and creates a new fr.json file.

Provide Context (Optional)
For more accurate translations, briefly describe the context of your application’s purpose. This helps ChatGPT better understand and translate the text. Use the context parameter:

Exclude Specific Words or Phrases from Translation (Optional)

You can specify words or phrases that should not be translated. This is useful for brand names, technical terms, or other content that must remain in the original language:

Specify the Model (Optional)
By default, the package uses GPT-3.5. If desired, specify any other OpenAI model compatible with the Chat API:

Configuration for Context and Exclusions (Optional)

Then, you can customize the default context and exclusions in the config/gpt-translate.php file

Example Usage

Example Usage with All Parameters

Conclusion

Leverage the power of ChatGPT and the flexibility of gpt-translate to localize your Laravel application effectively and efficiently. With the ability to provide context, exclude specific terms, and choose the model, gpt-translate ensures that your translations are accurate and appropriate for your application's needs.


All versions of gpt-translate with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
openai-php/laravel Version ^0.10.1
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 edeoliv/gpt-translate contains the following files

Loading the files please wait ....