Rename crate
This commit is contained in:
parent
1cb7ed65d7
commit
1f9f9f4416
@ -1,10 +1,10 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "internationalization"
|
name = "locales"
|
||||||
version = "0.0.3"
|
version = "0.0.3"
|
||||||
authors = ["Terry Raimondo <terry.raimondo@gmail.com>"]
|
authors = ["Terry Raimondo <terry.raimondo@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "Easy to use I18n"
|
description = "Easy to use I18n"
|
||||||
keywords = ["i18n", "internationalization", "locales"]
|
keywords = ["i18n", "internationalization", "locales", "localization"]
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
repository = "https://github.com/terry90/internationalization-rs"
|
repository = "https://github.com/terry90/internationalization-rs"
|
||||||
homepage = "https://github.com/terry90/internationalization-rs"
|
homepage = "https://github.com/terry90/internationalization-rs"
|
||||||
|
22
README.md
22
README.md
@ -1,14 +1,14 @@
|
|||||||
# Internationalization
|
# Locales
|
||||||
|
|
||||||
![LICENSE](https://img.shields.io/crates/l/internationalization)
|
![LICENSE](https://img.shields.io/crates/l/locales)
|
||||||
[![Crates.io Version](https://img.shields.io/crates/v/internationalization.svg)](https://crates.io/crates/internationalization)
|
[![Crates.io Version](https://img.shields.io/crates/v/locales.svg)](https://crates.io/crates/locales)
|
||||||
[![Coverage Status](https://coveralls.io/repos/github/terry90/internationalization-rs/badge.svg?branch=master)](https://coveralls.io/github/terry90/internationalization-rs?branch=master)
|
[![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)
|
[![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.
|
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.
|
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.
|
||||||
|
|
||||||
> API documentation [https://crates.io/crates/internationalization](https://crates.io/crates/internationalization)
|
> API documentation [https://crates.io/crates/locales](https://crates.io/crates/locales)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ Any number of languages can be added, but you should provide them for everything
|
|||||||
In your app, just call the `t!` macro
|
In your app, just call the `t!` macro
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
use internationalization::t;
|
use locales::t;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let lang = "en";
|
let lang = "en";
|
||||||
@ -53,7 +53,7 @@ You can use interpolation, any number of argument is OK but you should note that
|
|||||||
To use variables, call the `t!` macro like this:
|
To use variables, call the `t!` macro like this:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
use internationalization::t;
|
use locales::t;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let lang = "en";
|
let lang = "en";
|
||||||
@ -65,26 +65,26 @@ fn main() {
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Internationalization is available on [crates.io](https://crates.io/crates/internationalization), include it in your `Cargo.toml`:
|
Locales is available on [crates.io](https://crates.io/crates/locales), include it in your `Cargo.toml`:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
internationalization = "0.0.3"
|
locales = "0.0.3"
|
||||||
```
|
```
|
||||||
|
|
||||||
Then include it in your code like this:
|
Then include it in your code like this:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate internationalization;
|
extern crate locales;
|
||||||
```
|
```
|
||||||
|
|
||||||
Or use the macro where you want to use it:
|
Or use the macro where you want to use it:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
use internationalization::t;
|
use locales::t;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Note
|
## Note
|
||||||
|
|
||||||
Internationalization will not work if no `PWD` env var is set at compile time.
|
Locales will not work if no `PWD` env var is set at compile time.
|
||||||
|
24
src/lib.rs
24
src/lib.rs
@ -1,14 +1,14 @@
|
|||||||
//! # Internationalization
|
//! # Locales
|
||||||
|
|
||||||
//! [![Crates.io Version](https://img.shields.io/crates/v/internationalization.svg)](https://crates.io/crates/internationalization)
|
//! [![Crates.io Version](https://img.shields.io/crates/v/locales.svg)](https://crates.io/crates/locales)
|
||||||
//! ![LICENSE](https://img.shields.io/crates/l/internationalization)
|
//! ![LICENSE](https://img.shields.io/crates/l/locales)
|
||||||
//! [![Coverage Status](https://coveralls.io/repos/github/terry90/internationalization-rs/badge.svg?branch=master)](https://coveralls.io/github/terry90/internationalization-rs?branch=master)
|
//! [![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)
|
//! [![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.
|
//! 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.
|
//! 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.
|
||||||
|
|
||||||
//! > API documentation [https://crates.io/crates/internationalization](https://crates.io/crates/internationalization)
|
//! > API documentation [https://crates.io/crates/locales](https://crates.io/crates/locales)
|
||||||
|
|
||||||
//! ## Usage
|
//! ## Usage
|
||||||
|
|
||||||
@ -39,7 +39,7 @@
|
|||||||
//! In your app, just call the `t!` macro
|
//! In your app, just call the `t!` macro
|
||||||
|
|
||||||
//! ```rust
|
//! ```rust
|
||||||
//! use internationalization::t;
|
//! use locales::t;
|
||||||
//!
|
//!
|
||||||
//! fn main() {
|
//! fn main() {
|
||||||
//! let lang = "en";
|
//! let lang = "en";
|
||||||
@ -52,7 +52,7 @@
|
|||||||
//! If the key is missing, your code will not compile
|
//! If the key is missing, your code will not compile
|
||||||
|
|
||||||
//! ```rust,compile_fail
|
//! ```rust,compile_fail
|
||||||
//! use internationalization::t;
|
//! use locales::t;
|
||||||
//!
|
//!
|
||||||
//! fn main() {
|
//! fn main() {
|
||||||
//! let lang = "en";
|
//! let lang = "en";
|
||||||
@ -66,7 +66,7 @@
|
|||||||
//! To use variables, call the `t!` macro like this:
|
//! To use variables, call the `t!` macro like this:
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```rust
|
||||||
//! use internationalization::t;
|
//! use locales::t;
|
||||||
//!
|
//!
|
||||||
//! fn main() {
|
//! fn main() {
|
||||||
//! let lang = "en";
|
//! let lang = "en";
|
||||||
@ -78,29 +78,29 @@
|
|||||||
//!
|
//!
|
||||||
//! ## Installation
|
//! ## Installation
|
||||||
|
|
||||||
//! Internationalization is available on [crates.io](https://crates.io/crates/internationalization), include it in your `Cargo.toml`:
|
//! Locales is available on [crates.io](https://crates.io/crates/locales), include it in your `Cargo.toml`:
|
||||||
|
|
||||||
//! ```toml
|
//! ```toml
|
||||||
//! [dependencies]
|
//! [dependencies]
|
||||||
//! internationalization = "0.0.3"
|
//! locales = "0.0.3"
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
//! Then include it in your code like this:
|
//! Then include it in your code like this:
|
||||||
|
|
||||||
//! ```rust,ignore
|
//! ```rust,ignore
|
||||||
//! #[macro_use]
|
//! #[macro_use]
|
||||||
//! extern crate internationalization;
|
//! extern crate locales;
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
//! Or use the macro where you want to use it:
|
//! Or use the macro where you want to use it:
|
||||||
|
|
||||||
//! ```rust
|
//! ```rust
|
||||||
//! use internationalization::t;
|
//! use locales::t;
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
//! ## Note
|
//! ## Note
|
||||||
|
|
||||||
//! Internationalization will not work if no `PWD` env var is set at compile time.
|
//! Locales will not work if no `PWD` env var is set at compile time.
|
||||||
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/i18n.rs"));
|
include!(concat!(env!("OUT_DIR"), "/i18n.rs"));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user