views

catalogue

Catalogue view.

class pyramid_localize.views.catalogue.CatalogueView(request)[source]

View class for catalogue manipulation actions.

Assign request.

Parameters:request (pyramid.request.Request) –
compile_catalogue()[source]

Compile all translation files.

For every language defined compile .po files into into .mo file that’s used by gettext.

Redirects to localize:index.

index()[source]

List domains, and its files of files with metadata.

Returns:
{
    'language': {
        'domain1': {
            'po': 'modification time',
            'pot': 'modification time',
            'mo': 'modification time',
            },
        # more domains
    },
    # more languages
}
reload_catalogue()[source]

Reload translation catalogue for application it’s run in.

Note

To see how is this happening, you might want to see set_localizer()

Returns:Only for xhr requests:
{
    'status': True,
    'msg': 'Localizators has been reloaded' # translated
}

non xhr requests: Redirects to localize:index.

update_catalogue()[source]

Update or initialize translation catalogues.

Create (.po files) for each language/catalogue from their respective translation templates (.pot). This action is performed for every language defined within localize.locales.available config key.

Redirects itself to localize:index.