18 lines
722 B
Python
18 lines
722 B
Python
with open('components/notes-view-toggle.tsx', 'r') as f:
|
|
content = f.read()
|
|
|
|
# Add language to useLanguage()
|
|
content = content.replace(
|
|
'const { t } = useLanguage()',
|
|
'const { t, language } = useLanguage()'
|
|
)
|
|
|
|
# Add dir to div wrapper
|
|
content = content.replace(
|
|
'className={cn(\n \'inline-flex rounded-full border border-border bg-muted/40 p-0.5 shadow-sm\',\n className\n )}',
|
|
'dir={language === \'fa\' || language === \'ar\' ? \'rtl\' : \'ltr\'}\n className={cn(\n \'inline-flex rounded-full border border-border bg-muted/40 p-0.5 shadow-sm\',\n className\n )}'
|
|
)
|
|
|
|
with open('components/notes-view-toggle.tsx', 'w') as f:
|
|
f.write(content)
|