Skip to content

Commit b08ae93

Browse files
authored
raidemulator: fix inconsistent ParserLanguage (#920)
`ParserLanguage` should depend on the result of `browserLanguagesToLang` when the user is **not** connected to WebSocket. Feature initially implemented in quisquous#2970. Changes in quisquous#3029 set the default behavior to `en`, making the `if (enc.language)` condition always evaluate to `true`. --- [ui\raidboss\emulator\data\Encounter.ts#L46](https://github.com/OverlayPlugin/cactbot/blob/main/ui/raidboss/emulator/data/Encounter.ts#L46) ```typescript language: Lang = 'en'; // ← this ``` --- Not sure about potential side effects; would appreciate a review from @valarnin. --- **Added**: This also fixes an issue where `setCurrent` incorrectly calls `setParserLanguage("en")` when `enc.language` is not defined within the log segment.
1 parent 7df3065 commit b08ae93

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ui/raidboss/emulator/data/RaidEmulator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default class RaidEmulator extends EventBus {
3535
): void {
3636
// If language was autodetected from the encounter, set the current ParserLanguage
3737
// appropriately
38-
if (enc.language) {
38+
if (enc.language !== 'en') {
3939
this.options.ParserLanguage = enc.language;
4040
this.popupText?.setParserLanguage(enc.language);
4141
}

0 commit comments

Comments
 (0)