PHP code example of atk4 / i18n

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

    

atk4 / i18n example snippets


├── languages
│   ├── en
│   │   ├── messages.en.php
│   │   └── messages+intl-icu.en.php
│   ├── en_US
│   │   ├── messages.en_US.php
│   │   └── messages+intl-icu.en_US.php
│   ├── fr
│   │   ├── messages.fr.php
│   │   └── messages+intl-icu.fr.php
│   ├── fr_FR
│   │   ├── messages.fr_FR.php
│   │   └── messages+intl-icu.fr_FR.php

use function Atk4\I18n\Resource\_t;

echo _t($id, $param, $domain, $locale)

use Atk4\I18n\T;

// create translatable msg instance.
$msg = T::from($id, $param, $domain)
//...

// output $msg in specified locale when need.
echo $msg->in('fr_FR');