{"id":19947789,"url":"https://github.com/projectfluent/fluent-langneg-rs","last_synced_at":"2025-12-12T15:35:25.253Z","repository":{"id":52600635,"uuid":"106058983","full_name":"projectfluent/fluent-langneg-rs","owner":"projectfluent","description":"Library for language and locale identifier negotiation.","archived":false,"fork":false,"pushed_at":"2025-10-24T23:29:43.000Z","size":137,"stargazers_count":40,"open_issues_count":3,"forks_count":14,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-10-25T01:14:37.542Z","etag":null,"topics":["i18n","internationalization","l10n","localization","rust"],"latest_commit_sha":null,"homepage":"https://projectfluent.org/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/projectfluent.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-06T23:40:52.000Z","updated_at":"2025-10-24T23:29:46.000Z","dependencies_parsed_at":"2024-06-19T04:07:57.735Z","dependency_job_id":"33ef1d90-4d1e-4238-b90d-e944f9e65cf1","html_url":"https://github.com/projectfluent/fluent-langneg-rs","commit_stats":{"total_commits":128,"total_committers":12,"mean_commits":"10.666666666666666","dds":0.5,"last_synced_commit":"5940158e621c02efd50000ba3c31c52f35c0aa69"},"previous_names":["projectfluent/fluent-locale-rs"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/projectfluent/fluent-langneg-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectfluent%2Ffluent-langneg-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectfluent%2Ffluent-langneg-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectfluent%2Ffluent-langneg-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectfluent%2Ffluent-langneg-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/projectfluent","download_url":"https://codeload.github.com/projectfluent/fluent-langneg-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectfluent%2Ffluent-langneg-rs/sbom","scorecard":{"id":746616,"data":{"date":"2025-08-11","repo":{"name":"github.com/projectfluent/fluent-langneg-rs","commit":"5940158e621c02efd50000ba3c31c52f35c0aa69"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":1,"reason":"Found 5/30 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T18:57:20.922Z","repository_id":52600635,"created_at":"2025-08-22T18:57:20.922Z","updated_at":"2025-08-22T18:57:20.922Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27685558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-12T02:00:06.775Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["i18n","internationalization","l10n","localization","rust"],"created_at":"2024-11-13T00:37:24.898Z","updated_at":"2025-12-12T15:35:25.202Z","avatar_url":"https://github.com/projectfluent.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Fluent LangNeg\n\n**Fluent LangNeg is a library for language and locale identifier negotiation.**\n\n[![crates.io](https://img.shields.io/crates/v/fluent-langneg.svg)](https://crates.io/crates/fluent-langneg)\n[![Build Status](https://travis-ci.org/projectfluent/fluent-langneg-rs.svg?branch=master)](https://travis-ci.org/projectfluent/fluent-langneg-rs)\n[![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)\n\nIntroduction\n------------\n\nThis is a Rust implementation of fluent-langneg library which is a part of Project Fluent.\n\nThe library uses [icu-locid](https://github.com/unicode-org/icu4x) to retrieve and operate on Unicode Language and Locale Identifiers.\nThe library provides algorithm for negotiating between lists of locales.\n\nUsage\n-----\n\n```rust\nuse fluent_langneg::negotiate_languages;\nuse fluent_langneg::NegotiationStrategy;\nuse fluent_langneg::convert_vec_str_to_langids_lossy;\nuse fluent_langneg::LanguageIdentifier;\n\n// Since langid parsing from string is fallible, we'll use a helper\n// function which strips any langids that failed to parse.\nlet requested = convert_vec_str_to_langids_lossy(\u0026[\"de-DE\", \"fr-FR\", \"en-US\"]);\nlet available = convert_vec_str_to_langids_lossy(\u0026[\"it\", \"fr\", \"de-AT\", \"fr-CA\", \"en-US\"]);\nlet default: LanguageIdentifier = \"en-US\".parse()\n    .expect(\"Parsing langid failed.\");\n\nlet supported = negotiate_languages(\n  \u0026requested,\n  \u0026available,\n  Some(\u0026default),\n  NegotiationStrategy::Filtering\n);\n\nlet expected = convert_vec_str_to_langids_lossy(\u0026[\"de-AT\", \"fr\", \"fr-CA\", \"en-US\"]);\nassert_eq!(supported,\n            expected.iter().map(|t| t.as_ref()).collect::\u003cVec\u003c\u0026LanguageIdentifier\u003e\u003e());\n```\n\nSee [docs.rs][] for more examples.\n\n[docs.rs]: https://docs.rs/fluent-langneg/\n\nStatus\n------\n\nThe implementation is complete according to fluent-langneg\ncorpus of tests, which means that it parses, serializes and negotiates as expected.\n\nThe negotiation methods can operate on lists of `LanguageIdentifier` or `Locale`.\n\nThe remaining work is on the path to 1.0 is to gain in-field experience of using it,\nadd more tests and ensure that bad input is correctly handled.\n\nCompatibility\n-------------\n\nThe API is based on [UTS 35][] definition of [Unicode Locale Identifier][] and is aiming to\nparse and serialize all locale identifiers according to that definition.\n\n*Note*: Unicode Locale Identifier is similar, but different, from what [BCP47][] specifies under\nthe name Language Tag.\nFor most locale management and negotiation needs, the Unicode Locale Identifier used in this crate is likely a better choice,\nbut in some case, like HTTP Accepted Headers, you may need the complete BCP47 Language Tag implementation which\nthis crate does not provide.\n\nLanguage negotiation algorithms are custom Project Fluent solutions,\nbased on [RFC4647][].\n\nThe language negotiation strategies aim to replicate the best-effort matches with\nthe most limited amount of data. The algorithm returns reasonable\nresults without any database, but the results can be improved with either limited\nor full [CLDR likely-subtags][] database.\n\nThe result is a balance chosen for Project Fluent and may differ from other\nimplementations of language negotiation algorithms which may choose different\ntradeoffs.\n\n[BCP47]: https://tools.ietf.org/html/bcp47\n[RFC6067]: https://www.ietf.org/rfc/rfc6067.txt\n[UTS 35]: http://www.unicode.org/reports/tr35/#Locale_Extension_Key_and_Type_Data\n[RFC4647]: https://tools.ietf.org/html/rfc4647\n[CLDR likely-subtags]: http://www.unicode.org/cldr/charts/latest/supplemental/likely_subtags.html\n[Unicode Locale Identifier]: (http://unicode.org/reports/tr35/#Identifiers)\n\nAlternatives\n------------\n\nAlthough Fluent Locale aims to stay close to W3C Accepted Languages, it does not aim\nto implement the full behavior and some aspects of the language negotiation strategy\nrecommended by W3C, such as weights, are not a target right now.\n\nFor such purposes, [rust-language-tags][] crate seems to be a better choice.\n\n[rust-language-tags]: https://github.com/pyfisch/rust-language-tags\n\nPerformance\n-----------\n\nThe crate is considered to be fully optimized for production.\n\n\nDevelop\n-------\n\n    cargo build\n    cargo test\n    cargo bench\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectfluent%2Ffluent-langneg-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojectfluent%2Ffluent-langneg-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectfluent%2Ffluent-langneg-rs/lists"}