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

Support indonesian translation in plugin #281

Open
wants to merge 9 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
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
8 changes: 4 additions & 4 deletions docs/about-lisk/bridged-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ If you want to add a token to the list, please check out the guide [Bridging an

## Lisk Mainnet

| Bridged Tokens Mainnet | Symbol | L1 Token | L2 Token |
| :----------------- | :----- |:----------------- | :----------------- |
| Bridged Tokens Mainnet | Symbol | L1 Token | L2 Token | Bridges |
| :--------------------- | :----- |:----------------- | :----------------- | :----- |

## Lisk Sepolia

| Bridged Tokens Sepolia | Symbol | L1 Token | L2 Token |
| :----------------- | :----- |:----------------- | :----------------- |
| Bridged Tokens Sepolia | Symbol | L1 Token | L2 Token | Bridges |
| :--------------------- | :----- |:----------------- | :----------------- | :----- |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Bridges column is empty for Lisk Sepolia. I would either remove this column or add N/A as a value to each row

Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ Jika Anda ingin menambahkan token ke daftar ini, silakan lihat panduan [Bridge T

## Lisk Mainnet

| Bridged Token di Mainnet | Simbol | Token L1 | Token L2 |
| :----------------------- | :----- | :------- | :------- |
| Bridged Token di Mainnet | Simbol | Token L1 | Token L2 | Bridges |
| :----------------------- | :----- | :------- | :------- | :------ |

## Lisk Sepolia

| Bridged Token di Sepolia | Simbol | Token L1 | Token L2 |
| :----------------------- | :----- | :------- | :------- |
| Bridged Token di Sepolia | Simbol | Token L1 | Token L2 | Bridges |
| :----------------------- | :----- | :------- | :------- | :------ |

38 changes: 32 additions & 6 deletions plugins/generated-bridged-token-adresses-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,23 @@ LiskAdresses.forEach(token => {
ethAddress = {address: "Not Found"};
}
token.ethAddress = ethAddress.address;
token.ethBridge = ethAddress.extensions.liskBridgeAddress
});

const tableHeads = {
eng: ["Bridged Tokens Mainnet", "Bridged Tokens Sepolia"],
ind: ["Bridged Token di Mainnet", "Bridged Token di Sepolia"],
}

export const generatedDocs = () => {
return async (root) => {
visit(root, (node) => {
if (node.type !== 'table') {
return
}
visit(root, "table", (node) => {
// For every table in the docs
node.children.forEach(row => {
row.children.forEach(cell => {
cell.children.forEach(cellChild => {
// Find a cell with the value 'Bridged Token Mainnet'
if( cellChild.value === 'Bridged Tokens Mainnet') {
if( cellChild.value === tableHeads.eng[0] || cellChild.value === tableHeads.ind[0]) {
cellChild.value = 'Bridged Token Name';
// Add a new row for each Mainnet token
LiskAdresses.forEach(token => {
Expand Down Expand Up @@ -95,14 +98,37 @@ export const generatedDocs = () => {
type: 'link',
url: "https://blockscout.lisk.com/address/" + token.address,
children: [{type: 'text', value: token.address }]
},
]
},
{
type: 'tableCell',
children: [
{
type: 'link',
url: "https://etherscan.io/address/" + token.ethBridge,
children: [{type: 'text', value: token.ethBridge }]
},
{
type: 'text',
value: '(L1)'
},
{
type: 'link',
url: "https://blockscout.lisk.com/address/" + token.extensions.liskBridgeAddress,
children: [{type: 'text', value: token.extensions.liskBridgeAddress }]
},
{
type: 'text',
value: '(L2)'
}
]
}]
});
}
});
// Find a cell with the value 'Bridged Token Sepolia'
} else if (cellChild.value === 'Bridged Tokens Sepolia') {
} else if (cellChild.value === tableHeads.eng[1] || cellChild.value === tableHeads.ind[1]) {
cellChild.value = 'Bridged Token Name';
// Add a new row for each Sepolia token
LiskAdresses.forEach(token => {
Expand Down