@dune2/tools 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dune2/tools",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "i18n"
@@ -157,7 +157,13 @@ export class DuneI18n {
157
157
  this.emit("localeChange", combinedLocale);
158
158
  // 默认需要 同步到 localStorage
159
159
  if (syncToStorage) {
160
- localStorage.setItem(this.config.storageKey, combinedLocale);
160
+ //https://www.chromium.org/for-testers/bug-reporting-guidelines/uncaught-securityerror-failed-to-read-the-localstorage-property-from-window-access-is-denied-for-this-document/
161
+ //fix: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
162
+ try {
163
+ localStorage.setItem(this.config.storageKey, combinedLocale);
164
+ } catch (error) {
165
+ console.error("set localStorage error", error);
166
+ }
161
167
  }
162
168
  };
163
169
 
package/src/i18n/enums.ts CHANGED
@@ -19,4 +19,6 @@ export enum LocalesEnum {
19
19
  ja = "ja",
20
20
  // 土耳其 Turkish
21
21
  tr = "tr",
22
+ // 韩国 Korean
23
+ ko = "ko",
22
24
  }