Skip to content

Commit

Permalink
fix: added Checkbox to adjustInputElementLabels
Browse files Browse the repository at this point in the history
  • Loading branch information
sahinvardar committed Jun 7, 2023
1 parent 2d8c13d commit df1f057
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vardario/svelte-i18next",
"version": "0.1.5",
"version": "0.1.6",
"description": "",
"license": "MIT",
"author": "Sahin Vardar",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n-preprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function adjustI18nCall(ast: Ast, prefix: string, callIdentifier: string
export function adjustInputElementLabels(ast: Ast, prefix: string, callIdentifier: string = '$i18n') {
compiler.walk(ast.html, {
enter: (node: TemplateNode) => {
if (node.type === 'InlineComponent' && node.name === 'Input') {
if (node.type === 'InlineComponent' && ['Input', 'Checkbox'].includes(node.name)) {
const nameAttribute = node.attributes?.find((attr: any) => attr.name === 'name');
const labelAttribute = node.attributes?.find((attr: any) => attr.name === 'label');

Expand Down

0 comments on commit df1f057

Please sign in to comment.