accept-language

Crates.ioaccept-language
lib.rsaccept-language
version3.1.0
sourcesrc
created_at2017-05-25 21:52:15.789182
updated_at2023-08-19 12:18:15.642178
descriptionParse and compare Accept-Language header strings
homepage
repositoryhttps://github.com/mike-engel/accept-language-rs
max_upload_size
id15981
size31,568
Mike Engel (mike-engel)

documentation

https://docs.rs/accept-language

README

accept-language

A tiny library for parsing the Accept-Language header from browsers (as defined here)

Usage

accept-language is intended to be used by a web server, probably to decide which languages to serve up to the user based on their preferred language and the languages your application supports.

At it's most basic, it looks like this

extern crate accept_language;

use accept_language::{intersection, parse};

let user_languages = parse("en-US, en-GB;q=0.5");
let common_languages = intersection("en-US, en-GB;q=0.5", vec!["en-US", "de", "en-GB"]);

For more info and to view the full documentation, check them out on docs.rs.

Stability

accept-language is fuzz tested with cargo-fuzz on every PR and push via GitHub actions.

Contributing

Contributions are always welcome! If you found a bug, please submit an issue. If you'd like to submit a patch or feature, feel free to submit a pull request. rustfmt should be used to have consistent code formatting throughout the project.

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Changelog

License

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Mike Engel
Mike Engel

🐛 💬 💻 📖 🎨 🤔 🚇 👀 ⚠️
Lukas Kalbertodt
Lukas Kalbertodt

💻
Sean Stangl
Sean Stangl

💻 🐛 ⚠️
Kornel
Kornel

💻
Daniel Lockyer
Daniel Lockyer

🐛
Peter C. S. Scholtens
Peter C. S. Scholtens

🐛 💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Commit count: 33

cargo fmt