Skip to content

Commit

Permalink
doc: allow for selecting fields language
Browse files Browse the repository at this point in the history
  • Loading branch information
nojhamster committed Jun 7, 2024
1 parent 43f494a commit 487df29
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions doc/src/.vuepress/components/FieldsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
<thead>
<tr>
<th>Code</th>
<th>Description</th>
<th>
Description
<select v-model="lang">
<option value="fr">Fr</option>
<option value="en">En</option>
</select>
</th>
</tr>
</thead>

<tbody>
<tr v-for="row in rows">
<tr v-for="row in localizedRows">
<td>
{{ row.code }}
</td>
Expand All @@ -30,6 +36,22 @@ export default {
type: Array,
default: () => []
}
},
data() {
return {
lang: 'en',
};
},
computed: {
localizedRows() {
return this.rows.map(row => {
return {
...row,
description: this.lang === 'fr' ? row.description : row.description_en,
comment: this.lang === 'fr' ? row.comment : row.comment_en,
};
});
}
}
}
</script>

0 comments on commit 487df29

Please sign in to comment.