Multilingua
<?php
use Wonder\Localization\{ LanguageContext, TranslationProvider };
# Imposto le lingue
LanguageContext::addLangPath($ROOT.'/lang/')
::defaultLang('it')
::addLanguage('it', 'Italiano', "https://www.$PAGE->domain/it/", 'it', ['IT'])
::addLanguage('en', 'English', "https://www.$PAGE->domain/en/", 'gb', [])
::setLangFromPath();
# Imposto le traduzioni
TranslationProvider::init();## Aggiunge lo slash finale a tutte le URL se manca
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.[^./]+$
RewriteRule ^(.*)$ /$1/ [R=301,L]
## Reindirizza lingue alla cartella /theme/
RewriteCond %{REQUEST_URI} ^/(it|en|de)/?(.*)$
RewriteRule ^(it|en|de)/(.*)$ /theme/$2 [L,QSA]
RewriteRule ^(it|en|de)/?$ /theme/index.php [L,QSA]Redirect
Funzioni utili
SEO
Utilità
Dropdown
Testo
Flag
Ultimo aggiornamento