Skip to content

Commit a717bf3

Browse files
devGregAclaude
andcommitted
i18n(rtl): right-to-left layout for the v3 UI; enable Arabic
base.html now emits <html lang dir>, with dir=rtl driven by Django's LANGUAGE_BIDI (true for ar/he/etc.). Converted direction-sensitive Tailwind utilities to logical ones across 25 v3 templates so the layout auto-flips: text-right->text-end, pr/pl->pe/ps, mr/ml->me/ms, left-0->start-0, right-0->end-0 (sidebar + dropdowns), rounded-l->rounded-s, border-r->border-e, float-right->float-end. Rebuilt tailwind-out.css (Tailwind v4). Added scoped RTL CSS: mirror horizontally-directional FontAwesome icons, and keep technical tokens (CVE/CVSS/URLs/code) isolated left-to-right inside RTL text. Enabled Arabic (ar) in LANGUAGES (now 18) and updated the offered-languages test. Verified end to end: the authenticated v3 dashboard/profile/finding/product/metrics/engagement pages all render <html dir="rtl"> with the sidebar mirrored to the inline-start edge and dropdowns to the inline-end edge, Arabic content, HTTP 200. Scope: v3 (Tailwind) UI only. The classic Bootstrap-3 UI is not RTL-aware, and PDF/report RTL (font shaping/bidi) is not addressed here. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent fd77af8 commit a717bf3

28 files changed

Lines changed: 246 additions & 231 deletions

