i18n: add support for rtl
This commit is contained in:
1 parent
37a7218bef
commit
ad3b9e5f36
5 files changed
+23
-3
No files matched your search
@@ -68,7 +68,11 @@
|
|||||||
|
|
||||||
<svelte:window bind:innerWidth={screenWidth} />
|
<svelte:window bind:innerWidth={screenWidth} />
|
||||||
|
|
||||||
<div class="shell {$$props.class}" style={colorsToVars($colors)}>
|
<div
|
||||||
|
{...$$restProps}
|
||||||
|
class="shell {$$props.class}"
|
||||||
|
style={colorsToVars($colors)}
|
||||||
|
>
|
||||||
<slot />
|
<slot />
|
||||||
<div
|
<div
|
||||||
class="
|
class="
|
||||||
|
|||||||
@@ -581,7 +581,11 @@
|
|||||||
"fi": "Finnish",
|
"fi": "Finnish",
|
||||||
"pt": "Portuguese",
|
"pt": "Portuguese",
|
||||||
"auto": "Auto",
|
"auto": "Auto",
|
||||||
"credits": "Credits"
|
"credits": "Credits",
|
||||||
|
"useRtl": {
|
||||||
|
"title": "Use RTL layout",
|
||||||
|
"description": "Use an RTL layout for RTL languages."
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"view": {
|
"view": {
|
||||||
"title": "Post style",
|
"title": "Post style",
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ interface Settings {
|
|||||||
showHidden: boolean
|
showHidden: boolean
|
||||||
}
|
}
|
||||||
language: string | null
|
language: string | null
|
||||||
|
useRtl: boolean
|
||||||
translator: string | undefined
|
translator: string | undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,6 +157,7 @@ export const defaultSettings: Settings = {
|
|||||||
showHidden: false,
|
showHidden: false,
|
||||||
},
|
},
|
||||||
language: env.PUBLIC_LANGUAGE ?? null,
|
language: env.PUBLIC_LANGUAGE ?? null,
|
||||||
|
useRtl: false,
|
||||||
translator: env.PUBLIC_TRANSLATOR ?? undefined,
|
translator: env.PUBLIC_TRANSLATOR ?? undefined,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
import { site } from '$lib/lemmy.js'
|
import { site } from '$lib/lemmy.js'
|
||||||
import ExpandableImage from '$lib/components/ui/ExpandableImage.svelte'
|
import ExpandableImage from '$lib/components/ui/ExpandableImage.svelte'
|
||||||
import { LINKED_INSTANCE_URL } from '$lib/instance'
|
import { LINKED_INSTANCE_URL } from '$lib/instance'
|
||||||
|
import { locale } from '$lib/translations'
|
||||||
|
|
||||||
nProgress.configure({
|
nProgress.configure({
|
||||||
minimum: 0.4,
|
minimum: 0.4,
|
||||||
@@ -105,6 +106,7 @@
|
|||||||
Skip Navigation
|
Skip Navigation
|
||||||
</Button>
|
</Button>
|
||||||
<Shell
|
<Shell
|
||||||
|
dir={$locale == 'he' && $userSettings.useRtl ? 'rtl' : 'ltr'}
|
||||||
class="min-h-screen {$userSettings.font == 'inter'
|
class="min-h-screen {$userSettings.font == 'inter'
|
||||||
? 'font-inter'
|
? 'font-inter'
|
||||||
: $userSettings.font == 'system'
|
: $userSettings.font == 'system'
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
import { DOMAIN_REGEX_FORMS, removeItem } from '$lib/util.js'
|
import { DOMAIN_REGEX_FORMS, removeItem } from '$lib/util.js'
|
||||||
import Section from './Section.svelte'
|
import Section from './Section.svelte'
|
||||||
import ToggleSetting from './ToggleSetting.svelte'
|
import ToggleSetting from './ToggleSetting.svelte'
|
||||||
import { locales, t } from '$lib/translations'
|
import { locale, locales, t } from '$lib/translations'
|
||||||
import { defaultLinks, iconOfLink } from '$lib/components/ui/navbar/link'
|
import { defaultLinks, iconOfLink } from '$lib/components/ui/navbar/link'
|
||||||
|
|
||||||
let pin: string = ''
|
let pin: string = ''
|
||||||
@@ -135,6 +135,7 @@
|
|||||||
</Section>
|
</Section>
|
||||||
|
|
||||||
<Section title={$t('settings.app.title')}>
|
<Section title={$t('settings.app.title')}>
|
||||||
|
<div class="flex flex-col gap-2">
|
||||||
<Setting>
|
<Setting>
|
||||||
<span slot="title" class="inline-flex items-center gap-2">
|
<span slot="title" class="inline-flex items-center gap-2">
|
||||||
{$t('settings.app.lang.title')}
|
{$t('settings.app.lang.title')}
|
||||||
@@ -161,6 +162,13 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</Select>
|
</Select>
|
||||||
</Setting>
|
</Setting>
|
||||||
|
{#if $locale == 'he'}
|
||||||
|
<ToggleSetting
|
||||||
|
bind:checked={$userSettings.useRtl}
|
||||||
|
title={$t('settings.app.lang.useRtl.title')}
|
||||||
|
></ToggleSetting>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
<Setting>
|
<Setting>
|
||||||
<span slot="title">{$t('settings.app.view.title')}</span>
|
<span slot="title">{$t('settings.app.view.title')}</span>
|
||||||
<ViewSelect showLabel={false} />
|
<ViewSelect showLabel={false} />
|
||||||
|
|||||||
Reference in new issue
Block a user