1Password / sys-locale

A small and lightweight Rust library to obtain the active locale on the system.
Apache License 2.0
75 stars 15 forks source link

Added POSIX modifiers support for BCP47 conversion #33

Open pasabanov opened 15 hours ago

pasabanov commented 15 hours ago

Partially resolves #32.

  1. Renamed function parse_locale_code to posix_to_bcp47.
  2. Changed return type from Option<String> to String.
  3. Changed locale cropping to trim at the first occurrence of either dot (.) or at sign (@), removing any modifiers.
  4. Added tests for modifier cropping.
  5. Added doc comment for posix_to_bcp47.

Possible further optimizations: