diff options
-rw-r--r-- | config/general.yml-example | 4 | ||||
-rw-r--r-- | config/initializers/fast_gettext.rb | 4 | ||||
-rw-r--r-- | lib/configuration.rb | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/config/general.yml-example b/config/general.yml-example index fd134b0c2..bfe289541 100644 --- a/config/general.yml-example +++ b/config/general.yml-example @@ -32,6 +32,10 @@ AVAILABLE_LOCALES: 'en es' DEFAULT_LOCALE: 'en' USE_DEFAULT_BROWSER_LANGUAGE: true +# If you don't want the default locale to be included in URLs generated +# by the application, set this to false +INCLUDE_DEFAULT_LOCALE_IN_URLS: true + # How many days should have passed before an answer to a request is officially late? REPLY_LATE_AFTER_DAYS: 20 REPLY_VERY_LATE_AFTER_DAYS: 40 diff --git a/config/initializers/fast_gettext.rb b/config/initializers/fast_gettext.rb index 2ecf5cb5d..55d05fcaf 100644 --- a/config/initializers/fast_gettext.rb +++ b/config/initializers/fast_gettext.rb @@ -3,4 +3,6 @@ FastGettext.default_text_domain = 'app' I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks) - +if Configuration::include_default_locale_in_urls == false + RoutingFilter::Locale.include_default_locale = false +end
\ No newline at end of file diff --git a/lib/configuration.rb b/lib/configuration.rb index abd0f5cdc..11fe1c56e 100644 --- a/lib/configuration.rb +++ b/lib/configuration.rb @@ -25,6 +25,7 @@ module Configuration :GA_CODE => '', :GAZE_URL => '', :HTML_TO_PDF_COMMAND => '', + :INCLUDE_DEFAULT_LOCALE_IN_URLS => true, :INCOMING_EMAIL_DOMAIN => 'localhost', :INCOMING_EMAIL_PREFIX => '', :INCOMING_EMAIL_SECRET => 'dummysecret', |