-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add Get Current Address App #3761
base: master
Are you sure you want to change the base?
Conversation
Initial commit, v0.1
add app image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice idea! Just one comment about localisation
apps/getaddr/getaddr.app.js
Outdated
function getStreetAndHouseNumber(lat, lon) { | ||
const url = `${nominatimApi}/reverse`; | ||
const paramsStr = Object.keys(params).map(key => `${key}=${encodeURIComponent(params[key])}`).join('&'); | ||
const fullUrl = `${url}?${paramsStr}&lat=${lat}&lon=${lon}&accept-language=de&format=json`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we configure this based on the user's language?
const fullUrl = `${url}?${paramsStr}&lat=${lat}&lon=${lon}&accept-language=de&format=json`; | |
const fullUrl = `${url}?${paramsStr}&lat=${lat}&lon=${lon}&accept-language=${lang}&format=json`; |
@gfwilliams do we have a way of getting the language name from locale? I can't find any atm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about
>require("locale").name # "de_DE"
const lang = require("locale").name.substring(0, 2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the PR with your suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow I didn't spot name
- nice.
One thing to note is that the default might be "system"
, perhaps we detect that and fallback to a default such as "de"
or "en"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I have updated the PR.
Dynamically get device language
Add fallback for "system" language
Add the "Get Current Address App"
It uses the GPS and compass capabilities of the Bangle.js 2 watch to display your current location and direction.