windingwind / zotero-better-notes

Everything about note management. All in Zotero.
GNU Affero General Public License v3.0
5.57k stars 188 forks source link

[Bug] Better Notes is talking half Russian to me #1094

Closed georgd closed 3 months ago

georgd commented 3 months ago

Is there an existing issue for this?

Are you using the latest Zotero and the latest plugin?

Environment

Describe the bug

My Zotero localization is set to "Automatisch (Deutsch)" which translates to "Automatic (German)". Better Notes unluckily displays some texts in Russian instead of English as a fallback, as in these screenshots:

image image

This doesn’t happen if I set the Zotero localization explicitly to "German" or "English": In either case, all texts are in English.

Debug Output

1724428957200 addons.xpi WARN Checking /Applications/Zotero 7.app/Contents/Resources/distribution/extensions for addons

1724428957895 addons.xpi WARN Addon with ID undefined already installed, older version will be disabled

[JavaScript Error: "Error: Addon must include an id, version, and type" {file: "resource://gre/modules/addons/XPIProvider.jsm" line: 1723}]

[JavaScript Error: "Error: Addon must include an id, version, and type" {file: "resource://gre/modules/addons/XPIProvider.jsm" line: 1723}]

[JavaScript Error: "Security Error: Content at moz-nullprincipal:{19fd610a-c91b-496c-a0a2-63690d3589d1} may not load or link to chrome://betternotes/content/treeView.html."]

[JavaScript Error: "Passing a URI to Zotero.File.getContentsAsync() is deprecated -- use Zotero.HTTP.request() instead"]

[JavaScript Error: "Passing a URI to Zotero.File.getContentsAsync() is deprecated -- use Zotero.HTTP.request() instead"]

[JavaScript Error: "TypeError: this.editorView is undefined" {file: "resource://zotero/note-editor/editor.js" line: 6}]

appName => Zotero, version => 7.0.2 (ARM64), os => macOS 14.6.1, locale => de, extensions => Better Notes for Zotero (2.0.2, extension), Better BibTex for Zotero (6.7.222, extension, disabled), Scite Zotero Plugin (V7+) (2.0.2, extension, disabled), DOI Manager (1.5.0, extension, disabled), MarkDB-Connect (0.1.1, extension, disabled), Zotero Attanger (1.2.4, extension, disabled), Zoplicate (3.0.3, extension, disabled)

(4)(+0010642): SELECT COUNT(*) FROM settings WHERE setting='mImport' AND key='cleanup'

(3)(+0006297): [Better Notes for Zotero] {}

(3)(+0000000): [Better Notes for Zotero] push blockquote

["blockquote"]

(3)(+0000001): [Better Notes for Zotero] pop blockquote

[]

(3)(+0000000): [Better Notes for Zotero] push ul

[]

(3)(+0000000): [Better Notes for Zotero] push ul

[]

(3)(+0000000): [Better Notes for Zotero] push ul

[]

(3)(+0000001): [Better Notes for Zotero] [Warning] Creating element button with no namespace specified. Found multiply namespace matches.

(3)(+0000000): [Better Notes for Zotero] [Warning] Creating element button with no namespace specified. Found multiply namespace matches.

(3)(+0000000): [Better Notes for Zotero] [Warning] Creating element button with no namespace specified. Found multiply namespace matches.

(3)(+0000000): [Better Notes for Zotero] [Warning] Creating element button with no namespace specified. Found multiply namespace matches.

(3)(+0000000): [Better Notes for Zotero] [Warning] Creating element button with no namespace specified. Found multiply namespace matches.

(3)(+0000000): [Better Notes for Zotero] [Warning] Creating element button with no namespace specified. Found multiply namespace matches.

(3)(+0000000): [Better Notes for Zotero] [Warning] Creating element button with no namespace specified. Found multiply namespace matches.

(3)(+0000001): [Better Notes for Zotero] [Warning] Creating element button with no namespace specified. Found multiply namespace matches.

(3)(+0000000): [Better Notes for Zotero] [Warning] Creating element button with no namespace specified. Found multiply namespace matches.

Anything else?

No response

windingwind commented 3 months ago

Thanks for the report.

It doesn't make sense, probably bug with Zotero. I'll see what I can do.

AbeJellinek commented 3 months ago

@georgd: Could you open Tools -> Developer -> Run JavaScript, paste in Services.locale, press Run, and post the full output here?

AbeJellinek commented 3 months ago

(With the language set to Automatisch (Deutsch), that is)

georgd commented 3 months ago

@AbeJellinek This is the output:

{
    "negotiateLanguages": function negotiateLanguages() { [native code] }
    "requestedLocales": [
        "0": "de-AT"
        "1": "ru-AT"
    ]
    "langNegStrategyMatching": 1
    "appLocaleAsBCP47": "de"
    "appLocalesAsBCP47": [
        "0": "de"
        "1": "ru-RU"
        "2": "en-US"
    ]
    "requestedLocale": "de-AT"
    "availableLocales": [
        "0": "eu-ES"
        "1": "sr-RS"
        "2": "ca-AD"
        "3": "fi-FI"
        "4": "en-AU"
        "5": "el-GR"
        "6": "fr-FR"
        "7": "hu-HU"
        "8": "nl-NL"
        "9": "bg-BG"
        "10": "ta"
        "11": "ru-RU"
        "12": "ro-RO"
        "13": "de"
        "14": "id-ID"
        "15": "ko-KR"
        "16": "lt-LT"
        "17": "it-IT"
        "18": "et-EE"
        "19": "ja-JP"
        "20": "pt-BR"
        "21": "sk-SK"
        "22": "pl-PL"
        "23": "th-TH"
        "24": "cs-CZ"
        "25": "is-IS"
        "26": "uk-UA"
        "27": "zh-TW"
        "28": "es-ES"
        "29": "nb-NO"
        "30": "fa"
        "31": "zh-CN"
        "32": "km"
        "33": "da-DK"
        "34": "br"
        "35": "sv-SE"
        "36": "ar"
        "37": "en-CA"
        "38": "tr-TR"
        "39": "gl-ES"
        "40": "en-GB"
        "41": "en-US"
        "42": "en-NZ"
        "43": "sl-SI"
        "44": "vi-VN"
        "45": "pt-PT"
    ]
    "QueryInterface": function QueryInterface() { [native code] }
    "defaultLocale": "en-US"
    "lastFallbackLocale": "en-US"
    "appLocalesAsLangTags": [
        "0": "de"
        "1": "ru-RU"
        "2": "en-US"
    ]
    "regionalPrefsLocales": [
        "0": "de-AT"
        "1": "ru-AT"
    ]
    "webExposedLocales": [
        "0": "de-AT"
        "1": "ru-AT"
    ]
    "appLocaleAsLangTag": "de"
    "isAppLocaleRTL": false
    "packagedLocales": [
        "0": "en-US"
        "1": "ar"
        "2": "bg-BG"
        "3": "br"
        "4": "ca-AD"
        "5": "cs-CZ"
        "6": "da-DK"
        "7": "de"
        "8": "el-GR"
        "9": "en-AU"
        "10": "en-CA"
        "11": "en-GB"
        "12": "en-NZ"
        "13": "es-ES"
        "14": "et-EE"
        "15": "eu-ES"
        "16": "fa"
        "17": "fi-FI"
        "18": "fr-FR"
        "19": "gl-ES"
        "20": "hu-HU"
        "21": "id-ID"
        "22": "is-IS"
        "23": "it-IT"
        "24": "ja-JP"
        "25": "km"
        "26": "ko-KR"
        "27": "lt-LT"
        "28": "nb-NO"
        "29": "nl-NL"
        "30": "pl-PL"
        "31": "pt-BR"
        "32": "pt-PT"
        "33": "ro-RO"
        "34": "ru-RU"
        "35": "sk-SK"
        "36": "sl-SI"
        "37": "sr-RS"
        "38": "sv-SE"
        "39": "ta"
        "40": "th-TH"
        "41": "tr-TR"
        "42": "uk-UA"
        "43": "vi-VN"
        "44": "zh-CN"
        "45": "zh-TW"
    ]
    "langNegStrategyFiltering": 0
    "langNegStrategyLookup": 2
}
AbeJellinek commented 3 months ago

Is it possible that you have a Russian language pack or keyboard installed on your computer? (System Settings -> Language and Region -> Preferred Languages; System Settings -> Keyboard -> Language input methods.)

If you add English above Russian under Preferred Languages, this will likely be fixed.

georgd commented 3 months ago

I just realized: Zotero seems to evaluate which keyboard layouts I have activated in MacOS. As I added Arabic just now, "requestedLocales" now reads:

"requestedLocales": [
        "0": "de-AT"
        "1": "ru-AT"
        "2": "ar-AT"
    ]
AbeJellinek commented 3 months ago

It's Preferred Languages, not keyboards, but adding a keyboard also adds an entry to Preferred Languages automatically. You can delete Russian from Preferred Languages, or add English above it, without affecting your keyboards.

AbeJellinek commented 3 months ago

(So basically I would say this is not a bug - your system is asking for Russian, Zotero is displaying Russian.)

georgd commented 3 months ago

It's Preferred Languages, not keyboards, but adding a keyboard also adds an entry to Preferred Languages automatically. You can delete Russian from Preferred Languages, or add English above it, without affecting your keyboards.

Oh, that’s nice. I just wanted to write that adding the English keyboard layout was a workaround rather than a fix. But removing the language from the preferred languages list is fine for me. Thanks!

georgd commented 3 months ago

It's Preferred Languages, not keyboards, but adding a keyboard also adds an entry to Preferred Languages automatically. You can delete Russian from Preferred Languages, or add English above it, without affecting your keyboards.

Oh, that’s nice. I just wanted to write that adding the English keyboard layout was a workaround rather than a fix. But removing the language from the preferred languages list is fine for me. Thanks!

Or even better, thoroughly curate the list of preferred languages of which I haven't known until now :)

georgd commented 3 months ago

@windingwind Now, the issue is gone. Definitely not the plugin’s fault but as @AbeJellinek says rather desired behaviour.

yringot commented 2 months ago

My 2cts: It's definitly unexpected behavior IMO. I opened Zotero after not having used it in a while, found that Zotero and BN had been updated and found myself staring at the BN "introduction" (not sure how the series of small dialogs informing about BN's various functions is called) in Chinese, instead of my Windows' native German locale or even English.

