Skip to content

Support language prefix for multi-lingual websites using Translatable

License

Notifications You must be signed in to change notification settings

sanderha/silverstripe-languageprefix

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LanguagePrefix module for SilverStripe CMS

Note: this is a test version

Rewrite of version 2.0. The main difference is that the Prefix is no longer a separate url param, but is extracted from the URLSegment instead. This allows for more flexibility - for instance to optionally use urls without prefix for the default language.

Note: this version should still be backwards compatible. Please create an issue if you find any problems

  • Supports SilverStripe 3.1.x +
  • For SilverStripe 3.0.x use version 1.0

Introduction

The Language Prefix module allows you to create links with a language prefix for multilingual websites using SilverStripe Translatable. Example:

www.mydomain.com/en/
www.mydomain.com/nl/

Changes in this version

  • $Prefix segment is stripped from the url rule (routes.yml)
  • PrefixModelAsController::handleRequest() now handles extracting the prefix from the url, and shifts the url and other params if need be
  • Optionally set disable_prefix_for_default_lang to remove the prefix from the default language

Usage

Setup and usage documentation: docs/en/index.md

Requirements

  • SilverStripe Framework 3.1+ and CMS 3.1+
  • SilverStripe Translatable module

Maintainers

  • Martine Bloem (martimiz at gmail dot com)

About

Support language prefix for multi-lingual websites using Translatable

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%