Merge pull request 'Add Japanese message string for django.po' (#25) from ysaito/website:main into translation

Reviewed-on: #25
This commit is contained in:
Danhia 2022-02-18 16:17:47 +01:00
commit 02385dcd08
19 changed files with 395 additions and 373 deletions

104
bot.py
View File

@ -1,104 +0,0 @@
import os
import discord
import discord.utils
import urllib.request, json
import asyncio
import json
import logging
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = '42ctf'
intents = discord.Intents.all()
client = discord.Client(intents=intents)
db_file = open('members.json', 'r')
users = json.load(db_file)
db_file.close()
logging.basicConfig(filename='bot.log', format='%(asctime)s %(message)s', level=logging.INFO)
guild = ''
roles = {}
def get_rank(token):
url = urllib.request.urlopen("https://www.42ctf.org/accounts/rank/" + token)
data = json.loads(url.read().decode())
rank = data['rank']
return rank
async def watch_roles():
global users
await client.wait_until_ready() # ensures cache is loaded
while not client.is_closed():
for member_id, token in users.items():
if (token == "0000"):
continue
member = discord.utils.get(guild.members, id=int(member_id))
rank = get_rank(token)
if rank == 1 and roles['top1'] not in member.roles:
await member.add_roles(roles['top1'])
await member.remove_roles(roles['top10'])
await member.remove_roles(roles['top50'])
elif rank > 1 and rank <= 10 and roles['top10'] not in member.roles:
await member.add_roles(roles['top10'])
await member.remove_roles(roles['top1'])
await member.remove_roles(roles['top50'])
elif rank > 10 and rank <= 50 and roles['top50'] not in member.roles:
await member.add_roles(roles['top50'])
await member.remove_roles(roles['top10'])
await member.remove_roles(roles['top1'])
elif rank > 50:
await member.remove_roles(roles['top1'])
await member.remove_roles(roles['top10'])
await member.remove_roles(roles['top50'])
await asyncio.sleep(60)
@client.event
async def on_ready():
global guild, roles
guild = discord.utils.get(client.guilds, name=GUILD)
roles['top10'] = discord.utils.get(guild.roles, id=801787467064672286)
roles['top1'] = discord.utils.get(guild.roles, id=798638767359524875)
roles['top50'] = discord.utils.get(guild.roles, id=803729539145924649)
logging.info('%s is connected to the following guild: %s(id: %d)', client.user, guild.name, guild.id)
client.loop.create_task(watch_roles())
@client.event
async def on_message(message):
global guild, roles
if message.author == client.user:
return
if '!connect' in message.content:
try:
user_token = message.content.split(' ')[1]
member = discord.utils.get(guild.members, name=message.author.name)
rank = get_rank(user_token)
users[str(member.id)] = user_token
logging.info("MESSAGE: from %s with token %s", message.author.name, user_token)
with open('members.json', 'w') as json_file:
json.dump(users, json_file)
if rank == 1:
await member.add_roles(roles['top1'])
response = "Congratulations, you're now Top 1. But for how long ?"
elif (rank <= 10):
await member.add_roles(roles['top10'])
response = "You've been granted the Top 10 role. Now, go away and flag !"
elif rank <= 50:
await member.add_roles(roles['top50'])
response = "You've been granted the Top 50 role. Now, go away and flag !"
else:
response = "No role for you now, but I'll keep watching you."
except IndexError:
response = 'usage: !connect 42ctf_token'
await message.author.create_dm()
await message.author.dm_channel.send(response)
client.run(TOKEN)

View File

@ -40,7 +40,30 @@
</div>
</div>
<div class="ctf-block">
<div class="ctf-head">
<h3>{% trans "Connected accounts" %}</h3>
</div>
<div class="bloc-body">
<div class="d-flex">
{% if user.userprofileinfo.discord_id|length > 0 %}
<form action="{% url 'accounts:connections-disconnect-discord' %}" method='POST'
class="form-inline p-2">
{%csrf_token%}
<button class="btn btn-dark" type="submit">{% trans "Disconnect Discord" %}</button>
</form>
{% else %}
<form action="{% url 'accounts:connections-connect-discord' %}" method='POST'
class="form-inline p-2">
{%csrf_token%}
<button class="btn btn-dark" type="submit">{% trans "Connect Discord" %}</button>
</form>
{% endif %}
</div>
</div>
</div>
</div>
<div class="d-none d-md-block col-10 col-md-3 right-sidebar">
<ul class="list-group">
<li class="list-group-item">{{ user.username }}</li>
@ -65,4 +88,3 @@
</div>
</div>
{% endblock %}

View File

@ -4,6 +4,7 @@ from django.views.decorators.http import require_POST
from django.views.defaults import bad_request
from django.urls import reverse
from django.shortcuts import redirect
from django.contrib.sites.models import Site
import os
oauth = OAuth()
@ -23,8 +24,9 @@ oauth.register(
def connect(request):
if request.user.userprofileinfo.discord_id:
return bad_request(request, "Already connected")
site = Site.objects.get_current()
redirect_uri = reverse('accounts:connections-connect-discord-authorize')
redirect_uri = request.build_absolute_uri(redirect_uri)
redirect_uri = "https://" + site.domain + redirect_uri[3:] # remove language code
print(redirect_uri)
return oauth.discord.authorize_redirect(request, redirect_uri)
@ -32,7 +34,10 @@ def connect(request):
def authorize(request):
if request.user.userprofileinfo.discord_id:
return bad_request(request, "Already connected")
try:
token = oauth.discord.authorize_access_token(request)
except:
return redirect('accounts:edit')
response = oauth.discord.get('users/@me', token=token)
response = response.json()
discord_id = response['id']

View File

@ -155,17 +155,6 @@ def profile(request, user_name):
return render(request,'accounts/profile.html', {'user':user_obj, 'solves':solves,'solved':solved,'catsDatas': catsDatas, 'pointDatas': pointDatas,
'rank': rank, 'score' : somme, 'member' : member, 'cats':cats})
def rank(request, token):
all_users = UserProfileInfo.objects.filter(score__gt=0).select_related().order_by('-score', 'last_submission_date', 'user__username')
rank = 1
for elem in all_users:
if elem.token == token:
break
rank += 1
data = {"rank": rank}
return JsonResponse(data)
@login_required
def delete_account(request):
if request.method == 'POST':
@ -182,3 +171,14 @@ def delete_account(request):
else:
return render(request, 'accounts/delete.html', {'deleted': False, 'bad_password': False} )
def rank(request, token):
all_users = UserProfileInfo.objects.filter(score__gt=0).select_related().order_by('-score', 'last_submission_date', 'user__username')
rank = 1
for elem in all_users:
if elem.token == token:
break
rank += 1
data = {"rank": rank}
return JsonResponse(data)

0
src/api/__init__.py Normal file
View File

3
src/api/admin.py Normal file
View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
src/api/apps.py Normal file
View File

@ -0,0 +1,6 @@
from django.apps import AppConfig
class ApiConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'api'

View File

3
src/api/models.py Normal file
View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
src/api/tests.py Normal file
View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

6
src/api/urls.py Normal file
View File

@ -0,0 +1,6 @@
from django.urls import path
from . import views
urlpatterns = [
path('bot/discord', views.discord_bot, name='discord_bot'),
]

27
src/api/views.py Normal file
View File

@ -0,0 +1,27 @@
from django.shortcuts import render
from accounts.models import UserProfileInfo
from django.http import JsonResponse
import os
# Create your views here.
def discord_bot(request):
if request.method != 'GET':
return JsonResponse({'error':'bad request'})
token = request.GET.get('token')
auth_token = os.getenv('BOT_TOKEN')
if (token != auth_token or not auth_token):
return JsonResponse({'error':'not authorized'})
all_users = UserProfileInfo.objects.select_related().order_by('-score', 'last_submission_date', 'user__username')
data = {}
rank = 1
for user in all_users:
if user.discord_id:
data[user.discord_id] = rank
rank += 1
return JsonResponse(data)

View File

@ -8,19 +8,6 @@ from django.utils.translation import get_language
from math import log
from accounts.models import UserProfileInfo
def get_description_by_lang(ctf):
lang = get_language()
ret = None
if lang == "fr":
ret = ctf.description
elif lang == "en":
ret = ctf.description_en
elif lang == "de":
ret = ctf.description_de
elif lang == "ru":
ret = ctf.description_ru
return ret
def actualize_points(ctf):
if ctf.category.name == "-Intro-":
return
@ -50,7 +37,6 @@ def ctf(request, cat_slug, ctf_slug):
ctf_info = get_object_or_404(CTF, slug=ctf_slug, event=None)
flagged = False
solved_list = CTF_flags.objects.filter(ctf=ctf_info).order_by('flag_date')
description = get_description_by_lang(ctf_info)
if request.user.is_authenticated:
if CTF_flags.objects.filter(user=request.user, ctf=ctf_info):
flagged = True
@ -66,12 +52,12 @@ def ctf(request, cat_slug, ctf_slug):
profil.score += ctf_info.points
profil.save()
actualize_points(ctf_info)
return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'valitated': True, 'description': description, 'date': timezone.now()})
return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'valitated': True, 'date': timezone.now()})
else:
return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'failed': True, 'description': description, 'date': timezone.now()})
return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'failed': True, 'date': timezone.now()})
else:
return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'alvalitated': True, 'description': description, 'date': timezone.now()})
return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'alvalitated': True, 'date': timezone.now()})
else:
return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'description': description, 'date': timezone.now()})
return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'date': timezone.now()})
else:
return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'alvalitated': flagged, 'description': description, 'date': timezone.now()})
return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'alvalitated': flagged, 'date': timezone.now()})

