Skip to content

Commit 0235bba

Browse files
Add Arabic Translation and RTL Support (#1854)
* Update HTML template to support dynamic text direction and improve layout styling * add translation for arabic * Improve header layout in base HTML template for better alignment and spacing with RTL and LTR * Add language attribute to HTML tag * Update Arabic translations to include "STAC" in SpatioTemporal asset terminology * Add "text_direction" to be "ltr" translation for bs, de, en, es, fr, sr languages
1 parent e1fec87 commit 0235bba

File tree

8 files changed

+776
-4
lines changed

8 files changed

+776
-4
lines changed

Diff for: locale/ar/LC_MESSAGES/messages.po

+748
Large diffs are not rendered by default.

Diff for: locale/bs/LC_MESSAGES/messages.po

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ msgstr ""
1919
"Content-Transfer-Encoding: 8bit\n"
2020
"Generated-By: Babel 2.14.0\n"
2121

22+
#: pygeoapi/templates/_base.html:2
23+
msgid "text_direction"
24+
msgstr "ltr"
25+
2226
#: pygeoapi/templates/_base.html:51
2327
msgid "Admin"
2428
msgstr "Admin"

Diff for: locale/de/LC_MESSAGES/messages.po

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ msgstr ""
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Generated-By: Babel 2.9.1\n"
2020

21+
#: pygeoapi/templates/_base.html:2
22+
msgid "text_direction"
23+
msgstr "ltr"
24+
2125
#: build/lib/pygeoapi/templates/_base.html:40
2226
#: build/lib/pygeoapi/templates/landing_page.html:2
2327
#: pygeoapi/templates/_base.html:40 pygeoapi/templates/landing_page.html:2

Diff for: locale/en/LC_MESSAGES/messages.po

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ msgstr ""
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Generated-By: Babel 2.9.1\n"
2020

21+
#: pygeoapi/templates/_base.html:2
22+
msgid "text_direction"
23+
msgstr "ltr"
24+
2125
#: build/lib/pygeoapi/templates/_base.html:40
2226
#: build/lib/pygeoapi/templates/landing_page.html:2
2327
#: pygeoapi/templates/_base.html:40 pygeoapi/templates/landing_page.html:2

Diff for: locale/es/LC_MESSAGES/messages.po

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ msgstr ""
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Generated-By: Babel 2.11.0\n"
2020

21+
#: pygeoapi/templates/_base.html:2
22+
msgid "text_direction"
23+
msgstr "ltr"
24+
2125
#: pygeoapi/templates/_base.html:51
2226
msgid "Admin"
2327
msgstr "Admin"

Diff for: locale/fr/LC_MESSAGES/messages.po

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ msgstr ""
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Generated-By: Babel 2.9.1\n"
2020

21+
#: pygeoapi/templates/_base.html:2
22+
msgid "text_direction"
23+
msgstr "ltr"
24+
2125
#: build/lib/pygeoapi/templates/_base.html:40
2226
#: build/lib/pygeoapi/templates/landing_page.html:2
2327
#: pygeoapi/templates/_base.html:40 pygeoapi/templates/landing_page.html:2

Diff for: locale/sr/LC_MESSAGES/messages.po

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ msgstr ""
1919
"Content-Transfer-Encoding: 8bit\n"
2020
"Generated-By: Babel 2.14.0\n"
2121

22+
#: pygeoapi/templates/_base.html:2
23+
msgid "text_direction"
24+
msgstr "ltr"
25+
2226
#: pygeoapi/templates/_base.html:51
2327
msgid "Admin"
2428
msgstr "Admin"

Diff for: pygeoapi/templates/_base.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!doctype html>
2-
<html lang="en">
2+
<html lang="{{ (locale|lower)[:2] }}" dir="{% trans %}text_direction{% endtrans %}" >
33
<head>
44
<meta charset="{{ config['server']['encoding'] }}">
55
<title>{% block title %}{% endblock %}{% if not self.title() %}{{ config['metadata']['identification']['title'] }}{% endif %}</title>
@@ -37,9 +37,9 @@
3737
<body>
3838
<div class="bg-light sticky-top border-bottom">
3939
<div class="container">
40-
<header class="d-flex flex-wrap justify-content-center py-3">
40+
<header class="d-flex flex-wrap align-items-center py-3 justify-content-between">
4141
<a href="{{ config['server']['url'] }}"
42-
class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-dark text-decoration-none">
42+
class="d-flex align-items-center mb-3 mb-md-0 text-dark text-decoration-none">
4343
<img src="{{ config['server']['url'] }}/static/img/logo.png"
4444
title="{{ config['metadata']['identification']['title'] }}" style="height:40px;vertical-align: middle;" /></a>
4545
<ul class="nav nav-pills">
@@ -66,7 +66,7 @@
6666
{% block crumbs %}
6767
<a href="{{ config['server']['url'] }}">{% trans %}Home{% endtrans %}</a>
6868
{% endblock %}
69-
<span style="float:right">
69+
<span style="float: inline-end">
7070
{% set links_found = namespace(json=0, jsonld=0) %}
7171

7272
{% for link in data['links'] %}

0 commit comments

Comments
 (0)