Open omar2205 opened 1 year ago
we don't add a dir prop to the HTML element.
dir
In
https://github.com/CodingGarden/listd/blob/main/src/app.html#L2
- <html lang="%lang%"> + <html lang="%lang%" dir="%dir%">
https://github.com/CodingGarden/listd/blob/main/src/hooks.server.ts#L25
- return resolve(event, { transformPageChunk: ({ html }) => html.replace('%lang%', locale) }); + const direction = (new Intl.Locale(locale)).textInfo.direction + return resolve(event, { transformPageChunk: ({ html }) => html.replace('%lang%', locale).replace('%dir%', direction) });
Intl.Locale ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale
I changed app.d.ts file content and seems it works correctly.
declare global { namespace App { // old stuff } namespace Intl { interface Locale { textInfo: { direction: 'rtl' | 'lrt'; }; } } }
Describe the problem
we don't add a
dir
prop to the HTML element.Describe the proposed solution
In
https://github.com/CodingGarden/listd/blob/main/src/app.html#L2
https://github.com/CodingGarden/listd/blob/main/src/hooks.server.ts#L25
Intl.Locale ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale
Have you checked if this issue has already been raised?
Code of Conduct