Skip to content

Commit a7e1e91

Browse files
committed
Rename to fluent-langneg
1 parent 9264e91 commit a7e1e91

File tree

8 files changed

+36
-49
lines changed

8 files changed

+36
-49
lines changed

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
[package]
2-
name = "fluent-locale"
2+
name = "fluent-langneg"
33
description = """
44
A library for language and locale negotiation.
55
"""
66
version = "0.10.0"
77
authors = ["Zibi Braniecki <gandalf@mozilla.com>"]
88
homepage = "http://projectfluent.org/"
99
license = "Apache-2.0"
10-
repository = "https://github.com/projectfluent/fluent-locale-rs"
10+
repository = "https://github.com/projectfluent/fluent-langneg-rs"
1111
readme = "README.md"
1212
categories = ["internationalization", "localization"]
1313
edition = "2018"
1414

1515
[badges]
16-
travis-ci = { repository = "projectfluent/fluent-locale-rs" }
17-
coveralls = { repository = "projectfluent/fluent-locale-rs", branch = "master", service = "github" }
16+
travis-ci = { repository = "projectfluent/fluent-langneg-rs" }
17+
coveralls = { repository = "projectfluent/fluent-langneg-rs", branch = "master", service = "github" }
1818

1919
maintenance = { status = "actively-developed" }
2020

README.md

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Fluent Locale
1+
# Fluent LangNeg
22

3-
**Fluent Locale is a library for language and locale identifier negotiation.**
3+
**Fluent LangNeg is a library for language and locale identifier negotiation.**
44

