Skip to content
This repository has been archived by the owner on Jun 6, 2021. It is now read-only.

Commit

Permalink
locale dir required and set default language to en
Browse files Browse the repository at this point in the history
  • Loading branch information
iocast committed Sep 12, 2013
1 parent e01e315 commit 2f69e1d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if __name__ == '__main__':
bottle.run(app=get(), host='localhost', port='8000', quiet=False, reloader=True)
```

Running the above example it automatically loads the default language ```en``` if in the URL the langauge code or the ```HTTP_ACCEPT_LANGUAGe``` sent from the browser is missing.
Running the above example it automatically loads the default language ```en``` if in the URL the langauge code or the ```HTTP_ACCEPT_LANGUAGE``` sent from the browser is missing.

The URL structure is as follow
```
Expand Down
4 changes: 1 addition & 3 deletions bottle_i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ def middleware(self):
def middleware(self, middleware):
self._middleware = middleware

def __init__(self, domain, locale_dir=None, lang_code=None, default=None, keyword='i18n'):
def __init__(self, domain, locale_dir, lang_code=None, default='en', keyword='i18n'):
self.domain = domain
if locale_dir is None:
locale_dir = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../locale'))
if not os.path.exists(locale_dir):
raise PluginError('No locale directory found, please assign a right one.')
self.locale_dir = locale_dir

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name = 'bottle-i18n',
version = '0.1',
version = '0.1.1',
description = 'I18N integration for Bottle.',
author = 'iocast',
author_email = 'iocast@me.com',
Expand Down

0 comments on commit 2f69e1d

Please sign in to comment.