Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!(model): typed locales #2068

Draft
wants to merge 2 commits into
base: zeyla/feat-model-rework-enums
Choose a base branch
from

Commits on Jan 15, 2023

  1. feat!(model): typed locales

    Adds a typed Locale struct with associated constants for all known
    values, replacing the Strings used in the codebase. The Locale type has
    two methods of note: `english_name` and `native_name`.
    
    These values are taken from the Discord documentation:
    <https://discord.com/developers/docs/reference#locales>
    
    This PR is meant to show how the new raw value representation introduced
    in PR #2045 looks when "typing" a value. This was previously left to the
    user to know what localizations might exist and to ensure a typo isn't
    made. This `Locale` type is still functionally a string in all but name
    (literally, as it implements the same traits and derefs in the same way
    String does), but it contains methods and the known values registered by
    Twilight as "sugar" on top of it.
    zeylahellyer committed Jan 15, 2023
    Configuration menu
    Copy the full SHA
    0f8a886 View commit details
    Browse the repository at this point in the history
  2. fixes

    zeylahellyer committed Jan 15, 2023
    Configuration menu
    Copy the full SHA
    de6e109 View commit details
    Browse the repository at this point in the history