Add support for variables in translation (#250)

This commit is contained in:
Pierre Rudloff 2019-11-29 21:33:49 +01:00
parent 6fb1cbaa6c
commit 850fc80622
8 changed files with 145 additions and 101 deletions

View file

@ -1,18 +1,40 @@
</div>
<footer class="small-font">
<div class="footer_wrapper">
{t}Code by{/t} <a rel="author" target="blank"
href="http://rudloff.pro/">Pierre Rudloff</a>
&middot; {t}Design by{/t}
<a rel="author" target="blank"
href="http://olivierhaquette.fr">Olivier Haquette</a>
&middot;
<a rel="noopener" target="_blank" href="https://github.com/Rudloff/alltube">{t}Get the code{/t}</a>
&middot;
{t}Based on{/t} <a href="http://rg3.github.io/youtube-dl/">youtube-dl</a>
&middot;
<a rel="noopener" target="_blank" title="{t}Donate using Liberapay{/t}" href="https://liberapay.com/Rudloff/donate">{t}Donate{/t}</a>
</div>
{$dev="<a rel='author' target='blank'
href='http://rudloff.pro/'>
Pierre Rudloff
</a>"}
{t params=['@dev'=>$dev]}Code by @dev{/t}
&middot;
{$designer="<a rel='author' target='blank'
href='http://olivierhaquette.fr'>
Olivier Haquette
</a>"}
{t params=['@designer' => $designer]}Design by @designer{/t}
&middot;
<a rel="noopener" target="_blank" href="https://github.com/Rudloff/alltube">
{t}Get the code{/t}
</a>
&middot;
{$youtubedl="<a href='http://rg3.github.io/youtube-dl/'>
youtube-dl
</a>"}
{t params=['@youtubedl'=>$youtubedl]}Based on @youtubedl{/t}
&middot;
<a rel="noopener" target="_blank" title="{t}Donate using Liberapay{/t}"
href="https://liberapay.com/Rudloff/donate">
{t}Donate{/t}
</a>
</div>
</footer>
</body>
</html>

View file

@ -5,7 +5,7 @@
{if isset($locale) AND $locale->getCountry()}
{$locale->getCountry()->getEmoji()}
{else}
Set language
{t}Set language{/t}
{/if}
</button>
<ul class="supportedLocales">

View file

@ -3,10 +3,14 @@
<div itemscope itemtype="http://schema.org/VideoObject">
<main class="main">
{include file="inc/logo.tpl"}
<p id="download_intro">{t}You are going to download{/t}<i itemprop="name">
<a itemprop="url" id="video_link"
href="{$video->webpage_url}">
{$video->title}</a></i>.
{$title="<i itemprop='name'>
<a itemprop='url' id='video_link'
href='{$video->webpage_url}'>
{$video->title}
</a>
</i>"}
<p id="download_intro">
{t params=['@title' => $title]}You are going to download @title.{/t}
</p>
{if isset($video->thumbnail)}
<img itemprop="thumbnailUrl" class="thumb" src="{$video->thumbnail}" alt="" />
@ -79,14 +83,14 @@
{if $config->convertAdvanced}
<input type="checkbox" name="customConvert" id="customConvert"/>
<label for="customConvert">{t}Convert into a custom format:{/t}</label>
<select title="Custom format" name="customFormat" aria-label="{t}Format to convert to{/t}">
<select title="{t}Custom format{/t}" name="customFormat" aria-label="{t}Format to convert to{/t}">
{foreach $config->convertAdvancedFormats as $format}
<option>{$format}</option>
{/foreach}
</select>
{t}with{/t}
<label for="customBitrate" class="sr-only">{t}Bit rate{/t}</label>
<input type="number" value="{$config->audioBitrate}" title="Custom bitrate" class="customBitrate"
<input type="number" value="{$config->audioBitrate}" title="{t}Custom bitrate{/t}" class="customBitrate"
name="customBitrate" id="customBitrate" aria-describedby="customBitrateUnit" />
<span id="customBitrateUnit">{t}kbit/s audio{/t}</span>
<br/><br/>

View file

@ -2,10 +2,18 @@
<div class="wrapper">
<main class="main">
{include file="inc/logo.tpl"}
<p>{t}Videos extracted from{/t} {if isset($video->title)}<i>
<a href="{$video->webpage_url}">
{$video->title}</a></i>{/if}{t}:{/t}
</p>
{if isset($video->title)}
{$title="<i>
<a href='{$video->webpage_url}'>
{$video->title}
</a>
</i>"}
<p>
{t params=['@title'=>$title]}Videos extracted from @title:{/t}
</p>
{/if}
{if $config->stream}
<a href="{path_for name="download"}?url={$video->webpage_url}" class="downloadBtn">Download everything</a>
{/if}