5-
[![crates.io](http://meritbadge.herokuapp.com/fluent-locale)](https://crates.io/crates/fluent-locale)
6-
[![Build Status](https://travis-ci.org/projectfluent/fluent-locale-rs.svg?branch=master)](https://travis-ci.org/projectfluent/fluent-locale-rs)
7-
[![Coverage Status](https://coveralls.io/repos/github/projectfluent/fluent-locale-rs/badge.svg?branch=master)](https://coveralls.io/github/projectfluent/fluent-locale-rs?branch=master)
5+
[![crates.io](http://meritbadge.herokuapp.com/fluent-langneg)](https://crates.io/crates/fluent-langneg)
6+
[![Build Status](https://travis-ci.org/projectfluent/fluent-langneg-rs.svg?branch=master)](https://travis-ci.org/projectfluent/fluent-langneg-rs)
7+
[![Coverage Status](https://coveralls.io/repos/github/projectfluent/fluent-langneg-rs/badge.svg?branch=master)](https://coveralls.io/github/projectfluent/fluent-langneg-rs?branch=master)
88

99
Introduction
1010
------------
1111

12-
This is a Rust implementation of fluent-locale library which is a part of Project Fluent.
12+
This is a Rust implementation of fluent-langneg library which is a part of Project Fluent.
1313

1414
The library uses [unic-langid](https://github.com/zbraniecki/unic-locale) and [unic-locale](https://github.com/zbraniecki/unic-locale) to retrieve and operate on Unicode Language and Locale Identifiers.
1515
The library provides algorithm for negotiating between lists of locales.
@@ -18,9 +18,9 @@ Usage
1818
-----
1919

2020
```rust
21-
use fluent_locale::negotiate_languages;
22-
use fluent_locale::NegotiationStrategy;
23-
use fluent_locale::convert_vec_str_to_langids_lossy;
21+
use fluent_langneg::negotiate_languages;
22+
use fluent_langneg::NegotiationStrategy;
23+
use fluent_langneg::convert_vec_str_to_langids_lossy;
2424
use unic_langid::LanguageIdentifier
2525

2626
// Since langid parsing from string is fallible, we'll use a helper
@@ -43,19 +43,16 @@ assert_eq!(supported,
4343

4444
See [docs.rs][] for more examples.
4545

46-
[docs.rs]: https://docs.rs/fluent-locale/
46+
[docs.rs]: https://docs.rs/fluent-langneg/
4747

4848
Status
4949
------
5050

51-
The implementation is in early stage, but is complete according to fluent-locale
51+
The implementation is complete according to fluent-langneg
5252
corpus of tests, which means that it parses, serializes and negotiates as expected.
5353

5454
The negotiation methods can operate on lists of `LanguageIdentifier` or `Locale`.
5555

56-
The ergonomics of Rust API can be improved, since the fallible nature of language identifier
57-
parsing makes operating on lists of them tedious.
58-
5956
The remaining work is on the path to 1.0 is to gain in-field experience of using it,
6057
add more tests and ensure that bad input is correctly handled.
6158

@@ -84,7 +81,6 @@ implementations of language negotiation algorithms which may choose different
8481
tradeoffs.
8582

8683
[BCP47]: https://tools.ietf.org/html/bcp47
87-
[Intl.Locale]: https://github.com/tc39/proposal-intl-locale
8884
[RFC6067]: https://www.ietf.org/rfc/rfc6067.txt
8985
[UTS 35]: http://www.unicode.org/reports/tr35/#Locale_Extension_Key_and_Type_Data
9086
[RFC4647]: https://tools.ietf.org/html/rfc4647
@@ -105,16 +101,7 @@ For such purposes, [rust-language-tags][] crate seems to be a better choice.
105101
Performance
106102
-----------
107103

108-
There has not been a significant performance work being done on the library yet,
109-
so we expect there are some low hanging fruit waiting for someone to find them.
110-
111-
At the moment performance is comparable to previously mentioned `language-tags` crate
112-
for parsing a sample list of language tags based on this crate's benchmark code:
113-
114-
115-
running 2 tests
116-
test bench_locale(fluent-locale) ... bench: 1,773 ns/iter (+/- 48)
117-
test bench_locale(language-tags) ... bench: 1,982 ns/iter (+/- 280)
104+
The crate is considered to be fully optimized for production.
118105

119106

120107
Develop

benches/negotiate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use criterion::criterion_group;
22
use criterion::criterion_main;
33
use criterion::Criterion;
44

5-
use fluent_locale::convert_vec_str_to_langids_lossy;
6-
use fluent_locale::negotiate_languages;
5+
use fluent_langneg::convert_vec_str_to_langids_lossy;
6+
use fluent_langneg::negotiate_languages;
77

88
fn negotiate_bench(c: &mut Criterion) {
99
let requested = &["de", "it", "ru"];
@@ -21,7 +21,7 @@ fn negotiate_bench(c: &mut Criterion) {
2121
&requested,
2222
&available,
2323
None,
24-
fluent_locale::NegotiationStrategy::Filtering,
24+
fluent_langneg::NegotiationStrategy::Filtering,
2525
);
2626
})
2727
});

examples/negotiate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use fluent_locale::negotiate::NegotiationStrategy;
2-
use fluent_locale::{convert_vec_str_to_langids_lossy, negotiate_languages};
1+
use fluent_langneg::negotiate::NegotiationStrategy;
2+
use fluent_langneg::{convert_vec_str_to_langids_lossy, negotiate_languages};
33

44
fn main() {
55
let requested = convert_vec_str_to_langids_lossy(&["it", "pl", "ru"]);

src/accepted_languages.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
//! # Example:
55
//!
66
//! ```
7-
//! use fluent_locale::negotiate_languages;
8-
//! use fluent_locale::NegotiationStrategy;
9-
//! use fluent_locale::parse_accepted_languages;
10-
//! use fluent_locale::convert_vec_str_to_langids_lossy;
7+
//! use fluent_langneg::negotiate_languages;
8+
//! use fluent_langneg::NegotiationStrategy;
9+
//! use fluent_langneg::parse_accepted_languages;
10+
//! use fluent_langneg::convert_vec_str_to_langids_lossy;
1111
//! use unic_langid::LanguageIdentifier;
1212
//!
1313
//! let requested = parse_accepted_languages("de-AT;0.9,de-DE;0.8,de;0.7;en-US;0.5");

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
//! fluent-locale is an API for operating on locales and language tags.
1+
//! fluent-langneg is an API for operating on locales and language tags.
22
//! It's part of Project Fluent, a localization framework designed to unleash
33
//! the expressive power of the natural language.
44
//!
5-
//! The primary use of fluent-locale is to parse/modify/serialize language tags
5+
//! The primary use of fluent-langneg is to parse/modify/serialize language tags
66
//! and to perform language negotiation.
77
//!
8-
//! fluent-locale operates on a subset of [BCP47](http://tools.ietf.org/html/bcp47).
8+
//! fluent-langneg operates on a subset of [BCP47](http://tools.ietf.org/html/bcp47).
99
//! It can parse full BCP47 language tags, and will serialize them back,
1010
//! but currently only allows for operations on primary subtags and
1111
//! unicode extension keys.
1212
//!
13-
//! In result fluent-locale is not suited to replace full implementations of
13+
//! In result fluent-langneg is not suited to replace full implementations of
1414
//! BCP47 like [rust-language-tags](https://github.com/pyfisch/rust-language-tags),
1515
//! but is arguably a better option for use cases involving operations on
1616
//! language tags and for language negotiation.

src/negotiate/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
//! # Example:
1212
//!
1313
//! ```
14-
//! use fluent_locale::negotiate_languages;
15-
//! use fluent_locale::NegotiationStrategy;
16-
//! use fluent_locale::convert_vec_str_to_langids_lossy;
14+
//! use fluent_langneg::negotiate_languages;
15+
//! use fluent_langneg::NegotiationStrategy;
16+
//! use fluent_langneg::convert_vec_str_to_langids_lossy;
1717
//! use unic_langid::LanguageIdentifier;
1818
//!
1919
//! let requested = convert_vec_str_to_langids_lossy(&["pl", "fr", "en-US"]);

tests/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ use std::fs;
33
use std::fs::File;
44
use std::path::Path;
55

6-
use fluent_locale::convert_vec_str_to_langids_lossy;
7-
use fluent_locale::negotiate_languages;
8-
use fluent_locale::parse_accepted_languages;
9-
use fluent_locale::NegotiationStrategy;
6+
use fluent_langneg::convert_vec_str_to_langids_lossy;
7+
use fluent_langneg::negotiate_languages;
8+
use fluent_langneg::parse_accepted_languages;
9+
use fluent_langneg::NegotiationStrategy;
1010
use unic_langid::langid;
1111
use unic_langid::LanguageIdentifier;
1212
use unic_locale::locale;

0 commit comments

Comments
 (0)