Download the PHP package pollora/pollingo without Composer

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

๐ŸŒ Pollingo

A framework-agnostic PHP package for translating groups of strings using OpenAI.

๐Ÿš€ Features

๐Ÿ“ฅ Installation

Standalone Installation

Laravel Installation

The package will automatically register itself if you're using Laravel's package discovery. After installation, you can publish the configuration file:

๐Ÿ”ง Configuration

Standalone Configuration

Set your OpenAI API key in your environment:

Laravel Configuration

In your .env file:

You can also customize the configuration in config/pollingo.php after publishing it.

๐Ÿ“ Basic Usage

Single String Translation

Group Translation

Laravel Usage

Using the Facade:

Using Dependency Injection:

๐ŸŒ Language Support

Pollingo supports all ISO 639-1 language codes. Here are some common examples:

Example with language codes:

๐Ÿงฉ Advanced Features

Groups and Context

You can organize your translations into logical groups and provide context:

Custom Translators

While OpenAI is the default translation provider, you can implement your own translator by implementing the Translator interface:

You can then use your custom translator in two ways:

  1. Using the fluent withTranslator() method:

  2. Using the make() method's translator parameter:

This is particularly useful when you want to:

Creating Custom AI Translators

You can create custom AI translators by extending the BaseAITranslator class:

Global Context

You can provide global context that applies to all translations:

Multiple Groups

You can translate multiple groups in a single request:

๐Ÿ› ๏ธ Laravel Integration Features

Configuration

The package provides a configuration file that can be customized:

Service Container

The package registers both the main service and the translator interface in Laravel's service container:

API Configuration and Reliability

Pollingo provides methods to customize the OpenAI API configuration and enhance reliability with retries:

๐Ÿงช Testing

For testing with OpenAI, you need to set the following environment variables:

๐Ÿค Contributing

Please see CONTRIBUTING.md for details.

๐Ÿ“„ License

The MIT License (MIT). Please see License File for more information.


All versions of pollingo with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2|^8.3
nyholm/psr7 Version ^1.8
openai-php/client Version ^0.8.0
patrickschur/language-detection Version ^5.0
symfony/http-client Version ^6.0|^7.0
vlucas/phpdotenv Version ^5.6
guzzlehttp/guzzle Version ^7.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 pollora/pollingo contains the following files

Loading the files please wait ...