Skip to content

iscarface/bottle-i18n

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

bottle_i18n

A very simple I18N plugin for Bottle apps.

Here is an example:

from bottle import Bottle, view
from bottle_i18n import I18NPlugin

myapp = Bottle()

i18n = I18NPlugin(domain='myapp')
myapp.install(i18n)


@myapp.get('/')
@view('index')
def index():
    return {}

You index.tpl may look like this:

<p>
    {{ _('test i18n in bottle template') }}
    {{ _('A person', '%(count)d people', 1, {'count': 1}) }}
    {{ _('A person', '%(count)d people', 2, {'count': 2}) }}
</p>

Put your .mo files at localedir/language/LC_MESSAGES/domain.mo

About

I18N plugin for bottle

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published