SilverStripe module providing TLD-based locale switching using Translatable.
This modules enables having duplicate URLSegments for different TLDs on one host, e.g. lvl51.de/about and lvl51.com/about. Since this is intended to be used alongside the Translatable module there will be entries in the
SiteTree table for each of pages/URLSegments.
composer require level51/translatable-tlds
If you don't like composer you can just download and unpack it to the root of your SilverStripe project.
Be sure to run
dev/build?flush=all after you have added the module.
// 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);
You can add rules via Config API:
TranslatableTLDs: part: 'tld' rules: 'com': 'en_US' 'de': 'de_DE' 'net': 'de_AT'
If part is set to 'subdomain', then the module will switch to subdomain matching.
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem