mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-18 21:09:42 -05:00
feat: translations support
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
var MediaCMS = {
|
||||
{% if media %}mediaId: "{{media}}", {% endif %}
|
||||
{% if user %}profileId: "{{user.username}}", {% endif %}
|
||||
};
|
||||
|
||||
|
||||
{% include "config/core/api.html" %}
|
||||
{% include "config/core/url.html" %}
|
||||
{% include "config/core/user.html" %}
|
||||
@@ -14,6 +15,8 @@
|
||||
{% include "config/installation/pages.html" %}
|
||||
{% include "config/installation/site.html" %}
|
||||
|
||||
{% include "config/installation/translations.html" %}
|
||||
|
||||
window.MediaCMS = MediaCMS;
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
14
templates/config/installation/translations.html
Normal file
14
templates/config/installation/translations.html
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
// These are the translations that will be used in frontend/src using the helper function
|
||||
// translateString (frontend/src/static/js/utils/helpers/translate.js)
|
||||
// They are fetched from the backend, and specifically files/frontend_translations
|
||||
// The Django backend is passing dictionary FRONTEND_TRANSLATIONS.
|
||||
// This contains key values where keys do not have a space
|
||||
// TRANSLATIONS object will be availaible as window.TRANSLATIONS
|
||||
|
||||
// IMPORTANT: If you are starting the frontend app (localhost:8088), you are not getting at this
|
||||
// POINT, so there are not translations. Translations can only be available and tested on the Django app
|
||||
// and templates, that are loading React as well
|
||||
|
||||
window.TRANSLATION = {{ TRANSLATION|safe }};;
|
||||
window.REPLACEMENTS = {{ REPLACEMENTS|safe }};;
|
||||
Reference in New Issue
Block a user