View File

@ -4,4 +4,4 @@
チャレンジポイントは200から始まり、5より低くなることはありません。<br><br>
これにより、チャレンジの実際の難易度をより良く反映できるようになると期待しています。期間限定イベントは、この変更の影響は受けません。
これにより、課題の実際の難易度をより良く反映できるようになると期待しています。期間限定イベントは、この変更の影響は受けません。

View File

@ -1,8 +1,8 @@
SQLインジェクションについて学びたいと思ったことはありませんか<br>
<br>
<b><a class=profile_link href=https://www.42ctf.org/accounts/profile/aldubar>aldubar</a></b>が作成した全く新しい3つのチャレンジを提供します。<br>
<b><a class=profile_link href=https://www.42ctf.org/accounts/profile/aldubar>aldubar</a></b>が作成した全く新しい3つの課題を提供します。<br>
- <b><a href='https://www.42ctf.org/ctfs/web/simple_question_1'>Simple Question of Logic 1</a></b> (10 points)<br>
- <b><a href='https://www.42ctf.org/ctfs/web/simple_question_2'>Simple Question of Logic 2</a></b> (30 points)<br>
- <b><a href='https://www.42ctf.org/ctfs/web/simple_question_3'>Simple Question of Logic 3</a></b> (40 points)<br>
<br>
新しいチャレンジを提案するために、<a class="footer_imgs" href="https://discord.gg/DwZqPpA" target="_blank"><img src="/static/img/discord.png" width="30"></a>へいつでも連絡できることを忘れないでください!
新しい課題を提案するために、<a class="footer_imgs" href="https://discord.gg/DwZqPpA" target="_blank"><img src="/static/img/discord.png" width="30"></a>へいつでも連絡できることを忘れないでください!

View File

