1. Go to this page and download the library: Download klehm/content-blocks-i18n library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
#[Route('/{_locale}/page/{id}', Response
{
// No mention of translation anywhere — the render pipeline resolves the
// request locale and merges the stored values.
}
use ContentBlocks\I18n\Machine\TranslationProviderInterface;
final class MyProvider implements TranslationProviderInterface
{
public static function getName(): string { return 'mine'; }
public function getLabel(): string { return 'My engine'; }
public function supports(string $source, string $target): bool { return true; }
/** @param list<TranslationRequest> $requests @return list<TranslationOutcome> */
public function translate(array $requests, TranslationJob $job): array
{
// one call, many strings
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.