diff --git a/app/classes/shared/helpers.py b/app/classes/shared/helpers.py index 085c6921..8b0a9a84 100644 --- a/app/classes/shared/helpers.py +++ b/app/classes/shared/helpers.py @@ -862,4 +862,13 @@ class Helpers: return text[len(prefix):] return text + @staticmethod + def getLangPage(text): + lang = text.split("_")[0] + region = text.split("_")[1] + if region == 'EN': + return 'en' + else: + return lang+"-"+region + helper = Helpers() diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index 3de05375..2082006d 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -251,6 +251,7 @@ class PanelHandler(BaseHandler): 'error': error, 'time': formatted_time, 'lang': self.controller.users.get_user_lang_by_id(exec_user["user_id"]), + 'lang_page': helper.getLangPage(self.controller.users.get_user_lang_by_id(exec_user["user_id"])), 'super_user': superuser, 'api_key': { 'name': api_key.name, @@ -375,8 +376,6 @@ class PanelHandler(BaseHandler): user_order.remove(server_id) page_data['servers'] = page_servers - - #num players is set to zero here. If we poll all servers while dashboard is loading it takes FOREVER. We leave this to the #async polling once dashboard is served. page_data['num_players'] = 0 @@ -1596,7 +1595,8 @@ class PanelHandler(BaseHandler): user_id = self.controller.users.add_user(username, password=password0, email=email, enabled=enabled, superuser=superuser) user_data = { "roles": roles, - 'lang': lang + 'lang': lang, + 'lang_page': helper.getLangPage(lang), } user_crafty_data = { "permissions_mask": permissions_mask, @@ -1682,7 +1682,10 @@ class PanelHandler(BaseHandler): else: self.set_status(404) - page_data = {'lang': helper.get_setting('language')} + page_data = { + 'lang': helper.get_setting('language'), + 'lang_page': helper.getLangPage(helper.get_setting('language')), + } self.render( "public/404.html", translate=self.translator.translate, @@ -1704,7 +1707,8 @@ class PanelHandler(BaseHandler): 'user_data': exec_user, 'hosts_data': self.controller.management.get_latest_hosts_stats(), 'show_contribute': helper.get_setting("show_contribute_link", True), - 'lang': self.controller.users.get_user_lang_by_id(exec_user["user_id"]) + 'lang': self.controller.users.get_user_lang_by_id(exec_user["user_id"]), + 'lang_page': helper.getLangPage(self.controller.users.get_user_lang_by_id(exec_user["user_id"])), } if page == "remove_apikey": diff --git a/app/classes/web/public_handler.py b/app/classes/web/public_handler.py index 06a1d34c..95672130 100644 --- a/app/classes/web/public_handler.py +++ b/app/classes/web/public_handler.py @@ -39,7 +39,11 @@ class PublicHandler(BaseHandler): error = bleach.clean(self.get_argument('error', "Invalid Login!")) error_msg = bleach.clean(self.get_argument('error_msg', '')) - page_data = {'version': helper.get_version_string(), 'error': error, 'lang': helper.get_setting('language')} + page_data = { + 'version': helper.get_version_string(), + 'error': error, 'lang': helper.get_setting('language'), + 'lang_page': helper.getLangPage(helper.get_setting('language')) + } # sensible defaults template = "public/404.html" diff --git a/app/classes/web/server_handler.py b/app/classes/web/server_handler.py index e4009b11..d8855efa 100644 --- a/app/classes/web/server_handler.py +++ b/app/classes/web/server_handler.py @@ -75,6 +75,7 @@ class ServerHandler(BaseHandler): 'menu_servers': defined_servers, 'show_contribute': helper.get_setting("show_contribute_link", True), 'lang': self.controller.users.get_user_lang_by_id(exec_user["user_id"]), + 'lang_page': helper.getLangPage(self.controller.users.get_user_lang_by_id(exec_user["user_id"])), 'api_key': { 'name': api_key.name, 'created': api_key.created, @@ -84,6 +85,7 @@ class ServerHandler(BaseHandler): } if api_key is not None else None, 'superuser': superuser } + if helper.get_setting("allow_nsfw_profile_pictures"): rating = "x" else: @@ -139,7 +141,8 @@ class ServerHandler(BaseHandler): 'version_data': "version_data_here", # TODO 'user_data': exec_user, 'show_contribute': helper.get_setting("show_contribute_link", True), - 'lang': self.controller.users.get_user_lang_by_id(exec_user["user_id"]) + 'lang': self.controller.users.get_user_lang_by_id(exec_user["user_id"]), + 'lang_page': helper.getLangPage(self.controller.users.get_user_lang_by_id(exec_user["user_id"])) } if page == "command": diff --git a/app/classes/web/status_handler.py b/app/classes/web/status_handler.py index ebd5ab4a..ace2103a 100644 --- a/app/classes/web/status_handler.py +++ b/app/classes/web/status_handler.py @@ -9,6 +9,7 @@ class StatusHandler(BaseHandler): def get(self): page_data = {} page_data['lang'] = helper.get_setting('language') + page_data['lang_page'] = helper.getLangPage(helper.get_setting('language')) page_data['servers'] = self.controller.servers.get_all_servers_stats() for srv in page_data['servers']: server_data = srv.get('server_data', False) diff --git a/app/frontend/static/assets/images/credits/user-circle-solid.svg b/app/frontend/static/assets/images/credits/user-circle-solid.svg new file mode 100644 index 00000000..5c925760 --- /dev/null +++ b/app/frontend/static/assets/images/credits/user-circle-solid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/frontend/templates/base.html b/app/frontend/templates/base.html index 8f86cedf..bc81718d 100644 --- a/app/frontend/templates/base.html +++ b/app/frontend/templates/base.html @@ -1,5 +1,5 @@ - + diff --git a/app/frontend/templates/panel/credits.html b/app/frontend/templates/panel/credits.html index 3440e66d..a04147df 100644 --- a/app/frontend/templates/panel/credits.html +++ b/app/frontend/templates/panel/credits.html @@ -3,18 +3,18 @@ {% block meta %} {% end %} -{% block title %}Crafty Controller - Credits{% end %} +{% block title %}Crafty Controller - {{ translate('credits', 'pageTitle', data['lang']) }}{% end %} {% block content %}
- +
@@ -22,309 +22,326 @@
-
-
-
-
-
-

 Development Team

-
-
- {% for person in data['staff']['development'] %} -
-
-
- -
-
- -
- {% if person['pic'] %} - profile image - {% end %} -
- -
-
-

{{ person['name'] }}

-
- -
- {% if person['loc'] %} - -

{{ person['loc'] }}

- {% end %} -
-
-
- -
-
- {% if person['tags'][0] %} - {{ person['tags'][0] }} - {% end %} - {% if person['tags'][1] %} - {% if type(person['tags'][1]) is list %} - {{ person['tags'][1][0] }} - {% else %} - {{ person['tags'][1] }} - {% end %} - {% end %} - {% if person['tags'][2] %} - {% if type(person['tags'][2]) is list %} - {{ person['tags'][2][0] }} - {% else %} - {{ person['tags'][2] }} - {% end %} - {% end %} -
- -
- {% if person['title'] %} -
Crafty's {{ person['title'] }}
- {% end %} -

{{ person['blurb'] }}

-
-
-
- -
-
-
- {% end %} - -
- -
-

 Support and Documentation Team

-
- -
- {% for person in data['staff']['support'] %} -
-
-
- -
-
- -
- {% if person['pic'] %} - profile image - {% end %} -
- -
-
-

{{ person['name'] }}

-
- -
- {% if person['loc'] %} - -

{{ person['loc'] }}

- {% end %} -
-
-
- -
-
- {% if person['tags'][0] %} - {{ person['tags'][0] }} - {% end %} - {% if person['tags'][1] %} - {% if type(person['tags'][1]) is list %} - {{ person['tags'][1][0] }} - {% else %} - {{ person['tags'][1] }} - {% end %} - {% end %} - {% if person['tags'][2] %} - {% if type(person['tags'][2]) is list %} - {{ person['tags'][2][0] }} - {% else %} - {{ person['tags'][2] }} - {% end %} - {% end %} -
- -
- {% if person['title'] %} -
{{ person['title'] }}
- {% end %} -

{{ person['blurb'] }}

-
-
-
- -
-
-
- {% end %} - -
- -
-

 Retired Staff

-
- -
- - {% for person in data['staff']['retired'] %} -
-
-
- -
-
- -
- {% if person['pic'] %} - profile image - {% end %} -
- -
-
-

{{ person['name'] }}

-
- -
- {% if person['loc'] %} - -

{{ person['loc'] }}

- {% end %} -
-
-
- -
-
- {% if person['tags'][0] %} - {{ person['tags'][0] }} - {% end %} - {% if person['tags'][1] %} - {% if type(person['tags'][1]) is list %} - {{ person['tags'][1][0] }} - {% else %} - {{ person['tags'][1] }} - {% end %} - {% end %} - {% if person['tags'][2] %} - {% if type(person['tags'][2]) is list %} - {{ person['tags'][2][0] }} - {% else %} - {{ person['tags'][2] }} - {% end %} - {% end %} -
- -
- {% if person['title'] %} -
{{ person['title'] }}
- {% end %} -

{{ person['blurb'] }}

-
-
-
- -
-
-
- {% end %} - -
-
-
+
+
+

 {{ translate('credits', 'developmentTeam', data['lang']) }}

-
+
+
+ {% for person in data['staff']['development'] %} +
+
-
+
+
-
-
-
-

Patreon Supporters

-

A huge thank you  to our Patreon supporters! | Last Update: {{ data["lastUpdate"] }}

- - - - - - - - - {% for pat in data["patrons"] %} - - - - - {% end %} + - -
NameLevel
{{ pat["name"] }} - {% if pat["level"] == "Crafty Sustainer" %} - Sustainer - {% elif pat["level"] == "Crafty Advocate" %} - Advocate - {% elif pat["level"] == "Crafty Supporter" %} - Supporter +
+ {% if person['pic'] %} + profile image {% else %} - Other +
+ profile image +
{% end %} -
-
-
-
+
+
+

{{ person['name'] }}

+
-
-
-
-

Language Translation

-

A huge thank you  to our community who translate!

- - - - - - - - - {% for person in data['translations'] %} - - - - - {% end %} - -
NameStatus
{{ person }} - {% for language in data['translations'][person] %} - {{ language }} +
+ {% if person['loc'] %} + +

{{ person['loc'] }}

+ {% end %} +
+ + + +
+
+ {% if person['tags'][0] %} + {{ person['tags'][0] }} {% end %} -
+ {% if person['tags'][1] %} + {% if type(person['tags'][1]) is list %} + {{ person['tags'][1][0] }} + {% else %} + {{ person['tags'][1] }} + {% end %} + {% end %} + {% if person['tags'][2] %} + {% if type(person['tags'][2]) is list %} + {{ person['tags'][2][0] }} + {% else %} + {{ person['tags'][2] }} + {% end %} + {% end %} +
+ +
+ {% if person['title'] %} +
Crafty's {{ person['title'] }}
+ {% end %} +

{{ person['blurb'] }}

+
+
+
+ +
+ {% end %}
-
- - - +
-
- -{% end %} +
-{% block js %} - +
+ {% if person['pic'] %} + profile image + {% else %} +
+ profile image +
+ {% end %} +
-{% end %} +
+
+

{{ person['name'] }}

+
+ +
+ {% if person['loc'] %} + +

{{ person['loc'] }}

+ {% end %} +
+
+
+ +
+
+ {% if person['tags'][0] %} + {{ person['tags'][0] }} + {% end %} + {% if person['tags'][1] %} + {% if type(person['tags'][1]) is list %} + {{ person['tags'][1][0] }} + {% else %} + {{ person['tags'][1] }} + {% end %} + {% end %} + {% if person['tags'][2] %} + {% if type(person['tags'][2]) is list %} + {{ person['tags'][2][0] }} + {% else %} + {{ person['tags'][2] }} + {% end %} + {% end %} +
+ +
+ {% if person['title'] %} +
{{ person['title'] }}
+ {% end %} +

{{ person['blurb'] }}

+
+
+
+ +
+
+ {% end %} + + + + +
+ +
+
+

 {{ translate('credits', 'retiredStaff', data['lang']) }}

+
+ +
+
+ {% for person in data['staff']['retired'] %} +
+
+
+
+
+ {% if person['pic'] %} + profile image + {% else %} +
+ profile image +
+ {% end %} +
+ +
+
+

{{ person['name'] }}

+
+ +
+ {% if person['loc'] %} + +

{{ person['loc'] }}

+ {% end %} +
+
+
+ +
+
+ {% if person['tags'][0] %} + {{ person['tags'][0] }} + {% end %} + {% if person['tags'][1] %} + {% if type(person['tags'][1]) is list %} + {{ person['tags'][1][0] }} + {% else %} + {{ person['tags'][1] }} + {% end %} + {% end %} + {% if person['tags'][2] %} + {% if type(person['tags'][2]) is list %} + {{ person['tags'][2][0] }} + {% else %} + {{ person['tags'][2] }} + {% end %} + {% end %} +
+ +
+ {% if person['title'] %} +
{{ person['title'] }}
+ {% end %} +

{{ person['blurb'] }}

+
+
+
+ +
+
+ {% end %} +
+
+
+ +
+ +
+ +
+
+
+

{{ translate('credits', 'patreonSupporter', + data['lang']) + }}

+
+
+

{{ translate('credits', 'hugeDesc', data['lang']) }} + {{ translate('credits', 'thankYou', data['lang']) }}  {{ translate('credits', 'patreonDesc', data['lang']) }} | {{ translate('credits', 'patreonUpdate', data['lang']) }} {{ data["lastUpdate"] }} +

+ + + + + + + + + {% for pat in data["patrons"] %} + + + + + {% end %} + + +
{{ translate('credits', 'patreonName', data['lang']) }}{{ translate('credits', 'patreonLevel', data['lang']) }}
{{ pat["name"] }} + {% if pat["level"] == "Crafty Sustainer" %} + Sustainer + {% elif pat["level"] == "Crafty Advocate" %} + Advocate + {% elif pat["level"] == "Crafty Supporter" %} + Supporter + {% else %} + {{ translate('credits', 'patreonOther', data['lang']) }} + {% end %} +
+
+
+
+ +
+
+
+

{{ translate('credits', 'translationTitle', data['lang']) }}

+
+
+

{{ translate('credits', 'hugeDesc', data['lang']) }} + {{ translate('credits', 'thankYou', data['lang']) }}  {{ translate('credits', 'translationDesc', data['lang']) }} +

+ + + + + + + + + {% for person in data['translations'] %} + + + + + {% end %} + +
{{ translate('credits', 'translationName', data['lang']) }}{{ translate('credits', 'translator', data['lang']) }}
{{ person }} +
+ {% for language in data['translations'][person] %} + {{ language }} + {% end %} +
+
+
+
+
+ +
+ + + + {% end %} + + {% block js %} + + + {% end %} \ No newline at end of file diff --git a/app/frontend/templates/public_base.html b/app/frontend/templates/public_base.html index 3c9fa176..dcdb5b1b 100644 --- a/app/frontend/templates/public_base.html +++ b/app/frontend/templates/public_base.html @@ -1,5 +1,5 @@ - + diff --git a/app/translations/en_EN.json b/app/translations/en_EN.json index fcd04232..2de1ee5b 100644 --- a/app/translations/en_EN.json +++ b/app/translations/en_EN.json @@ -510,6 +510,24 @@ "superUser": "Super User", "deleteKeyConfirmation": "Do you want to delete this API key? This cannot be undone.", "deleteKeyConfirmationTitle": "Remove API key ${keyId}?" + }, + "credits": { + "pageTitle": "Credits", + "pageDescription": "Without these people, you wouldn't have Crafty", + "developmentTeam": "Development Team", + "supportTeam": "Support and Documentation Team", + "retiredStaff": "Retired Staff", + "hugeDesc": "A huge", + "thankYou": "THANK YOU", + "patreonSupporter": "Patreon Supporters", + "patreonDesc": "to our Patreon supporters!", + "patreonUpdate": "Last Update:", + "patreonName": "Name", + "patreonLevel": "Level", + "patreonOther": "Other", + "translationTitle": "Language Translation", + "translationDesc": "to our community who translate!", + "translationName": "Name", + "translator": "Translators" } - } \ No newline at end of file diff --git a/app/translations/fr_FR.json b/app/translations/fr_FR.json index 3f32aea4..7e429306 100644 --- a/app/translations/fr_FR.json +++ b/app/translations/fr_FR.json @@ -89,7 +89,7 @@ "allServers": "Tous les Serverus", "server": "Serveur", "actions": "Actions", - "world": "Monde", + "size": "Taille du Serveur", "motd": "MOTD", "version": "Version", "status": "Statut", @@ -240,7 +240,7 @@ "options": "Options", "restoring": "Restauration de la sauvegarde. Cela peut prendre un peu de temps. S'il vous plaît soyez patient.", "restore": "Restaurer", - "confirmRestore": "Êtes-vous sûr de vouloir restaurer à partir de cette sauvegarde. Tous les fichiers du serveur actuel passeront à l'état de sauvegarde et seront irrécupérables.",, + "confirmRestore": "Êtes-vous sûr de vouloir restaurer à partir de cette sauvegarde. Tous les fichiers du serveur actuel passeront à l'état de sauvegarde et seront irrécupérables.", "excludedBackups": "Dossiers Exclus : ", "excludedChoose": "Choisir les dossiers à exclure de la sauvegarde", "clickExclude": "Cliquer pour sélectionner les Exclusions", @@ -510,5 +510,24 @@ "superUser": "Super Utilisateur", "deleteKeyConfirmation": "Es-tu sûr de vouloir supprimer cette clé API? Tu ne pourras plus revenir en arrière.", "deleteKeyConfirmationTitle": "Supprimer la clé API ${keyId}?" + }, + "credits": { + "pageTitle": "Crédits", + "pageDescription": "Sans ces personnes, vous n'auriez pas Crafty", + "developmentTeam": "Equipe de Développement", + "supportTeam": "Equipe de Support et de Documentation", + "retiredStaff": "Retraités de Crafty", + "hugeDesc": "Un Enorme", + "thankYou": "MERCI", + "patreonSupporter": "Soutiens Patreon", + "patreonDesc": "à nos Soutiens Patreon !", + "patreonUpdate": "Dernière mise à Jour :", + "patreonName": "Nom", + "patreonLevel": "Niveau", + "patreonOther": "Autre", + "translationTitle": "Traductions", + "translationDesc": "à notre communauté qui traduit Crafty !", + "translationName": "Langue", + "translator": "Traducteurs" } }