fishjar / kiss-rules

Ingest and generate subscription rules for [KISS-Translator]. 收录并生成用于 [KISS-Translator] 的订阅规则。
MIT License
25 stars 11 forks source link

建议添加jointjs的规则&规则选择失败的问题 #36

Closed KazeLiu closed 8 months ago

KazeLiu commented 8 months ago

这是我设置的规则。

{
    "pattern": "*.jointjs.com/*",
    "selector": ":is(li, p, h1, h2, h3, h4, h5, h6, dd, blockquote,td,tr)",
    "keepSelector": "code, img, svg,.docs-nav-items *",
    "terms": "",
    "translator": "Microsoft",
    "fromLang": "auto",
    "toLang": "zh-CN",
    "textStyle": "style_none",
    "transOpen": "true",
    "bgColor": "",
    "textDiyStyle": ""
  }

但是有个问题,我不知道怎么处理 image 我在selector里面写了td,但是这个处于td下面的内容没有被翻译(大部分都被翻译了),怀疑是这个td里面的文字包含了其他的标签导致不翻译,我不知道这个规则如何写。 html贴在下面了

<td>
            Callback function that is expected to return an array of minimal constraint points (in the form: <code class="highlighted"><span class="token punctuation">{</span> <span class="token literal-property property">x</span><span class="token operator">:</span> number<span class="token punctuation">,</span> <span class="token literal-property property">y</span><span class="token operator">:</span> number <span class="token punctuation">}</span></code>), relative to the paper.
            Minimal constraint points are points that should always be kept <b>inside</b> selected lane when resizing.
            If this option is left undefined, the default <code class="highlighted">minSizeConstraints</code> function is used instead
            which creates those points automatically from embedded shapes.
            Callback is called each time a handle starts to be dragged, the arguments passed are:
            <br>
            <br>
            <table>
                <tbody><tr style="-webkit-line-clamp: unset; max-height: none; height: auto;">
                    <td style="-webkit-line-clamp: unset; max-height: none; height: auto;">model<kiss-translator style="visibility: visible;"> <span>型</span></kiss-translator></td>
                    <td style="-webkit-line-clamp: unset; max-height: none; height: auto;"><i>dia.Element</i><kiss-translator style="visibility: visible;"> <span>日。元素</span></kiss-translator></td>
                    <td style="-webkit-line-clamp: unset; max-height: none; height: auto;">Pool shape that the tool was added to.<kiss-translator style="visibility: visible;"><br><span>将工具添加到的池形状。</span></kiss-translator></td>
                </tr>
                <tr style="-webkit-line-clamp: unset; max-height: none; height: auto;">
                    <td style="-webkit-line-clamp: unset; max-height: none; height: auto;">laneId<kiss-translator style="visibility: visible;"> <span>通道 ID</span></kiss-translator></td>
                    <td style="-webkit-line-clamp: unset; max-height: none; height: auto;"><i>string</i><kiss-translator style="visibility: visible;"> <span>字符串</span></kiss-translator></td>
                    <td style="-webkit-line-clamp: unset; max-height: none; height: auto;">Id of the lane that the tool was initialized with.<kiss-translator style="visibility: visible;"><br><span>初始化工具时使用的通道的 ID。</span></kiss-translator></td>
                </tr>
                <tr style="-webkit-line-clamp: unset; max-height: none; height: auto;">
                    <td style="-webkit-line-clamp: unset; max-height: none; height: auto;">handleSide<kiss-translator style="visibility: visible;"> <span>handleSide(手柄侧)</span></kiss-translator></td>
                    <td style="-webkit-line-clamp: unset; max-height: none; height: auto;"><i>"left" | "top" | "right" | "bottom"</i><kiss-translator style="visibility: visible;"><br><span>“左” |“顶部” |“对” |“底部”</span></kiss-translator></td>
                    <td style="-webkit-line-clamp: unset; max-height: none; height: auto;">Position of the dragged handle (relative to the lane).<kiss-translator style="visibility: visible;"><br><span>拖动手柄的位置(相对于车道)。</span></kiss-translator></td>
                </tr>
            </tbody></table>
        </td>
fishjar commented 8 months ago

原因是td里面嵌套了td,只会翻译最里层的。

这种情况,我建议用划词翻译临时解决比较简单。

当然,你这个例子也可以加个brwebfix来解决。

KazeLiu commented 8 months ago

原因是td里面嵌套了td,只会翻译最里层的。

这种情况,我建议用划词翻译临时解决比较简单。

当然,你这个例子也可以加个brwebfix来解决。

不好意思,我没有理解您的意思,我不知道你说的加个br是啥意思,它应该怎么加? 能否直接把选择器的代码交给我。 这个测试页面的网址是 https://resources.jointjs.com/docs/rappid/v4.0/elementTools.SwimlaneTransform.html

fishjar commented 8 months ago

参考设置:

Screenshot from 2024-03-05 14-52-17

Screenshot from 2024-03-05 14-52-36

效果:

Screenshot from 2024-03-05 14-52-53

KazeLiu commented 8 months ago

参考设置:

Screenshot from 2024-03-05 14-52-17

Screenshot from 2024-03-05 14-52-36

效果:

Screenshot from 2024-03-05 14-52-53

谢谢