@ -20,23 +20,23 @@ msgstr ""
#: accounts/templates/accounts/delete.html:8
msgid "Delete account"
msgstr ""
msgstr "アカウント削除"
#: accounts/templates/accounts/delete.html:11
msgid "Please confirm your password to delete your account."
msgstr ""
msgstr "アカウントを削除するには、パスワードを入力してください。"
#: accounts/templates/accounts/delete.html:12
msgid "Deleted accounts cannot be recovered."
msgstr ""
msgstr "削除されたアカウントは復元できません。"
#: accounts/templates/accounts/delete.html:15
msgid "Password inccorect."
msgstr ""
msgstr "パスワードが正しくありません。"
#: accounts/templates/accounts/delete.html:17
msgid "Your account has been deleted."
msgstr ""
msgstr "あなたのアカウントは削除されました。"
#: accounts/templates/accounts/delete.html:22
#: accounts/templates/accounts/login.html:19
@ -44,21 +44,22 @@ msgstr ""
#: events/templates/events/create_team.html:27
#: events/templates/events/join_team.html:32
msgid "Password"
msgstr ""
msgstr "パスワード"
#: accounts/templates/accounts/edit.html:21
#: accounts/templates/accounts/login.html:18
#: accounts/templates/accounts/register.html:22
#: ctfs/templates/ctfs/ctf_info.html:63 ctfs/templates/ctfs/ctfs_list.html:12
#: ctfs/templates/ctfs/ctf_info.html:63
#: ctfs/templates/ctfs/ctfs_list.html:12
#: events/templates/events/ctf_info.html:65
#: events/templates/events/event_info.html:64
#: scoreboard/templates/scoreboard/scoreboard.html:13
msgid "Username"
msgstr ""
msgstr "ユーザー名"
#: accounts/templates/accounts/edit.html:25
msgid "Email"
msgstr ""
msgstr "Eメール"
#: accounts/templates/accounts/edit.html:30
#: ctfs/templates/ctfs/ctf_info.html:64
@ -66,40 +67,41 @@ msgstr ""
#: events/templates/events/event_info.html:65
#: scoreboard/templates/scoreboard/scoreboard.html:14
msgid "Website"
msgstr ""
msgstr "ウェブサイト"
#: accounts/templates/accounts/edit.html:36
#: events/templates/events/manage_team.html:29
msgid "Apply"
msgstr ""
msgstr "適用する"
#: accounts/templates/accounts/edit.html:47
#: accounts/templates/accounts/profile.html:46
#: ctfs/templates/ctfs/ctf_info.html:65 ctfs/templates/ctfs/ctfs_list.html:13
#: ctfs/templates/ctfs/ctf_info.html:65
#: ctfs/templates/ctfs/ctfs_list.html:13
#: events/templates/events/event_info.html:66
#: events/templates/events/event_info.html:89
#: events/templates/events/manage_team.html:40
#: events/templates/events/team.html:45
#: scoreboard/templates/scoreboard/scoreboard.html:15
msgid "Score"
msgstr ""
msgstr "スコア"
#: accounts/templates/accounts/edit.html:55
#: accounts/templates/accounts/profile.html:60
msgid "Registered since"
msgstr ""
msgstr "登録日"
#: accounts/templates/accounts/edit.html:61
msgid "Delete my account"
msgstr ""
msgstr "アカウント削除"
#: accounts/templates/accounts/login.html:13
msgid "Please, verify your infos."
msgstr ""
msgstr "あなたの情報を確認してください。"
#: accounts/templates/accounts/login.html:22
msgid "Reset password"
msgstr ""
msgstr "パスワード再設定"
#: accounts/templates/accounts/login.html:31
#: accounts/templates/accounts/register.html:38 templates/base.html:97
@ -108,7 +110,7 @@ msgstr ""
#: templates/registration/password_reset_done.html:18
#: templates/registration/password_reset_form.html:26
msgid "Login"
msgstr ""
msgstr "ログイン"
#: accounts/templates/accounts/login.html:32
#: accounts/templates/accounts/register.html:37
@ -117,37 +119,37 @@ msgstr ""
#: templates/registration/password_reset_done.html:19
#: templates/registration/password_reset_form.html:27
msgid "Sign up"
msgstr ""
msgstr "サインアップ"
#: accounts/templates/accounts/profile.html:10
msgid "Challenges Solved by"
msgstr ""
msgstr "解いた課題"
#: accounts/templates/accounts/profile.html:21
#: events/templates/events/team.html:20
msgid "Challenge Name"
msgstr ""
msgstr "課題名"
#: accounts/templates/accounts/profile.html:22
#: events/templates/events/team.html:21
msgid "Category"
msgstr ""
msgstr "カテゴリー"
#: accounts/templates/accounts/profile.html:23
#: events/templates/events/team.html:22
msgid "Points"
msgstr ""
msgstr "ポイント"
#: accounts/templates/accounts/profile.html:24
#: ctfs/templates/ctfs/ctf_info.html:66
#: events/templates/events/ctf_info.html:67
#: events/templates/events/team.html:23
msgid "Date"
msgstr ""
msgstr "日付"
#: accounts/templates/accounts/profile.html:39
msgid "It seems that this user has not solved any challenge yet..."
msgstr ""
msgstr "まだ何も課題を解いていないようです..."
#: accounts/templates/accounts/profile.html:47
#: events/templates/events/event_info.html:63
@ -156,461 +158,471 @@ msgstr ""
#: events/templates/events/team.html:46
#: scoreboard/templates/scoreboard/scoreboard.html:12
msgid "Rank"
msgstr ""
msgstr "ラング"
#: accounts/templates/accounts/profile.html:56
msgid "Status: Member"
msgstr ""
msgstr "ステータス: メンバー"
#: accounts/templates/accounts/profile.html:58
msgid "Status: Visitor"
msgstr ""
msgstr "ステータス: 訪問者"
#: accounts/templates/accounts/profile.html:64
#: events/templates/events/team.html:57
msgid "Categories stats"
msgstr ""
msgstr "カテゴリー別の統計"
#: accounts/templates/accounts/register.html:13
msgid "Welcome !"
msgstr ""
msgstr "ようこそ!"
#: accounts/templates/accounts/register.html:14
msgid "Your account has been created."
msgstr ""
msgstr "アカウントが作成されました。"
#: accounts/templates/accounts/register.html:25
msgid "Personal website"
msgstr ""
msgstr "個人サイト"
#: accounts/templates/accounts/register.html:26
#: events/templates/events/event_info.html:119
msgid "Register"
msgstr ""
msgstr "登録"
#: accounts/views/views.py:33
msgid "Your account was inactive."
msgstr ""
msgstr "アカウントは無効です。"
#: accounts/views/views.py:52
msgid ""
"The password must contain at least one letter and at least one digit or "
"punctuation character."
msgstr ""
"パスワードには、少なくとも1つの文字と、1つの数字または記号を含める必要があり"
"ます。"
#: accounts/views/views.py:54
msgid "A user with that email already exists."
msgstr ""
msgstr "そのEメールを持つユーザーがすでに存在しています。"
#: accounts/views/views.py:67
msgid "A user with that username already exists."
msgstr ""
msgstr "そのユーザー名はすでに存在しています。"
#: accounts/views/views.py:95
msgid "Email already taken."
msgstr ""
msgstr "Eメールはすでに受信済みです。"
#: accounts/views/views.py:101
msgid "Username already taken."
msgstr ""
msgstr "ユーザー名はすでに使用されています。"
#: accounts/views/views.py:105 events/views/teams.py:124
msgid "Updated."
msgstr ""
msgstr "更新しました。"
#: ctfs/templates/ctfs/ctf_info.html:12
#: events/templates/events/ctf_info.html:12
msgid "Published date"
msgstr ""
msgstr "掲載日"
#: ctfs/templates/ctfs/ctf_info.html:16
msgid "Challenge is not yet available."
msgstr ""
msgstr "課題はまだ利用できません。"
#: ctfs/templates/ctfs/ctf_info.html:29
#: events/templates/events/ctf_info.html:24
msgid "Congratulation !"
msgstr ""
msgstr "おめでとうございます!"
#: ctfs/templates/ctfs/ctf_info.html:31
#: events/templates/events/ctf_info.html:26
msgid "Already flagged"
msgstr ""
msgstr "すでにフラグが立っています"
#: ctfs/templates/ctfs/ctf_info.html:33 ctfs/templates/ctfs/ctf_info.html:42
#: ctfs/templates/ctfs/ctf_info.html:33
#: ctfs/templates/ctfs/ctf_info.html:42
#: events/templates/events/ctf_info.html:36
#: events/templates/events/ctf_info.html:45
msgid "Start the challenge"
msgstr ""
msgstr "チャレンジ開始"
#: ctfs/templates/ctfs/ctf_info.html:35 ctfs/templates/ctfs/ctf_info.html:44
#: ctfs/templates/ctfs/ctf_info.html:35
#: ctfs/templates/ctfs/ctf_info.html:44
#: events/templates/events/ctf_info.html:38
#: events/templates/events/ctf_info.html:47
msgid "Download"
msgstr ""
msgstr "ダウンロード"
#: ctfs/templates/ctfs/ctf_info.html:39
#: events/templates/events/ctf_info.html:42
msgid "Wrong flag ! You can do it !"
msgstr ""
msgstr "フラグが違います!あなたならできる!"
#: ctfs/templates/ctfs/ctf_info.html:58
#: events/templates/events/ctf_info.html:60
msgid "Solved by"
msgstr ""
msgstr "解答者"
#: ctfs/templates/ctfs/ctf_info.html:82
#: events/templates/events/ctf_info.html:90
msgid "Nobody has solved this challenge yet."
msgstr ""
msgstr "まだ誰もこの課題を解いていません。"
#: ctfs/templates/ctfs/ctf_info.html:89
#: events/templates/events/ctf_info.html:97
msgid "Author"
msgstr ""
msgstr "作成者"
#: ctfs/templates/ctfs/ctf_info.html:90
#: events/templates/events/ctf_info.html:98
msgid "Point reward"
msgstr ""
msgstr "獲得ポイント"
#: ctfs/templates/ctfs/ctfs_list.html:14
msgid "Solved"
msgstr ""
msgstr "解決済み"
#: ctfs/templates/ctfs/ctfs_list.html:37
msgid "No ctf available for this category."
msgstr ""
msgstr "このカテゴリーにはCTFがありません。"
#: ctfs/templates/ctfs/ctfs_list.html:42
msgid "Categories"
msgstr ""
msgstr "カテゴリー"
#: ctfs/templates/ctfs/ctfs_list.html:48 templates/base.html:54
msgid "No category available."
msgstr ""
msgstr "該当するカテゴリーはありません。"
#: events/templates/events/create_team.html:10
#: events/templates/events/join_team.html:10
msgid "This event starts at"
msgstr ""
msgstr "このイベントは始まります。"
#: events/templates/events/create_team.html:17
#: events/templates/events/join_team.html:17
msgid "You need to be registered to the event."
msgstr ""
msgstr "このイベントに登録する必要があります。"
#: events/templates/events/create_team.html:20 events/views/teams.py:120
#: events/templates/events/create_team.html:20
#: events/views/teams.py:120
msgid "Name already taken."
msgstr ""
msgstr "名前はすでに使用されています。"
#: events/templates/events/create_team.html:26
#: events/templates/events/join_team.html:31
#: events/templates/events/manage_team.html:22
msgid "Team name"
msgstr ""
msgstr "チーム名"
#: events/templates/events/create_team.html:28
#: events/templates/events/create_team.html:49
#: events/templates/events/join_team.html:54
msgid "Create Team"
msgstr ""
msgstr "チーム作成"
#: events/templates/events/create_team.html:33
#: events/templates/events/event_pwd.html:28
#: events/templates/events/join_team.html:38
msgid "You need to be logged to access this event."
msgstr ""
msgstr "このイベントにアクセスするには、ログインする必要があります。"
#: events/templates/events/create_team.html:42
#: events/templates/events/event_info.html:113
#: events/templates/events/event_pwd.html:36
#: events/templates/events/join_team.html:47
msgid "Starts at"
msgstr ""
msgstr "開始日"
#: events/templates/events/create_team.html:43
#: events/templates/events/event_info.html:114
#: events/templates/events/event_pwd.html:37
#: events/templates/events/join_team.html:48
msgid "Ends at"
msgstr ""
msgstr "終了日"
#: events/templates/events/create_team.html:47
#: events/templates/events/event_info.html:129
#: events/templates/events/join_team.html:52
msgid "Manage my team"
msgstr ""
msgstr "自分のチームを管理する"
#: events/templates/events/create_team.html:48
#: events/templates/events/join_team.html:33
#: events/templates/events/join_team.html:53
msgid "Join Team"
msgstr ""
msgstr "チームに参加する"
#: events/templates/events/create_team.html:53
#: events/templates/events/join_team.html:58
msgid "Auto-matching"
msgstr ""
msgstr "自動マッチング"
#: events/templates/events/create_team.html:57
#: events/templates/events/join_team.html:62
msgid "Find me a team !"
msgstr ""
msgstr "チームを見つけよう!"
#: events/templates/events/ctf_info.html:10
msgid "Event"
msgstr ""
msgstr "イベント"
#: events/templates/events/ctf_info.html:18
msgid ""
"No translation available. Please try another language (English or French)."
msgstr ""
msgstr "翻訳はありません。他の言語(英語またはフランス語)をお試しください。"
#: events/templates/events/ctf_info.html:28
#: events/templates/events/event_info.html:18
msgid "This event is over."
msgstr ""
msgstr "このイベントは終了しました。"
#: events/templates/events/ctf_info.html:30
msgid "Error while processing your request. (Invalid Form)"
msgstr ""
msgstr "リクエストの処理中にエラーが発生しました(無効なフォーム)"
#: events/templates/events/ctf_info.html:32
msgid "You must register to the event before submitting flags."
msgstr ""
msgstr "フラグを送信する前に、イベントへの登録が必要です。"
#: events/templates/events/ctf_info.html:34
msgid ""
"This is a team event, please create or join a team before submitting flags."
msgstr ""
"これはチームイベントです。フラグを送信する前に、チームを作成または参加をして"
"ください。"
#: events/templates/events/event_info.html:9
msgid "Subscriptions is over."
msgstr ""
msgstr "申し込みは終了しました。"
#: events/templates/events/event_info.html:12
#: events/templates/events/event_pwd.html:18
msgid "You're already registered to this event."
msgstr ""
msgstr "すでにこのイベントに登録しています。"
#: events/templates/events/event_info.html:20
#: events/templates/events/event_pwd.html:9
msgid "This event start at"
msgstr ""
msgstr "このイベントの開始時間"
#: events/templates/events/event_info.html:30
msgid "Challenges"
msgstr ""
msgstr "課題"
#: events/templates/events/event_info.html:47
msgid "No challenges available."
msgstr ""
msgstr "チャレンジできません。"
#: events/templates/events/event_info.html:51
msgid "The event has not started yet."
msgstr ""
msgstr "イベントはまだ始まっていません。"
#: events/templates/events/event_info.html:57
msgid "ScoreBoard"
msgstr ""
msgstr "スコアボード"
#: events/templates/events/event_info.html:88
msgid "Team"
msgstr ""
msgstr "チーム"
#: events/templates/events/event_info.html:106
msgid "No one have earn point yet, you gonna be the first ?"
msgstr ""
msgstr "まだ誰もポイントを獲得していませんが、あなたが最初に獲得しますか?"
#: events/templates/events/event_pwd.html:15
#: events/templates/events/join_team.html:22
msgid "Wrong password submited."
msgstr ""
msgstr "パスワードが違います。"
#: events/templates/events/event_pwd.html:20
msgid "This event is password protected"
msgstr ""
msgstr "このイベントはパスワードで保護されています。"
#: events/templates/events/event_pwd.html:21
msgid "You need to submit the event password to gain access to this event."
msgstr ""
"このイベントにアクセスするには、イベントのパスワードを送信する必要がありま"
"す。"
#: events/templates/events/events_list.html:6 templates/base.html:61
msgid "Events"
msgstr ""
msgstr "イベント"
#: events/templates/events/events_list.html:38
msgid "See more"
msgstr ""
msgstr "もっと見る"
#: events/templates/events/events_list.html:44
msgid "No events available."
msgstr ""
msgstr "該当するイベントはありません。"
#: events/templates/events/join_team.html:20
msgid "Team does not exist."
msgstr ""
msgstr "チームが存在しません。"
#: events/templates/events/join_team.html:24
msgid "Maximum size reached."
msgstr ""
msgstr "最大サイズに達しました。"
#: events/templates/events/manage_team.html:26
msgid "Team password"
msgstr ""
msgstr "チームのパスワード"
#: events/templates/events/manage_team.html:44
#: events/templates/events/team.html:49
msgid "Members"
msgstr ""
msgstr "メンバー"
#: events/templates/events/manage_team.html:52
msgid "Leave Team"
msgstr ""
msgstr "チームを離れる"
#: events/templates/events/manage_team.html:59
msgid "Open to automatching"
msgstr ""
msgstr "自動マッチングにする"
#: events/templates/events/manage_team.html:66
msgid "Close to automatching"
msgstr ""
msgstr "自動マッチングをやめる"
#: events/templates/events/team.html:38
msgid "It seems that this team has not solved any challenge yet..."
msgstr ""
msgstr "このチームは、まだ何も課題を解いていないようです..."
#: home/templates/home/home.html:21
msgid "Weekly Top 5"
msgstr ""
msgstr "週間トップ5"
#: home/templates/home/home.html:48
msgid "No article available."
msgstr ""
msgstr "記事はありません。"
#: home/templates/home/home.html:53
msgid "Latest challenges added"
msgstr ""
msgstr "最新の追加課題"
#: home/templates/home/home.html:58
msgid "points"
msgstr ""
msgstr "ポイント"
#: home/templates/home/home.html:62
msgid "No ctf available."
msgstr ""
msgstr "取り組めるctfはありません。"
#: home/templates/home/home.html:66
msgid "Latest Flags"
msgstr ""
msgstr "最新のフラグ"
#: home/templates/home/home.html:80
msgid "Flags"
msgstr ""
msgstr "フラグ"
#: home/templates/home/home.html:86
msgid "Users"
msgstr ""
msgstr "ユーザー"
#: project/settings.py:115
msgid "English"
msgstr ""
msgstr "英語"
#: project/settings.py:116
msgid "German"
msgstr ""
msgstr "ドイツ語"
#: project/settings.py:117
msgid "French"
msgstr ""
msgstr "フランス語"
#: project/settings.py:118
msgid "Russian"
msgstr ""
msgstr "ロシア語"
#: project/settings.py:119
msgid "Japanese"
msgstr ""
msgstr "日本語"
#: project/settings.py:120
msgid "Spanish"
msgstr ""
msgstr "スペイン語"
#: scoreboard/templates/scoreboard/scoreboard.html:38
msgid "First"
msgstr ""
msgstr "最初"
#: scoreboard/templates/scoreboard/scoreboard.html:39
msgid "Previous"
msgstr ""
msgstr ""
#: scoreboard/templates/scoreboard/scoreboard.html:43
msgid "Page "
msgstr ""
msgstr "ページ"
#: scoreboard/templates/scoreboard/scoreboard.html:47
msgid "Next"
msgstr ""
msgstr ""
#: scoreboard/templates/scoreboard/scoreboard.html:48
msgid "Last"
msgstr ""
msgstr "最後"
#: templates/base.html:59
msgid "Scoreboard"
msgstr ""
msgstr "スコアボード"
#: templates/base.html:64
msgid "Resources"
msgstr ""
msgstr "リソース"
#: templates/base.html:93
msgid "Logout"
msgstr ""
msgstr "ログアウト"
#: templates/base.html:100
msgid "Sign Up"
msgstr ""
msgstr "サインアップ"
#: templates/base.html:135
msgid "Become a Patron!"
msgstr ""
msgstr "支援者になる!"
#: templates/registration/password_reset_complete.html:11
msgid "Your new password has been set."
msgstr ""
msgstr "新しいパスワードが設定されました。"
#: templates/registration/password_reset_confirm.html:20
msgid "Your password cant be too similar to your other personal information."
msgstr ""
msgstr "パスワードは、自身の個人情報と似すぎていてはいけません。"
#: templates/registration/password_reset_confirm.html:21
msgid "Your password must contain at least 8 characters."
msgstr ""
msgstr "パスワードには8文字以上が必要です。"
#: templates/registration/password_reset_confirm.html:22
msgid "Your password cant be a commonly used password."
msgstr ""
msgstr "パスワードは、一般的に使われているものを使用しないでください。"
#: templates/registration/password_reset_confirm.html:23
msgid "Your password cant be entirely numeric."
msgstr ""
msgstr "パスワードはすべて数字にはできません。"
#: templates/registration/password_reset_confirm.html:26
msgid "Confirm"
msgstr ""
msgstr "確認"
#: templates/registration/password_reset_confirm.html:28
msgid "Submit"
msgstr ""
msgstr "送信"
#: templates/registration/password_reset_done.html:11
msgid ""
"We've emailed you instructions for setting your password. You should receive "
"the email shortly!"
msgstr ""
"パスワードの設定方法をメールでお送りしました。まもなくメールが届くはずです!"
#: templates/registration/password_reset_form.html:16
msgid "Reset"
msgstr ""
msgstr "リセット"

