PHP code example of hurah / translate

1. Go to this page and download the library: Download hurah/translate 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/ */

    

hurah / translate example snippets



$systemRoot = "/home/anton/Documents/sites/hurah/(admin_modules|modules|classes/Crud)";
$translationRoot = "/home/anton/Documents/sites/hurah/data";

$aTemplates = [

    /* admin_modules/ */
    "Custom/Cockpit/Foodbox/Finder/top_nav_search.twig",
    
    /* public_html/_default/modules */
    /* public_html/vangoolstoffenonline.nl/modules */
    /*  (merge) */
    "ProductList/Components/Product/{$sTemplateDir}/collection.twig",
    
    /* public_html/antonboutkam.nl/modules */
    "System/Modules/Projects/Project/page.twig",
    
    /* public_html/antonboutkam.nl/System/Modules */
    "System/Modules/Contact/contact.twig",
    
    /* classes */
    "Crud/Bank/Field" 
]


$language = new Language($systemRoot, $translationRoot);
$language->translate($templateName, $stringToTranslate);