For what it's worth, this is output from Services.locale :

 {
    "negotiateLanguages": function negotiateLanguages() { [native code] }
    "requestedLocales": [
        "0": "de-DE"
        "1": "zh-Hans-CN"
    ]
    "langNegStrategyMatching": 1
    "appLocaleAsBCP47": "de"
    "requestedLocale": "de-DE"
    "availableLocales": [
        "0": "nl-NL"
        "1": "ro-RO"
        "2": "sl-SI"
        "3": "zh-TW"
        "4": "tr-TR"
        "5": "pt-BR"
        "6": "pl-PL"
        "7": "et-EE"
        "8": "en-US"
        "9": "eu-ES"
        "10": "en-AU"
        "11": "en-NZ"
        "12": "ar"
        "13": "ja-JP"
        "14": "sr-RS"
        "15": "es-ES"
        "16": "th-TH"
        "17": "vi-VN"
        "18": "ta"
        "19": "cs-CZ"
        "20": "da-DK"
        "21": "ca-AD"
        "22": "fa"
        "23": "en-GB"
        "24": "fr-FR"
        "25": "bg-BG"
        "26": "de"
        "27": "id-ID"
        "28": "sk-SK"
        "29": "hu-HU"
        "30": "sv-SE"
        "31": "fi-FI"
        "32": "gl-ES"
        "33": "it-IT"
        "34": "en-CA"
        "35": "br"
        "36": "is-IS"
        "37": "el-GR"
        "38": "km"
        "39": "pt-PT"
        "40": "uk-UA"
        "41": "ko-KR"
        "42": "zh-CN"
        "43": "lt-LT"
        "44": "ru-RU"
        "45": "nb-NO"
    ]
    "appLocalesAsBCP47": [
        "0": "de"
        "1": "zh-CN"
        "2": "zh-TW"
        "3": "en-US"
    ]
    "QueryInterface": function QueryInterface() { [native code] }
    "defaultLocale": "en-US"
    "lastFallbackLocale": "en-US"
    "appLocalesAsLangTags": [
        "0": "de"
        "1": "zh-CN"
        "2": "zh-TW"
        "3": "en-US"
    ]
    "regionalPrefsLocales": [
        "0": "de-DE"
    ]
    "webExposedLocales": [
        "0": "de-DE"
    ]
    "appLocaleAsLangTag": "de"
    "isAppLocaleRTL": false
    "packagedLocales": [
        "0": "en-US"
        "1": "ar"
        "2": "bg-BG"
        "3": "br"
        "4": "ca-AD"
        "5": "cs-CZ"
        "6": "da-DK"
        "7": "de"
        "8": "el-GR"
        "9": "en-AU"
        "10": "en-CA"
        "11": "en-GB"
        "12": "en-NZ"
        "13": "es-ES"
        "14": "et-EE"
        "15": "eu-ES"
        "16": "fa"
        "17": "fi-FI"
        "18": "fr-FR"
        "19": "gl-ES"
        "20": "hu-HU"
        "21": "id-ID"
        "22": "is-IS"
        "23": "it-IT"
        "24": "ja-JP"
        "25": "km"
        "26": "ko-KR"
        "27": "lt-LT"
        "28": "nb-NO"
        "29": "nl-NL"
        "30": "pl-PL"
        "31": "pt-BR"
        "32": "pt-PT"
        "33": "ro-RO"
        "34": "ru-RU"
        "35": "sk-SK"
        "36": "sl-SI"
        "37": "sr-RS"
        "38": "sv-SE"
        "39": "ta"
        "40": "th-TH"
        "41": "tr-TR"
        "42": "uk-UA"
        "43": "vi-VN"
        "44": "zh-CN"
        "45": "zh-TW"
    ]
    "langNegStrategyFiltering": 0
    "langNegStrategyLookup": 2
}

My Zotero language was set to Automatic and I have have a Chinese IME installed. But to conclude from that that BN should be in Chinese is unexpected in my opinion and definitely a turn-off for people trying out the plugin IMO.

AbeJellinek commented 2 months ago

Are you sure Chinese isn’t in your list of “Preferred languages” in Windows Settings?

This is tricky (from the Zotero side, not just for BN) because we do want to believe what the system tells us. If you’ve added Chinese as a preferred language but not English, why would we show you English? But on the other hand, very few users manually adjust the ordering of that list, and the OS adds preferred languages when keyboards are installed, which isn’t obvious behavior.

yringot commented 2 months ago

Are you sure Chinese isn’t in your list of “Preferred languages” in Windows Settings? Probably, as I installed the Chinese keyboard. At least it is this way on my private PC.

On Windows there's the "Windows display language" setting. Why does it not use this? This seems the most sensible choice when the Zotero language is set to automatic. E.g. just because from time to time I like to write in language XYZ, does not mean at all that I want my apps to be automatically displayed in that language.

AbeJellinek commented 2 months ago

Your Windows display language is German, which this plugin doesn't have localizations for. It falls back to one of your other preferred languages. English isn't one of your preferred languages, so it won't fall back to English unless none of your preferred languages are supported. Chinese is one of your preferred languages, so it uses that.

You can remove languages from the preferred languages list without removing any IMEs. It's annoying that Windows (and macOS) automatically add languages to the preferred languages list when you add an IME, but we have no control over that.

I'm not totally sure why the behavior is different when the Zotero language is set manually, though. Could you set Zotero to German manually (instead of Automatic (German)) and paste the Services.locale output again?