peb
Version:
Peb.js makes JS easier
31 lines (30 loc) • 1.17 kB
Markdown
Version with this added: *2.3.0*
```html
<div>
<peb-trans p-word="generic.example_word" />
</div>
```
```javascript
const t = new peb.TranslationTable({
"en-us": {
"generic.example_word": "Example text"
},
"zh-cn": {
"generic.example_word": "实例文本"
}
});
t.translate("en-us");
```
Example text
| <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/chrome.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/firefox.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/safari.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/opera.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/edge.svg" width="30" /> |
| :---: | :---: | :---: | :---: | :---: | :---: |
| 54 | 63 | 10.1 | 41 | 79 |
`<peb-trans>` used to mark the translation area in the HTML document.
Using this tag, you can quickly use the `peb.translation` function to translate quickly in JavaScript.