PHP code example of phizzl / codeception-translations

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

    

phizzl / codeception-translations example snippets


public function tryToTest(AcceptanceTester $I)
{
    $welcomeText = $I->translate("Welcome friend"); // result: Willkommen Freund
    
    $I->amOnPage('/');
    $I->see($welcomeText);
    
    /* You are also able to translate only placeholder within a string using the defined keys. Just use the ${key} expression in your string. */
    $statusText = $I->translate("Status: \${good}"); // result: Status: gut
    
    $I->see($statusText);
}