1. Go to this page and download the library: Download folded/translation 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/ */
folded / translation example snippets
return [
"home" => [
"title" => "Welcome in the home page",
],
];
return [
"home" => [
"title" => "Bienvenue sur la page d'accueil",
],
];
use function Folded\setDefaultTranslationLang;
use function Folded\setTranslationFolderPath;
setDefaultTranslationLang("en");
setTranslationFolderPath("path/to/folder");
use function Folded\getTranslation;
echo getTranslation("messages.home.title");
use function Folded\getTranslation;
echo getTranslation("Contact us for a custom tailored quotation");
use function Folded\getTranslation;
echo getTranslation("messages.home.welcome", ["name" => "John"]);