Skip to content

Commit 34d5c2c

Browse files
authored
Merge pull request #1333 from pjkaufman/master
Fix Linter Using `null` for Current Language
2 parents f8dbd92 + 6ebd128 commit 34d5c2c

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

package-lock.json

Lines changed: 10 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"eslint-plugin-unicorn": "^51.0.1",
4949
"jest": "^29.3.1",
5050
"moment": "^2.30.1",
51-
"obsidian": "^1.5.7-1",
51+
"obsidian": "^1.8.7",
5252
"postcss": "^8.4.47",
5353
"postcss-cli": "^11.0.0",
5454
"ts-node": "^10.9.2",

src/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {App, Editor, EventRef, MarkdownView, Menu, Notice, Plugin, TAbstractFile, TFile, TFolder, addIcon, htmlToMarkdown, EditorSelection, EditorChange, normalizePath, MarkdownFileInfo, debounce, Debouncer} from 'obsidian';
1+
import {App, Editor, EventRef, MarkdownView, Menu, Notice, Plugin, TAbstractFile, TFile, TFolder, addIcon, htmlToMarkdown, EditorSelection, EditorChange, normalizePath, MarkdownFileInfo, debounce, Debouncer, getLanguage} from 'obsidian';
22
import {Options, RuleType, ruleTypeToRules, rules, sortRules} from './rules';
33
import DiffMatchPatch from 'diff-match-patch';
44
import dedent from 'ts-dedent';
@@ -81,7 +81,7 @@ export default class LinterPlugin extends Plugin {
8181
async onload() {
8282
sortRules();
8383

84-
setLanguage(window.localStorage.getItem('language'));
84+
setLanguage(getLanguage());
8585
logInfo(getTextInLanguage('logs.plugin-load'));
8686

8787
this.isEnabled = true;
@@ -1111,7 +1111,7 @@ export default class LinterPlugin extends Plugin {
11111111
this.settings.settingsConvertedToConfigKeyValues = true;
11121112
await this.saveSettings();
11131113

1114-
setLanguage(window.localStorage.getItem('language'));
1114+
setLanguage(getLanguage());
11151115

11161116
return updateMade;
11171117
}

0 commit comments

Comments
 (0)