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

希望能实现调整各种列表匹配顺序的功能 #1527

Open
king0billy opened this issue Mar 12, 2024 · 4 comments
Open

希望能实现调整各种列表匹配顺序的功能 #1527

king0billy opened this issue Mar 12, 2024 · 4 comments
Labels
enhancement New update or improvement request

Comments

@king0billy
Copy link

king0billy commented Mar 12, 2024

您希望的更新和改进是什么 | Update or Improve

多个译文显示样式的URL匹配规则是怎样的? 有类似路由表的按顺序匹配效果吗

比如我希望https://app.immersivetranslate.com/html/* 下的译文样式为 【无】
希望其他https:// 网站的译文样式都为 【模糊效果】该如何实现?

补充说明 | Additional context

在Edit Full User Config里面修改了样式的先后顺序,无法实现上述效果。sync storage object里面的先后顺序和修改前一样没变化

似乎保存后会自动按照首字母顺序排序,有什么办法可以改变吗

"mask": {
      "matches": [
        "http://*",
        "https://*",
        "sfasasklfa"
      ]
    },
    "none": {
      "matches": [
        "https://app.immersivetranslate.com/*"
      ],
      "zoom": "75"
    },
    "opacity": {
      "matches": [
        "C:/"
      ]
    }
  },
@king0billy king0billy added the enhancement New update or improvement request label Mar 12, 2024
@flamintune
Copy link
Collaborator

flamintune commented Mar 12, 2024

参考指南 https://immersivetranslate.com/docs/advanced/#user-config ,打开 Edit Full User Config 中设置,下面提供一个参考示例

"translationTheme":"mask"
"translationThemePatterns": {
    "none": {
      "matches": [
        "https://app.immersivetranslate.com/*"
      ]
    }
  },

@king0billy
Copy link
Author

king0billy commented Mar 12, 2024

参考指南 https://immersivetranslate.com/docs/advanced/#user-config ,打开 Edit Full User Config 中设置,下面提供一个参考示例

"translationTheme":"mask"
"translationThemePatterns": {
    "none": {
      "matches": [
        "https://app.immersivetranslate.com/*"
      ]
    }
  },

看过了,我想实现的这样的顺序实现不了,每次保存完就会自动按首字母顺序排序。我希望none的优先级最高

"none": {
   "matches": [
     "https://app.immersivetranslate.com/*"
   ],
   "zoom": "75"
 },
 "opacity": {
   "matches": [
     "C:/"
   ]
 },
"mask": {
   "matches": [
     "http://*",
     "https://*",
     "sfasasklfa"
   ]
 }
},

@king0billy
Copy link
Author

king0billy commented Mar 12, 2024

发现一个折中的解决办法,下拉框 选 译文显示样式 为模糊(学习模式)然后只设置例外的theme,例外的theme里的清单会优先按照首字母顺序匹配,没在例外匹配的默认按照下拉框选择的样式展示。 但是还是希望能实现调整样式列表匹配顺序的功能

 "translationStartMode": "dynamic",
  "translationTheme": "mask",
  "translationThemePatterns": {
    "none": {
      "matches": [
        "https://app.immersivetranslate.com/*"
      ],
      "zoom": "75"
    },
    "opacity": {
      "matches": [
        "C:/"
      ]
    }
  },

@king0billy king0billy changed the title 多个译文显示样式的URL匹配规则是怎样的?通配符或者匹配规则重叠了用户能调整优先级吗 希望能实现调整各种列表匹配顺序的功能 Mar 12, 2024
@keyboard3
Copy link
Contributor

因为json结构在Js序列化成对象无法保证枚举顺序,要想实现这个需求,得新增个新增字段来支撑这个需求。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New update or improvement request
Projects
None yet
Development

No branches or pull requests

3 participants