Skip to content

Commit

Permalink
Add Arabic Translation and RTL Support (geopython#1854)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Youssef-Harby authored Nov 21, 2024
1 parent e1fec87 commit 0235bba
Show file tree
Hide file tree
Showing 8 changed files with 776 additions and 4 deletions.
748 changes: 748 additions & 0 deletions locale/ar/LC_MESSAGES/messages.po

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions locale/bs/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.14.0\n"

#: pygeoapi/templates/_base.html:2
msgid "text_direction"
msgstr "ltr"

#: pygeoapi/templates/_base.html:51
msgid "Admin"
msgstr "Admin"
Expand Down
4 changes: 4 additions & 0 deletions locale/de/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"

#: pygeoapi/templates/_base.html:2
msgid "text_direction"
msgstr "ltr"

#: build/lib/pygeoapi/templates/_base.html:40
#: build/lib/pygeoapi/templates/landing_page.html:2
#: pygeoapi/templates/_base.html:40 pygeoapi/templates/landing_page.html:2
Expand Down
4 changes: 4 additions & 0 deletions locale/en/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"

#: pygeoapi/templates/_base.html:2
msgid "text_direction"
msgstr "ltr"

#: build/lib/pygeoapi/templates/_base.html:40
#: build/lib/pygeoapi/templates/landing_page.html:2
#: pygeoapi/templates/_base.html:40 pygeoapi/templates/landing_page.html:2
Expand Down
4 changes: 4 additions & 0 deletions locale/es/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.11.0\n"

#: pygeoapi/templates/_base.html:2
msgid "text_direction"
msgstr "ltr"

#: pygeoapi/templates/_base.html:51
msgid "Admin"
msgstr "Admin"
Expand Down
4 changes: 4 additions & 0 deletions locale/fr/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"

#: pygeoapi/templates/_base.html:2
msgid "text_direction"
msgstr "ltr"

#: build/lib/pygeoapi/templates/_base.html:40
#: build/lib/pygeoapi/templates/landing_page.html:2
#: pygeoapi/templates/_base.html:40 pygeoapi/templates/landing_page.html:2
Expand Down
4 changes: 4 additions & 0 deletions locale/sr/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.14.0\n"

#: pygeoapi/templates/_base.html:2
msgid "text_direction"
msgstr "ltr"

#: pygeoapi/templates/_base.html:51
msgid "Admin"
msgstr "Admin"
Expand Down
8 changes: 4 additions & 4 deletions pygeoapi/templates/_base.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="{{ (locale|lower)[:2] }}" dir="{% trans %}text_direction{% endtrans %}" >
<head>
<meta charset="{{ config['server']['encoding'] }}">
<title>{% block title %}{% endblock %}{% if not self.title() %}{{ config['metadata']['identification']['title'] }}{% endif %}</title>
Expand Down Expand Up @@ -37,9 +37,9 @@
<body>
<div class="bg-light sticky-top border-bottom">
<div class="container">
<header class="d-flex flex-wrap justify-content-center py-3">
<header class="d-flex flex-wrap align-items-center py-3 justify-content-between">
<a href="{{ config['server']['url'] }}"
class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-dark text-decoration-none">
class="d-flex align-items-center mb-3 mb-md-0 text-dark text-decoration-none">
<img src="{{ config['server']['url'] }}/static/img/logo.png"
title="{{ config['metadata']['identification']['title'] }}" style="height:40px;vertical-align: middle;" /></a>
<ul class="nav nav-pills">
Expand All @@ -66,7 +66,7 @@
{% block crumbs %}
<a href="{{ config['server']['url'] }}">{% trans %}Home{% endtrans %}</a>
{% endblock %}
<span style="float:right">
<span style="float: inline-end">
{% set links_found = namespace(json=0, jsonld=0) %}

{% for link in data['links'] %}
Expand Down

0 comments on commit 0235bba

Please sign in to comment.