PHP code example of level51 / translatable-tlds
1. Go to this page and download the library: Download level51/translatable-tlds 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/ */
level51 / translatable-tlds example snippets
// Fetches the current TLD and looks for a rule in the config
$locale = TranslatableTLDs::lookup_tld_rule();
// Apply the rule (if not null)
if($locale)
Translatable::set_current_locale($locale);