Extension icon indicating copy to clipboard operation
Extension copied to clipboard

[Bug] Presences not working when Presence getStrings() non-English localization string

Open Kotoki1337 opened this issue 3 years ago • 2 comments

This issue causes users with non-English browsers to be unable to use most of the Presences that presence.getStrings() non-English strings

Some Presences have solved this issue using .catch fallback to English like:

But some not:

To Reproduce

  1. Change browser language to Chinese Simplified or Chinese Traditional (The choice of language depends on whether the string has been translated or not?)
  2. Install SoundCloud or other Presence that calls getStrings() but does not fallback to English by default
  3. Try to trigger Presence, Presence not working
  4. Switch the browser language back to English
  5. Return to the previous page (Step 3), Presence should be working now.

Solution

Alright, so I know we can don't even bother to use localized strings if it's just paused and playing! But lots of the simple Presence is called localized strings, and if we want to fix them all we must change them all one by one. Extensions should probably fall back to English by themselves if the localization string for the user's browser language does not exist, instead of directly causing Presence to not work

Kotoki1337 avatar Sep 30 '21 09:09 Kotoki1337

Pretty sure it was related to the whole setting being undefined. But that could happen to any browser not depending on language. Didn't know it was an actual thing on Chinese...

Bas950 avatar Sep 30 '21 11:09 Bas950

Pretty sure it was related to the whole setting being undefined. But that could happen to any browser not depending on language. Didn't know it was an actual thing on Chinese...

So I think the extension should return the English string itself when it finds a string that is not defined, at least let Presence working in the situation I'm talking about. There will always have some languages where there are no active translators resulting in the localization string not being defined

Kotoki1337 avatar Sep 30 '21 11:09 Kotoki1337