View File

@ -38,6 +38,7 @@ INSTALLED_APPS = [
'scoreboard.apps.ScoreboardConfig',
'resources.apps.ResourcesConfig',
'django.contrib.sites',
'api.apps.ApiConfig',
]
MIDDLEWARE = [

View File

@ -24,6 +24,7 @@ urlpatterns = [
path('', include('home.urls')),
path('set_lang/<str:lang_code>', home.views.set_language, name="set_language"),
path('dashboard/secret/admin', admin.site.urls),
path('api/', include('api.urls'))
]
urlpatterns += i18n_patterns(

View File

@ -20,11 +20,11 @@ msgstr ""
#: resources/templates/resources/42ctf.html:7
msgid "What is 42CTF ?"
msgstr ""
msgstr "42CTFとは"
#: resources/templates/resources/42ctf.html:10
msgid "A short introduction to CTF"
msgstr ""
msgstr "CTFについての簡単な紹介"
#: resources/templates/resources/42ctf.html:11
msgid ""
@ -32,144 +32,172 @@ msgid ""
"participants have to solve challenges of various categories to gain points "
"and progress on the scoreboard."
msgstr ""
"42CTFとは、Capture The Flagの略です。サイバーセキュリティの競技会のことで、参"
"加者は様々なカテゴリーの課題を解決してポイントを獲得し、スコアボードでの順位"
"を上げていきます。"
#: resources/templates/resources/42ctf.html:12
msgid ""
"The challenges require participants to find sort of passwords called \"flags"
"\" and to submit them on the platform."
msgstr ""
"この課題では、参加者は\"フラグ\"と呼ばれるパスワードを見つけて、プラット"
"フォームに送信することになっています。"
#: resources/templates/resources/42ctf.html:15
msgid "Functionment of 42CTF"
msgstr ""
msgstr "42CTFの機能紹介"
#: resources/templates/resources/42ctf.html:16
msgid "42CTF is what we call a permanent CTF."
msgstr ""
msgstr "42CTFは、いわゆる永続的CTFです。"
#: resources/templates/resources/42ctf.html:17
msgid "Except from the"
msgstr ""
msgstr "こちらを除き"
#: resources/templates/resources/42ctf.html:17
msgid "events"
msgstr ""
msgstr "(イベント)"
#: resources/templates/resources/42ctf.html:17
msgid "challenges are available on the platform without time limitations."
msgstr ""
msgstr "時間制限なしにプラットフォーム上でチャレンジ可能です。"
#: resources/templates/resources/42ctf.html:18
msgid "The registration on 42CTF is open to everyone, 42 students or not."
msgstr ""
msgstr "42CTFへの登録は、42の学生であるかどうかに関わらず、誰でも可能です。"
#: resources/templates/resources/42ctf.html:19
msgid ""
"Events may or may not be open. If you would like to organize an event on "
"42CTF, feel free to contact us."
msgstr ""
"イベントは開催する場合としない場合があります。42CTFでのイベント開催をご希望の"
"方は、お気軽にお問い合わせください。"
#: resources/templates/resources/42ctf.html:22
msgid "42CTF Team"
msgstr ""
msgstr "42CTFチーム"
#: resources/templates/resources/42ctf.html:23
msgid "42CTF is managed by 42 students."
msgstr ""
msgstr "42CTFは42の学生によって運営されています。"
#: resources/templates/resources/42ctf.html:24
msgid "You can meet the team on"
msgstr ""
msgstr "こちらでチームに会えます:"
#: resources/templates/resources/42ctf.html:25
msgid ""
"Challenges are created by various contributors, not necessarily 42 students."
msgstr ""
msgstr "課題は42の学生だけではなく、様々な協力者によって作られます。"
#: resources/templates/resources/42ctf.html:26
msgid ""
"Anyone is welcome to submit their own challenges, either on the permanent "
"CTF or for a specific event."
msgstr ""
"常設のCTFでも、特定のイベントでも、誰でも自身が作成した課題を提出することがで"
"きます。"
#: resources/templates/resources/create_challenge.html:7
msgid "Create new challenges"
msgstr ""
msgstr "新しい課題を作成する"
#: resources/templates/resources/create_challenge.html:10
msgid "If you want to create new challenges for 42CTF, send us a message on "
msgstr ""
"42CTFの新しい課題を作成したい方は、こちらでメッセージを送ってください"
#: resources/templates/resources/create_challenge.html:11
msgid "If your challenge is offline, then you don't have to ask us in advance."
msgstr ""
msgstr "オフラインでの課題であれば、事前にご相談いただく必要はありません。"
#: resources/templates/resources/create_challenge.html:12
msgid ""
"If your challenge is online (for example web or pwn), then you should give "
"us a short description of what you want to do."
msgstr ""
"課題がオンラインの場合webやpwn、何をしたいのかを簡単に説明してくださ"
"い。"
#: resources/templates/resources/create_challenge.html:13
msgid ""
"We may be able to help you or to give you resources such as dockerfiles."
msgstr ""
"私たちがお手伝いをさせていただいたり、dockerfileなどのリソースを提供させてい"
"ただく場合があります。"
#: resources/templates/resources/create_challenge.html:14
msgid "We plan to make those resources publicly available in a near future."
msgstr ""
msgstr "近日、これらのリソースを公開する予定です。"
#: resources/templates/resources/donate.html:7
msgid "Donate"
msgstr ""
msgstr "寄付"
#: resources/templates/resources/donate.html:10
msgid "Become a 42CTF member"
msgstr ""
msgstr "42CTFのメンバーになる"
#: resources/templates/resources/donate.html:11
msgid ""
"42CTF is a non-profit organization with a legal status under the french law "
"(Association loi 1901)."
msgstr ""
"42CTFは、フランスの法律Association loi 1901に基づく法的地位を有する非営利"
"団体です。"
#: resources/templates/resources/donate.html:12
msgid "You can support us by becoming a member and paying a fee of 15 euros."
msgstr ""
"メンバーになって、15ユーロの会費を払うことで、私たちをサポートすることができ"
"ます。"
#: resources/templates/resources/donate.html:13
msgid "Membership is then granted for 1 year."
msgstr ""
msgstr "その後、1年間のメンバーシップが付与されます。"
#: resources/templates/resources/donate.html:15
msgid "When you become a member, you gain the following advantages:"
msgstr ""
msgstr "会員になると、以下のようなメリットがあります:"
#: resources/templates/resources/donate.html:16
msgid ""
"A different color for your pseudo in the scoreboard, to let everyone know "
"you're a member."
msgstr ""
"スコアボードに表示されるアカウント名の色が変わり、メンバーであることが誰にで"
"もわかるように。"
#: resources/templates/resources/donate.html:17
msgid ""
"The possibility to play again past CTF, with challenges no longer available, "
"in the form of private events with the people of your choice."
msgstr ""
"チャレンジができなくなった過去のCTFを、好きな人とプライベートイベントの形で再"
"びチャレンジできる可能性。"
#: resources/templates/resources/donate.html:18
msgid ""
"Ex: you played Welcome CTF 2021, and want to play it again with your friends "
"during one weekend."
msgstr ""
"例Welcome CTF 2021 に一度チャレンジして、週末に友達ともう一度チャレンジした"
"いと思っている方。"
#: resources/templates/resources/donate.html:19
msgid "Or you didn't play Welcome CTF 2021 because you were not eligible."
msgstr ""
"または、Welcome CTF 2021 への参加資格がなかったため、チャレンジできなかった"
"方。"
#: resources/templates/resources/donate.html:22
msgid "More advantages may come later, and you can submit us your ideas."
msgstr ""
"もっと多くの利点があるかもしれませんし、あなたのアイデアを私たちに提供してい"
"ただくことも可能です。"
#: resources/templates/resources/donate.html:23
msgid ""
@ -177,91 +205,105 @@ msgid ""
"will be equivalent to organize paid events, and we want 42CTF to remain FREE "
"for all."
msgstr ""
"しかし、メンバーのみ参加できる期間限定CTFを開催することはありません。これは、"
"有料のイベントを開催することと同義であり、私たちは42CTFがすべての人にとって無"
"料であることを望んでいます。"
#: resources/templates/resources/donate.html:26
msgid "Donate to 42CTF"
msgstr ""
msgstr "42CTFに寄付する"
#: resources/templates/resources/donate.html:27
msgid ""
"You can donate to 42CTF or pay your membership with the following means:"
msgstr ""
"42CTFへのご寄付やメンバーシップのお支払いは、以下の手段で行うことができます"
#: resources/templates/resources/donate.html:46
msgid ""
"If you would like us to add another payment method or if you want to pay in "
"cash, send us a message !"
msgstr ""
"他のお支払い方法や現金でのお支払いをご希望の場合は、メッセージをお送りくださ"
"い。"
#: resources/templates/resources/donate.html:48
msgid ""
"If you're paying for your membership, don't forget to send us your first and "
"last name, as well as your 42CTF pseudo."
msgstr ""
"メンバーシップをお支払いになる場合は、氏名と42CTFのアカウント名を忘れずにお送"
"りください。"
#: resources/templates/resources/donate.html:49
msgid ""
"We will only use thoe data to keep track of our members and grant you "
"advantages, and we will never communicate them to any third party."
msgstr ""
"これらのデータは、メンバーの管理と特典の付与のためにのみ使用し、第三者に提供"
"することはありません。"
#: resources/templates/resources/edit.html:7
msgid "Edit this page"
msgstr ""
msgstr "このページの編集"
#: resources/templates/resources/edit.html:12
msgid ""
"More information coming soon, but as you can guess it involves making a pull "
"request to your favorite"
msgstr ""
"詳細は近日中にお知らせしますが、お察しの通り、以下にプルリクエストをすること"
"になります:"
#: resources/templates/resources/tools.html:7
msgid "Recommended Tools"
msgstr ""
msgstr "おすすめのツール"
#: resources/templates/resources/tools.html:10
msgid "To get you started, we built a VM that you can simply import in"
msgstr ""
msgstr "手始めに、Virtual BoxでインストールするだけのVMを構築しました"
#: resources/templates/resources/tools.html:10
msgid "with a bunch of useful tools."
msgstr ""
msgstr "便利なツールを使用しました。"
#: resources/templates/resources/tools.html:11
msgid "You can dowload this OVA"
msgstr ""
msgstr "このOVAはこちらからダウンロードできます"
#: resources/templates/resources/tools.html:11
msgid "here"
msgstr ""
msgstr "こちら"
#: resources/templates/resources/tools.html:13
msgid "Here are the tools installed on the VM:"
msgstr ""
msgstr "以下に、VMにインストールされたツールを紹介します"
#: resources/templates/resources/tools.html:22
msgid ""
"If you want to solve the challenges on your own machine, we recommend you to "
"use a Linux operating system."
msgstr ""
"自分のマシンで課題にチャレンジしたい場合は、Linux OSを使用することをお勧めし"
"ます。"
#: resources/templates/resources/tools.html:23
msgid ""
"Most of the reverse challenges are ELF binaries and won't run on Mac OS or "
"Windows."
msgstr ""
msgstr "ReversingのほとんどはELFバイナリで、Mac OSやWindowsでは動作しません。"
#: resources/templates/resources/tools.html:25
msgid "Additionnaly, you will need the following languages interpreters:"
msgstr ""
msgstr "さらに、以下の言語のインタプリタが必要です。"
#: resources/templates/resources/translate.html:7
msgid "Translate 42CTF"
msgstr ""
msgstr "42CTFを翻訳"
#: resources/templates/resources/translate.html:10
msgid "42CTF source code is publicly available on this"
msgstr ""
msgstr "42CTFのソースコードはこのサイトで公開されています。"
#: resources/templates/resources/translate.html:11
msgid ""
@ -269,21 +311,27 @@ msgid ""
"contribute if you want to help us, by making the platform always more "
"accessible."
msgstr ""
"翻訳にはプログラミングのスキルは必要ありません。プラットフォームをより使いや"
"すくすることで、私たちに貢献したいとお考えの方には良い方法です。"
#: resources/templates/resources/translate.html:12
msgid "We have a"
msgstr ""
msgstr "こちらがあります。:"
#: resources/templates/resources/translate.html:12
msgid ""
"describing how to translate pages with the Django internalization module."
msgstr ""
"djangoのinternalizationモジュールを使ってページを翻訳する方法を説明したもので"
"す。"
#: resources/templates/resources/translate.html:13
msgid ""
"We invite you to read it to know all the details, but it merely requires you "
"to edit text files, so you see, no programming skills required ;)"
msgstr ""
"詳細はぜひ読んでいただきたいのですが、単にテキストファイルを編集するだけなの"
"で、プログラミングのスキルは必要ありません ;)"
#: resources/templates/resources/translate.html:14
msgid ""
@ -291,7 +339,10 @@ msgid ""
"then open a pull request so that we can merge your contributions into our "
"repository."
msgstr ""
"gitリポジトリをフォークしていただき、変更を加えてプッシュし、プルリクエストを"
"作成していただくことで、皆さんの貢献を私たちのリポジトリにマージすることがで"
"きます。"
#: resources/templates/resources/translate.html:15
msgid "Don't hesitate to reach for help on"
msgstr ""
msgstr "躊躇せずに、こちらで助けを求めてください。:"