futurice/joi18n

Name: joi18n

Owner: Futurice

Description: hapi plugin for i18n and translation of default joi error messages.

Forked from: ozum/joi18n

Created: 2016-07-11 12:27:22.0

Updated: 2016-07-11 12:27:24.0

Pushed: 2016-07-11 12:32:07.0

Homepage:

Size: 6409

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

joi18n

hapi plugin for i18n and translation of default joi error messages.

Description

Provides translated messages for joi default error messages. After registering this plugin default hapi error messages appears as translated.

Synopsis

var server = new hapi.Server();
var plugins = [
    {register: require('hapi-locale')},
    {register: require('joi18n')}
];

server.connection();

server.register(plugins, function (err) {
    if (err) throw err;
    server.start(function () {
        console.log('Server started at: ' + server.info.uri);
    });
});

How it works?

To keep it simple, this module does not use any i18n module for translation, it simply assigns language specific JSON to validation options via route.settings.validate.options.language.

Contribution

I need help for translating json files located in locales directory. Please send pull request on github repository for translated json files.

Currently available languages

History & Notes

0.0.18 / 2016-02-11 0.0.11 / 2015-12-02 0.0.1 / 2015-09-16

LICENSE

The MIT License (MIT)

Copyright (c) 2015 Özüm Eldo?an

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.