1
0
Fork 0
forked from deblan/gist

Compare commits

...

5 commits

7 changed files with 159 additions and 43 deletions

View file

@ -416,3 +416,4 @@ Contributors
* Marjorie Da Silva
* Mélanie Chanat
* Showfom
* Tavin

View file

@ -11,7 +11,7 @@ use Symfony\Component\HttpFoundation\Cookie;
$app->register(new TranslationServiceProvider(), array(
'locale' => 'en',
'locale_fallback' => 'en',
'locales' => array('en', 'fr', 'es', 'de', 'cn'),
'locales' => array('en', 'fr', 'es', 'de', 'cn', 'pl'),
));
$app['translator'] = $app->extend('translator', function ($translator, $app) {

108
app/locales/pl.yml Normal file
View file

@ -0,0 +1,108 @@
app:
title: '#!GIST'
title_prefix: '#!GIST - '
menu:
home:
title: 'Home'
about:
title: 'O projekcie'
my:
login:
title: 'Logowanie'
logout:
title: 'Wylogowanie'
register:
title: 'Rejestracja'
my:
title: 'Konta'
my:
title: 'Moje wklejki'
nothing: 'Nie ma jeszcze nic!'
api:
title: 'API'
warning: 'Trzymaj to w <strong>sekrecie!</strong>'
form:
generate: 'Wygeneruj nowy'
gist:
untitled: 'Bez tytułu'
404:
title: 'Oops!'
message: 'Wklejka nie została znaleziona...'
action:
view: 'Podgląd'
history: 'Commit(s)'
raw: 'RAW'
download: 'Pobierz'
clone: 'Sklonuj'
embed: 'Embed'
add: 'Nowa'
date:
format: 'Y-m-d h:i:s'
footer:
text: '<p>Napędzane przez <a href="https://gitnet.fr/deblan/gist">GIST</a>, to jest open source :) - <a href="https://gitnet.fr/deblan/gist#api">API</a></p>'
login:
login:
title: 'Logowanie'
invalid: 'Nie prawidłowy login lub hasło.'
form:
username:
placeholder: 'Login'
password:
placeholder: 'Hasło'
remember_me:
label: 'Pamiętaj'
register:
title: 'Nowe konto'
already_exists: 'Ta nazwa użytkownika jest już zarejestrowana!'
registred: 'Gratulacje, twoje konto zostało utworzone!'
form:
username:
placeholder: 'Login'
current_password:
placeholder: 'Obecne hasło'
password:
placeholder: 'Hasło'
form:
error:
password: 'Nie prawidłowe hasło.'
not_blank: 'To pole nie powinno być puste!'
title:
placeholder: 'Tytuł'
cipher:
label: 'Szyfrowanie: %value%'
choice:
anyway: 'Tak czy inaczej'
yes: 'Tak'
no: 'Nie'
submit: 'Wyślij'
filter: 'Filtr'
confirm: 'Potwierdzasz?'
success:
password: 'Hasło zostało zaktualizowane.'
gist: 'Wklejka została usunięta.'
type:
label: 'Język: %value%'
choice:
all: 'All'
html: 'HTML'
xml: 'XML'
css: 'CSS'
javascript: 'JAVASCRIPT'
php: 'PHP'
sql: 'SQL'
yaml: 'YAML'
perl: 'PERL'
c: 'C/C++'
asp: 'ASP'
python: 'PYTHON'
bash: 'BASH'
actionscript3: 'ACTION SCRIPT'
text: 'TEXT'

View file

@ -1,4 +1,7 @@
{
"name": "deblan/gist",
"license": "GPL-3.0-only",
"type": "project",
"require": {
"silex/silex": "1.3.x-dev",
"symfony/yaml": "~2.6",

View file

@ -88,7 +88,7 @@ class Client extends BaseClient
public function update($gist, $content)
{
$response = $this->post(
str_replace('{gist}', $gist, $this->mergeApiKey(self::LIST)),
str_replace('{gist}', $gist, $this->mergeApiKey(self::UPDATE)),
array(
'form_params' => array(
'form' => array(

View file

@ -158,12 +158,16 @@ class ApiController extends Controller
return $this->invalidMethodResponse('POST method is required.');
}
$gist = GistQuery::create()
->filterByCipher(false)
->filterById((int) $gist)
->_or()
->filterByFile($gist)
->findOne();
$query = GistQuery::create()
->filterByCipher(false);
if (ctype_digit($gist)) {
$query->filterById((int) $gist);
} else {
$query->filterByFile($gist);
}
$gist = $query->findOne();
if (!$gist) {
return $this->invalidRequestResponse('Invalid Gist');

View file

@ -81,7 +81,7 @@
</ul>
{% block langs %}
<p class="navbar-text navbar-right">
{% for locale, flag in {'en': 'gb', 'fr': 'fr', 'es': 'es', 'de': 'de', 'cn': 'cn'} %}
{% for locale, flag in {'en': 'gb', 'fr': 'fr', 'es': 'es', 'de': 'de', 'cn': 'cn', 'pl': 'pl'} %}
<a class="lang btn btn-xs cipher-link" href="{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')|merge({_locale: locale})) }}">
<span class="flag-icon flag-icon-{{ flag }}"></span>
</a>