Closed hennedo closed 2 years ago
Hello!
Tank you for your issue.
Yes, probably the locale parser does not have data for the de locale code, i will investigate this problem.
Probably is the case to set the db column nullable, in order to avoid future exceptions.
Hello,
Please upgrade the api module to the 1.0.2 version.
I've implemented a bugfix.
Let me know if now it works.
Hi @hennedo, any news?
Sorry for replying late, I will have time on sunday to check if it's working :)
Hello @hennedo, any news?
Hey! It is working now as expected, with correct locale string like "en-CA" it shows up correct as English in Canada, with "de" it shows up as #ND. So data is collected and aurora works now as intended even with language tags that are not complete.
Reason for the delay is that I dug a little deeper to understand the core problem and that I wanted to present a solution better than "#ND". Sadly it's not that easy. The library is absolute correctly returning a null location, because there is no location Information in the tag "de". After some digging my first idea was just to check if there is a dash in the location tag and if not, simply extend the tag to tag = tag + '-' + tag
. But this works only for 28 languages out of 229 which have a tag without dash. Although it would propably approximate a bit better than #ND..
On the other hand, the preferred browsing language is also just an approximation for the location, as a e.g. a German living in Canada might still prefer browsing in native language. Something like geolocation by IP might be more accurate but also uses more private data, which is propably not the goal of this project..
If you'd like me to make a PR for the tag = tag + '-' + tag
(with check if it exists and so on), just hit me up
Thanks for the hotfix!
Thank you,
Ideally, your idea is good, as you said, it works only in 28 languages but is a bit better improvements, so for me, the PR is ok.
A question about that: do you know the reason why some browsers show the 'non dashed' locale?
Another idea in my opinion is to replace #ND (which is pretty bad) with something like 'others', which I think is a more clean way. The problem, in this case, is that the 'other' keyword could be misunderstood with the group of all the minor locale cases, so maybe isn't the correct way to display the label.
What do you think about it?
Thank you!
Closed due to API changing.
Hey!
I'm using Firefox 89.0.2 on MacOS Everything worked fine while my language setting was set to "English (Canada)"
navigator.language === "en-CA"
When I set my language to "German" which correspondents tonavigator.language === "de"
it stopped working.It's the https://auroraapi.example.com/v2/collect call that fails
Request body was
My guess would be, that the language parser does not like "de" and wants "de-DE"?