i18n support

This commit is contained in:
loicbersier 2020-01-24 15:28:26 +01:00
parent 05d9f2c422
commit 84c4b791e1

View file

@ -19,7 +19,7 @@
@if(announcement || (day == '24' || day == '25') && month == '11') @if(announcement || (day == '24' || day == '25') && month == '11')
<div class="announcements"> <div class="announcements">
@if((day == '24' || day == '25') && month == '11') @if((day == '24' || day == '25') && month == '11')
<p>Happy christmas!</p> <p>{{ antl.formatMessage('messages.eggXmas') }}</p>
@endif @endif
<p>{{ announcement }}</p> <p>{{ announcement }}</p>
<p>This part of the website is <strong>legacy</strong> which mean it can be broken at any time!</p> <p>This part of the website is <strong>legacy</strong> which mean it can be broken at any time!</p>
@ -29,23 +29,21 @@
<h1 class="title">{{ title }} (legacy)</h1> <h1 class="title">{{ title }} (legacy)</h1>
<form name="download-form" method="POST" action="/legacy"> <form name="download-form" method="POST" action="/legacy">
{{ csrfField() }} {{ csrfField() }}
<label for="small">{{ antl.formatMessage('messages.LQ') }}</label>
<label for="small">Worst quality</label>
<input type="radio" name="quality" id="small" value="small"> <input type="radio" name="quality" id="small" value="small">
<label for="high">Best quality</label> <label for="high">{{ antl.formatMessage('messages.HQ') }}</label>
<input type="radio" name="quality" id="high" value="high" checked> <input type="radio" name="quality" id="high" value="high" checked>
<label for="alt">Alternate download?</label> <label for="alt">{{ antl.formatMessage('messages.altDL') }}</label>
<input type="checkbox" name="alt" id="alt" title="Use this if download dosen't work"> <input type="checkbox" name="alt" id="alt" title="Use this if download dosen't work">
<label for="feed">Hide from feed?</label> <label for="feed">{{ antl.formatMessage('messages.feed') }}</label>
<input type="checkbox" name="feed" id="feed" title="Chcek this to hide the video from public feed"> <input type="checkbox" name="feed" id="feed" title="Chcek this to hide the video from public feed">
<br> <br>
<br> <br>
<input type="text" id="URL" name="URL" class="downloadurl"><button type="button" class="downloadbtn" id="button" onclick="submitDownload()">Download that mf video</button> <input type="text" id="URL" name="URL" class="downloadurl"><button type="button" class="downloadbtn" id="button" onclick="submitDownload()">{{ antl.formatMessage('messages.download') }}</button>
<br> <br>
<br> <br>
@ -69,8 +67,12 @@
</body> </body>
<footer> <footer>
<p>I decline any responsabilities for download made using this website.</p> <p>{{ antl.formatMessage('messages.footer') }}</p>
<p>Credit to <a href="https://github.com/rg3/youtube-dl/">youtube-dl</a> - My other project <a href="https://discordapp.com/oauth2/authorize?client_id=377563711927484418&scope=bot&permissions=0">Haha yes</a> - Numbers of visits: {{ viewCounter }} - Contact Supositware#1616 if you have any issues</p> @if(antl._locale == 'ar')
<bdi><p>{{ antl.formatMessage('messages.footer2p1') }} <a href="https://github.com/rg3/youtube-dl/">youtube-dl</a> - {{ antl.formatMessage('messages.footer2p2') }} <a href="https://discordapp.com/oauth2/authorize?client_id=377563711927484418&scope=bot&permissions=0">Haha yes</a> - {{ antl.formatMessage('messages.footer2p3') }}: {{ viewCounter }} - {{ antl.formatMessage('messages.footer2p4') }} <a href="https://discord.gg/cNRh5JQ">Supositware#1616</a> {{ antl.formatMessage('messages.footer2p5') }}</p></bdi>
@else
<p>{{ antl.formatMessage('messages.footer2p1') }} <a href="https://github.com/rg3/youtube-dl/">youtube-dl</a> - {{ antl.formatMessage('messages.footer2p2') }} <a href="https://discordapp.com/oauth2/authorize?client_id=377563711927484418&scope=bot&permissions=0">Haha yes</a> - {{ antl.formatMessage('messages.footer2p3') }}: {{ viewCounter }} - {{ antl.formatMessage('messages.footer2p4') }} <a href="https://discord.gg/cNRh5JQ">Supositware#1616</a> {{ antl.formatMessage('messages.footer2p5') }}</p>
@endif
<p><a href="/">Return to main page</a></p> <p><a href="/">Return to main page</a></p>
</footer> </footer>
@if(month == '11') @if(month == '11')
@ -103,7 +105,7 @@
console.log('clicked') console.log('clicked')
let frm = document.getElementsByName('download-form')[0]; let frm = document.getElementsByName('download-form')[0];
frm.submit(); frm.submit();
document.getElementById('msg').innerHTML = 'Download started!' document.getElementById('msg').innerHTML = '{{ antl.formatMessage('messages.dlStart') }}'
frm.reset(); frm.reset();
return false; return false;
} }