Travis config file

This commit is contained in:
Terry Raimondo 2019-10-09 02:41:34 +02:00
parent e6cd6529b0
commit 0310a3d2d3
4 changed files with 29 additions and 2 deletions

19
.travis.yml Normal file
View File

@ -0,0 +1,19 @@
language: rust
rust:
- stable
- beta
- nightly
matrix:
include:
- rust: nightly
before_script:
- export PATH=$HOME/.cargo/bin:$PATH
- cargo install cargo-update || echo "cargo-update already installed"
- cargo install cargo-travis || echo "cargo-travis already installed"
- cargo install-update -a
- mkdir -p target/kcov-master
script: cargo coveralls --verbose --all-features
allow_failures:
- rust: nightly
fast_finish: true
cache: cargo

View File

@ -3,6 +3,7 @@
![LICENSE](https://img.shields.io/crates/l/internationalization)
[![Crates.io Version](https://img.shields.io/crates/v/internationalization.svg)](https://crates.io/crates/internationalization)
[![Coverage Status](https://coveralls.io/repos/github/terry90/internationalization-rs/badge.svg?branch=master)](https://coveralls.io/github/terry90/internationalization-rs?branch=master)
[![Build Status](https://travis-ci.org/terry90/internationalization-rs.svg?branch=master)](https://travis-ci.org/terry90/internationalization-rs)
An simple compile time i18n implementation in Rust.
It throws a compilation error if the translation key is not present, but since the `lang` argument is dynamic it will panic if the language has not been added for the matching key.

View File

@ -2,5 +2,9 @@
"key.test": {
"en": "This is a test",
"fr": "C'est un test"
},
"err.not_allowed": {
"en": "You are not allowed to do this",
"fr": "Vous n'êtes pas autorisé à faire cela"
}
}

View File

@ -3,6 +3,7 @@
//! [![Crates.io Version](https://img.shields.io/crates/v/internationalization.svg)](https://crates.io/crates/internationalization)
//! ![LICENSE](https://img.shields.io/crates/l/internationalization)
//! [![Coverage Status](https://coveralls.io/repos/github/terry90/internationalization-rs/badge.svg?branch=master)](https://coveralls.io/github/terry90/internationalization-rs?branch=master)
//! [![Build Status](https://travis-ci.org/terry90/internationalization-rs.svg?branch=master)](https://travis-ci.org/terry90/internationalization-rs)
//!
//! An simple compile time i18n implementation in Rust.
//! It throws a compilation error if the translation key is not present, but since the `lang` argument is dynamic it will panic if the language has not been added for the matching key.
@ -31,9 +32,11 @@
//! Any number of languages can be added, but you should provide them for everything since it will panic if a language is not found when queried for a key.
//! In your app, jsut call the `t!` macro
//! In your app, just call the `t!` macro
//! ```rust
//! use internationalization::t;
//!
//! fn main() {
//! let lang = "en";
//! let res = t!("err.not_allowed", lang);
@ -53,7 +56,7 @@
//! Then include it in your code like this:
//! ```rust
//! ```rust,ignore
//! #[macro_use]
//! extern crate internationalization;
//! ```