Skip to content

Commit

Permalink
Add POEditor link to language selector
Browse files Browse the repository at this point in the history
  • Loading branch information
AmauryCarrade committed Apr 18, 2021
1 parent b3dc95a commit 523fe8f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hawk/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
"hawk_gui.context_processors.inject_hawk_settings",
]
},
}
Expand Down Expand Up @@ -105,5 +106,6 @@
MAINTENANCE_MODE_RETRY_AFTER = 60 # one minute

HAWK = {
"SLUG_LENGTH": 8
"SLUG_LENGTH": 8,
'TRANSLATIONS_CONTRIBUTION_LINK': 'https://poeditor.com/join/project?hash=0W06oCXfrR'
}
5 changes: 5 additions & 0 deletions hawk_gui/context_processors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.conf import settings # import the settings file


def inject_hawk_settings(request):
return {'hawk_settings': settings.HAWK}
6 changes: 6 additions & 0 deletions hawk_gui/templates/layout/language_selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ <h3 class="chest-title">{% trans "Select your language…" %}</h3>
{{ language.name_local | title }}
</button>
{% endfor %}

<p>
<a href="{{ hawk_settings.TRANSLATIONS_CONTRIBUTION_LINK }}">
{% trans "Help us translate Hawk into your language!" %}
</a>
</p>
</div>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions static/scss/reports/_language_selector.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ aside.language-selector {
cursor: pointer;
}
}

p {
margin-top: 1.4rem;
}
}
}
}

0 comments on commit 523fe8f

Please sign in to comment.