dojo/settings/settings.dist.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ def generate_url(scheme, double_slashes, user, password, host, port, path, param
335335
# remain English regardless of the selected language; only displayed text changes.
336336
LANGUAGES = [
337337
("en", "English"),
338+
("ar", "العربية"),
338339
("de", "Deutsch"),
339340
("es", "Español"),
340341
("fr", "Français"),
@@ -352,8 +353,8 @@ def generate_url(scheme, double_slashes, user, password, host, port, path, param
352353
("zh-hans", "简体中文"),
353354
("zh-hant", "繁體中文"),
354355
]
355-
# Arabic (ar) ships a translated catalog but is intentionally not offered here yet:
356-
# the UI needs right-to-left (bidi) layout work before it renders correctly.
356+
# Arabic (ar) is right-to-left; the v3 UI flips layout via dir="rtl" (set in base.html
357+
# from LANGUAGE_BIDI) plus logical CSS utilities. The classic UI is not RTL-aware.
357358

358359
# If you set this to False, Django will not use timezone-aware datetimes.
359360
USE_TZ = env("DD_USE_TZ")

dojo/static/dojo/css/tailwind-out.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dojo/templates/base.html

Lines changed: 70 additions & 55 deletions
Large diffs are not rendered by default.

dojo/templates/dojo/celery_status.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ <h3>Celery Status</h3>
1212
<div class="panel-heading">
1313
<h4>Celery Status</h4>
1414
</div>
15-
<div class="panel-body text-left">
15+
<div class="panel-body text-start">
1616
<table class="table table-condensed" style="margin-bottom: 0">
1717
<tbody>
1818
<tr>
@@ -32,7 +32,7 @@ <h4>Celery Status</h4>
3232
</tbody>
3333
</table>
3434
</div>
35-
<div class="panel-body text-left">
35+
<div class="panel-body text-start">
3636
<span id="celery-queue-msg"><i class="fa-solid fa-spinner fa-spin text-muted"></i></span>
3737
<div style="margin-top: 8px;">
3838
<button id="purge-queue-btn" class="btn btn-danger btn-xs" disabled title="{% trans 'Loading...' %}">
@@ -55,7 +55,7 @@ <h4>Celery Status</h4>
5555
<code>python manage.py dedupe --dedupe_only</code>
5656
</p>
5757
</div>
58-
<div class="panel-body text-left">
58+
<div class="panel-body text-start">
5959
<div id="queue-details-container" style="display: none;">
6060
<table class="table table-condensed table-bordered table-hover" style="margin-bottom: 0; font-size: 0.9em;">
6161
<thead>
@@ -86,7 +86,7 @@ <h4>Celery Status</h4>
8686
<div class="panel-heading">
8787
<h4>Celery Settings</h4>
8888
</div>
89-
<div class="panel-body text-left">
89+
<div class="panel-body text-start">
9090
<table class="table table-condensed" style="margin-bottom: 0">
9191
<thead><tr><th>Setting</th><th>Value</th></tr></thead>
9292
<tbody id="celery-config-tbody"></tbody>

dojo/templates/dojo/components.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ <h3 class="has-filters">
4747
</td>
4848

4949
<td>{{result.component_version}} </td>
50-
<td class="text-right">
50+
<td class="text-end">
5151
{% if result.active and result.component_name == none %}
5252
<a href="{% url 'open_findings' %}?has_component=false"><b>{{ result.active }}</b></a>
5353
{% elif result.active%}
@@ -56,7 +56,7 @@ <h3 class="has-filters">
5656
0
5757
{% endif %}
5858
</td>
59-
<td class="text-right">
59+
<td class="text-end">
6060
{% if result.duplicate and result.component_name == none %}
6161
<a href="{% url 'all_findings' %}?has_component=false&duplicate=1"><b>{{ result.duplicate }}</b></a>
6262
{% elif result.duplicate %}
@@ -65,7 +65,7 @@ <h3 class="has-filters">
6565
0
6666
{% endif %}
6767
</td>
68-
<td class="text-right">
68+
<td class="text-end">
6969
{% if result.total and result.component_name == none %}
7070
<a href="{% url 'all_findings' %}?has_component=false"><b>{{ result.total }}</b></a>
7171
{% elif result.total %}

dojo/templates/dojo/endpoint_pdf_report.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ <h5>
138138
{% endif %}
139139
</span>
140140
</td>
141-
<td class="text-right">
141+
<td class="text-end">
142142
{{ finding.epss_score|format_epss }}
143143
/
144144
{{ finding.epss_percentile|format_epss }}

dojo/templates/dojo/engagement_pdf_report.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ <h5>
273273
{% endif %}
274274
</span>
275275
</td>
276-
<td class="text-right">
276+
<td class="text-end">
277277
{{ finding.epss_score|format_epss }}
278278
/
279279
{{ finding.epss_percentile|format_epss }}

dojo/templates/dojo/finding_pdf_report.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ <h5>
117117
{% endif %}
118118
</span>
119119
</td>
120-
<td class="text-right">
120+
<td class="text-end">
121121
{{ finding.epss_score|format_epss }}
122122
/
123123
{{ finding.epss_percentile|format_epss }}

dojo/templates/dojo/findings_list_snippet.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ <h3 class="has-filters">
7070
<span class="caret"></span>
7171
</button>
7272
{% endif %}
73-
<div class="btn-group mr-2" role="group" aria-label="{% trans 'Bulk Actions' %}">
73+
<div class="btn-group me-2" role="group" aria-label="{% trans 'Bulk Actions' %}">
7474
{% if product_tab and not 'DISABLE_FINDING_MERGE'|setting_enabled %}
7575
<button type="button"
7676
id="merge_findings"
@@ -617,19 +617,19 @@ <h3 class="has-filters">
617617
{% endif %}
618618
{% endwith %}
619619
</td>
620-
<td class="nowrap text-right">
620+
<td class="nowrap text-end">
621621
{{ finding.epss_score|format_epss }}
622622
</td>
623-
<td class="nowrap text-right">
623+
<td class="nowrap text-end">
624624
{{ finding.epss_percentile|format_epss }}
625625
</td>
626-
<td class="nowrap text-right">
626+
<td class="nowrap text-end">
627627
{{ finding.known_exploited|yesno|capfirst }}
628628
</td>
629-
<td class="nowrap text-right">
629+
<td class="nowrap text-end">
630630
{{ finding.ransomware_used|yesno|capfirst }}
631631
</td>
632-
<td class="nowrap text-right">
632+
<td class="nowrap text-end">
633633
{{ finding.kev_date|date }}
634634
</td>
635635
{% if filter_name == 'Closed' %}
@@ -640,11 +640,11 @@ <h3 class="has-filters">
640640
{{ finding.date }}
641641
{% endif %}
642642
</td>
643-
<td class="text-right">
643+
<td class="text-end">
644644
{{ finding.age }}
645645
</td>
646646
{% if system_settings.enable_finding_sla %}
647-
<td class="text-right">
647+
<td class="text-end">
648648
{{ finding|finding_sla }}
649649
</td>
650650
{% endif %}

0 commit comments

Comments
 (0)