diff --git a/CHANGELOG.md b/CHANGELOG.md index 6915078..50c6aae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Fix language settings parsing, by @thebluepotato in [#229](https://github.com/northword/zotero-format-metadata/pull/229). + ## [1.18.6] - 2024-09-15 ### Fixed diff --git a/addon/locale/en-US/preferences.ftl b/addon/locale/en-US/preferences.ftl index 5e4256a..328048c 100644 --- a/addon/locale/en-US/preferences.ftl +++ b/addon/locale/en-US/preferences.ftl @@ -54,7 +54,7 @@ language-fill-option-only-cmn = language-fill-option-only-eng = .label = English (en) language-fill-option-only-other = and: -language-fill-option-only-other-desc = Here you need to enter the ISO 639-1 language code, separated by a semi-colon comma. +language-fill-option-only-other-desc = Enter a comma-separated list of additional ISO 639-1 language codes. language-fill-option-only-other-doc = ISO 639-1 code .href = https://github.com/northword/zotero-format-metadata#readme diff --git a/src/utils/str.ts b/src/utils/str.ts index d5886e8..202174a 100644 --- a/src/utils/str.ts +++ b/src/utils/str.ts @@ -456,8 +456,7 @@ export function getTextLanguage(text: string) { if (getPref("lang.only.cmn")) options.only.push("zh"); if (getPref("lang.only.eng")) options.only.push("en"); const otherLang = getPref("lang.only.other") as string; - if (otherLang !== "" && otherLang !== undefined) - options.only.push.apply(otherLang.replace(/ /g, "").split(",")); + if (otherLang !== "" && otherLang !== undefined) options.only.push(...otherLang.replace(/ /g, "").split(",")); } ztoolkit.log("[lang] Selected ISO 639-1 code is: ", options.only);