khmyznikov / pwa-install

Installation dialog for Progressive Web Application. Provides a more convenient user experience and fixes the lack of native dialogs in some browsers.
https://www.khmyznikov.com/pwa-install
MIT License
308 stars 56 forks source link

Norwegian localization #72

Closed cillian-cwb closed 1 month ago

cillian-cwb commented 1 month ago

Norwegian gets default English. The localization must be 'nb-NO'

khmyznikov commented 1 month ago

No, default Norwegian in Chrome is "no": image

khmyznikov commented 1 month ago

@AdrianAndersen can you help to figure this out?

AdrianAndersen commented 1 month ago

Seems like it is dependent on your device. "no" is just standard Norwegian, while nb-NO (equal to no) and nn-NO (dialectish) are common on many devices. I think that all those three should point to the same locale. (Some Norwegians might argue they want a separate one for nn-NO tho, might be better to cross that bridge later and just set it to one Norwegian language for now)

cillian-cwb commented 1 month ago

Tested with pwa-install demo. well. with Norwegian language chrome iOS (17.5.1) give English. macOS (Sonoma 14.4.1) chrome Norwegian give English. Samsung s8 chrome Norwegian gives English.

Same in Safari iOS.

In my other project I must use nb-NO to get Norwegian. So as Adrian precise, 'nb-NO' should replace 'no'. The nn-NO would need translation first, if implemented as well.

khmyznikov commented 1 month ago

Ok looks like pointing "nb-NO" to "no" is safe and will resolve the problem?

AdrianAndersen commented 1 month ago

Yes, that works for me too

khmyznikov commented 1 month ago

@cillian-cwb check the demo page, fixed the nb lang. (update the page a few times after a moment)

khmyznikov commented 1 month ago

added in 0.4.3

khmyznikov commented 1 month ago

@cillian-cwb can you help me to debug this. Open this page with your devices and copy here the languages lists. https://ariya.io/demo/language

cillian-cwb commented 1 month ago

iPhone NO Your choice of language is Norwegian Bokmål. navigator.language | nb-NO navigator.languages | [nb-NO] navigator.userLanguage | ?

iPhone ES Your choice of language is Spanish. navigator.language | es-ES navigator.languages | [es-ES] navigator.userLanguage | ?

Android NO Your choice of language is Norwegian bokmål. navigator.language | nb-NO navigator.languages | [nb-NO, nb, no, nn, en-US,en] navigator.userLanguage | ?

Edge macOS NO Your choice of language is Norwegian Bokmål. navigator.language | nb navigator.languages | [nb, en] navigator.userLanguage | ?

Chrome macOS NO Your choice of language is Norwegian Bokmål. navigator.language | nb navigator.languages | [nb] navigator.userLanguage | ?

Safari macOS EN Your choice of language is English. navigator.language | en-GB navigator.languages | [en-GB] navigator.userLanguage | ?

DuckDuckGO macOS EN Your choice of language is English. navigator.language | en-GB navigator.languages | [en-GB] navigator.userLanguage | ?

khmyznikov commented 1 month ago

Fixed