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

CountrySelector #18035

Merged
merged 11 commits into from
Oct 12, 2023
Merged

CountrySelector #18035

merged 11 commits into from
Oct 12, 2023

Conversation

gjohansson-ST
Copy link
Member

@gjohansson-ST gjohansson-ST commented Sep 26, 2023

Proposed change

Implement CountrySelector

Needs: home-assistant/core#100963
Docs: home-assistant/home-assistant.io#29242

Example:

vol.Optional(CONF_COUNTRY): CountrySelector(
    CountrySelectorConfig(countries=["US", "GB", "DE"], no_sort=True)
)

image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@gjohansson-ST gjohansson-ST marked this pull request as ready for review October 8, 2023 18:05
@bramkragten
Copy link
Member

However if I understand it correctly this does only work with English right now so should we consider to add the users language into this?

The country names should be translated, that is handled by:

Intl.DisplayNames(language, {
  type: "region",
  fallback: "code",
})

@gjohansson-ST
Copy link
Member Author

The country names should be translated, that is handled by:

Intl.DisplayNames(language, {

  type: "region",

  fallback: "code",

})

Right. Didn't actually check, just looked at the language constant.
So this should be good to go.

@gjohansson-ST gjohansson-ST added backend merged The backend PR for this frontend PR has been merged and removed wait for backend labels Oct 12, 2023
@bramkragten bramkragten merged commit 4c94ac5 into home-assistant:dev Oct 12, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend merged The backend PR for this frontend PR has been merged cla-signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants