ui: set RTL on some languages

checking with a list I found online. need to set some things as forced
ltr, such as settings. For #450.
This commit is contained in:
Harvey Tindall
2025-12-07 20:38:43 +00:00
parent 12827f6c84
commit 99c6559a54
10 changed files with 12 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ .shortLang }}" class="{{ .cssClass }}">
<html lang="{{ .shortLang }}" dir="{{ .pageDirection }}" class="{{ .cssClass }}">
<head>
<title>404 - jfa-go</title>
{{ template "header.html" . }}

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ .shortLang }}" class="{{ .cssClass }}">
<html lang="{{ .shortLang }}" dir="{{ .pageDirection }}" class="{{ .cssClass }}">
<head>
{{ template "syntaxhighlighting.html" . }}
<script>

View File

@@ -1,5 +1,5 @@
<!doctype html>
<html lang="{{ .shortLang }}">
<html lang="{{ .shortLang }}" dir="{{ .pageDirection }}">
<head>
<!--- This CSS is inlined so we should keep this here! -->
<link inline rel="stylesheet" type="text/css" href="web/css/v0.6.0bundle.css">

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ .shortLang }}" class="{{ .cssClass }}">
<html lang="{{ .shortLang }}" dir="{{ .pageDirection }}" class="{{ .cssClass }}">
<head>
{{ template "header.html" . }}
<title>{{ .strings.successHeader }} - jfa-go</title>

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ .shortLang }}" class="{{ .cssClass }}">
<html lang="{{ .shortLang }}" dir="{{ .pageDirection }}" class="{{ .cssClass }}">
<head>
{{ template "header.html" . }}
{{ if .passwordReset }}

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ .shortLang }}" class="{{ .cssClass }}">
<html lang="{{ .shortLang }}" dir="{{ .pageDirection }}" class="{{ .cssClass }}">
<head>
{{ template "header.html" . }}
<title>Invalid Code - jfa-go</title>

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ .shortLang }}" class="{{ .cssClass }}">
<html lang="{{ .shortLang }}" dir="{{ .pageDirection }}" class="{{ .cssClass }}">
<head>
{{ template "header.html" . }}
<title>{{ .strings.passwordReset }} - jfa-go</title>

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ .shortLang }}" class="light">
<html lang="{{ .shortLang }}" dir="{{ .pageDirection }}" class="light">
<head>
{{ template "header.html" . }}
<title>{{ .lang.Strings.pageTitle }}</title>

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ .shortLang }}" class="light">
<html lang="{{ .shortLang }}" dir="{{ .pageDirection }}" class="light">
<head>
<script>
window.langFile = JSON.parse({{ .language }});

View File

@@ -128,6 +128,9 @@ func (app *appContext) BasePageTemplateValues(gc *gin.Context, lang string, page
} else {
shortLang = langComponents[0]
}
if lang == "pk-pk" || shortLang == "ar" || shortLang == "fa" || shortLang == "he" || shortLang == "iw" || shortLang == "kd" || shortLang == "ps" || shortLang == "ug" || shortLang == "ur" || shortLang == "yi" {
set("pageDirection", "rtl")
}
set("langName", lang)
set("shortLang", shortLang)
}