Skip to content
This repository has been archived by the owner on Mar 13, 2022. It is now read-only.

feat: Use current navigator language or fallback to en-US. Closes #153 #163

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

MatthewSH
Copy link

@MatthewSH MatthewSH commented Aug 23, 2021

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

The PR fulfills these requirements:

  • It's submitted to the dev branch and not the master branch
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix: #xxx[,#xxx], where "xxx" is the issue number)
  • It's been tested with all Quasar themes
  • It's been tested on a Cordova (iOS, Android) app
  • It's been tested on a Electron app
  • Any necessary documentation has been added or updated in the docs (for faster update click on "Suggest an edit on GitHub" at bottom of page) or explained in the PR's description.

Other information:
Original PR by tomers in #152. No updates have been made, forked it myself and added their changes to both js and ts files to support both templates. Co-authored tomers in the commit.
Based off of current dev and made changes based on feedback in original PR.

Still would like feedback regarding my comment here: #152 (comment)

However, here's something else. If we wanted to support auto-detection of the locale through navigator, couldn't we opt for possibly something like this?

locale: navigator.languages[0] || navigator.language || 'en-us'

Languages will return an array of preferred languages if I can recall correctly and the navigator.language comes from that. I don't know, may not be worth the extra effort because, although it's widely supported in current browser versions, it [navigator.languages] may still be marked as experimental.

I can add this still, however, since Quasar is promoting stability out of the box it may not be a good idea to implement an "experimental" feature even though it's widely supported across 3 major browsers (Edge, Chrome, Firefox) in the current versions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant