Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand "search non-Japanese characters" to Chinese and Cantonese #1285

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ a.heading-link-light {
:root:not([data-advanced=false]) .basic-only {
display: none;
}
:root:not([data-language=ja]) .japanese-only {
:root:not([data-language=ja]):not([data-language=zh]):not([data-language=yue]) .jpzhyue-only {
display: none;
}
.settings-item.settings-item-button,
Expand Down
2 changes: 1 addition & 1 deletion ext/js/language/translator.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export class Translator {
*/
async _findTermsInternal(text, options, tagAggregator) {
const {removeNonJapaneseCharacters, enabledDictionaryMap} = options;
if (removeNonJapaneseCharacters && options.language === 'ja') {
if (removeNonJapaneseCharacters && (['ja', 'zh', 'yue'].includes(options.language))) {
text = this._getJapaneseOnlyText(text);
Kuuuube marked this conversation as resolved.
Show resolved Hide resolved
}
if (text.length === 0) {
Expand Down
6 changes: 3 additions & 3 deletions ext/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,10 @@ <h1>Yomitan Settings</h1>
<label class="toggle"><input type="checkbox" data-setting="scanning.selectText"><span class="toggle-body"><span class="toggle-track"></span><span class="toggle-knob"></span></span></label>
</div>
</div></div>
<div class="settings-item japanese-only"><div class="settings-item-inner">
<div class="settings-item jpzhyue-only"><div class="settings-item-inner">
<div class="settings-item-left">
<div class="settings-item-label">Search text with non-Japanese characters</div>
<div class="settings-item-description">Only applies when language is set to Japanese.</div>
<div class="settings-item-label">Search text with non-Japanese, Chinese, or Cantonese characters</div>
<div class="settings-item-description">Only applies when language is set to Japanese, Chinese, or Cantonese.</div>
</div>
<div class="settings-item-right">
<label class="toggle"><input type="checkbox" data-setting="scanning.alphanumeric"><span class="toggle-body"><span class="toggle-track"></span><span class="toggle-knob"></span></span></label>
Expand Down
Loading