Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update translation prefix #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/NekoWiki/Controller/User/RegistrationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ public function registerAction(Request $request)

$this->persistAndFlush($user);

$this->setFlash('success', 'app.user.registration.success');
$this->setFlash('success', 'neko_wiki.user.registration.success');

return $this->redirectToRoute('homepage_by_lang', ['_locale' => $this->getCurrentLocale()]);
}

$this->setFlash('error', 'app.user.registration.error');
$this->setFlash('error', 'neko_wiki.user.registration.error');

return $this->render('NekoWiki:User:register.html.twig', ['form' => $form->createView()]);
}
Expand Down
4 changes: 2 additions & 2 deletions src/NekoWiki/Form/PageTranslationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public function buildForm(FormBuilderInterface $builder, array $options)

if ($translation === null || (!empty($translation) && $translation->getId() === null) ) {
$builder->add('title', null, [
'label' => 'app.page.form.title'
'label' => 'neko_wiki.page.form.title'
]);
}
$builder->add('content', null, [
'label' => 'app.page.form.content'
'label' => 'neko_wiki.page.form.content'
]);
$builder->add('locale', 'hidden');
});
Expand Down
10 changes: 5 additions & 5 deletions src/NekoWiki/Form/RegistrationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('username', null, [
'label' => 'app.user.registration.form.username'
'label' => 'neko_wiki.user.registration.form.username'
])
->add('password', 'repeated', [
'type' => 'password',
'first_options' => [
'label' => 'app.user.registration.form.password'
'label' => 'neko_wiki.user.registration.form.password'
],
'second_options' => [
'label' => 'app.user.registration.form.password_repeat'
'label' => 'neko_wiki.user.registration.form.password_repeat'
]
])
->add('email', null, [
'label' => 'app.user.registration.form.email'
'label' => 'neko_wiki.user.registration.form.email'
])
->add('submit', 'submit', [
'label' => 'app.user.registration.form.submit'
'label' => 'neko_wiki.user.registration.form.submit'
])
;
}
Expand Down
2 changes: 1 addition & 1 deletion src/NekoWiki/Resources/translations/messages.en.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
app:
neko_wiki:
user:
logout: Logout
admin: Administration
Expand Down
2 changes: 1 addition & 1 deletion src/NekoWiki/Resources/translations/messages.fr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
app:
neko_wiki:
user:
logout: Déconnexion
admin: Administration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% if translations | length > 1 %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans %}app.page.menu.other_translations{% endtrans %} <span class="caret"></span></a>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans %}neko_wiki.page.menu.other_translations{% endtrans %} <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
{% for translation in translations %}
{% if languages[translation.locale] is defined %}
Expand Down
4 changes: 2 additions & 2 deletions src/NekoWiki/Resources/views/Page/_page_form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="pull-right">
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown">
{% trans %}app.page.form.add_translation{% endtrans %}
{% trans %}neko_wiki.page.form.add_translation{% endtrans %}
<span class="caret"></span>
</button>
<ul class="dropdown-menu" id="languages-form-list" role="language" aria-labelledby="Languages selection">
Expand Down Expand Up @@ -43,7 +43,7 @@
) }}
{% endfor %}

<button type="submit" class="btn btn-primary">{% trans %}app.page.form.submit{% endtrans %}</button>
<button type="submit" class="btn btn-primary">{% trans %}neko_wiki.page.form.submit{% endtrans %}</button>
</div>
{{ form_end(form) }}
</div>
4 changes: 2 additions & 2 deletions src/NekoWiki/Resources/views/Page/_translation_form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

<div class="form-group">
{% if template is not defined and translation.title is defined %}
{{ form_label(translation.title, 'app.page.form.title' | trans({'%lang%': translation.locale.vars.value})) }}
{{ form_label(translation.title, 'neko_wiki.page.form.title' | trans({'%lang%': translation.locale.vars.value})) }}
{{ form_widget(translation.title, { 'attr': { 'class': 'form-control' } }) }}
{% endif %}
</div>

<div class="form-group">
{% if template is not defined %}
{{ form_label(translation.content, 'app.page.form.content' | trans({'%lang%': translation.locale.vars.value})) }}
{{ form_label(translation.content, 'neko_wiki.page.form.content' | trans({'%lang%': translation.locale.vars.value})) }}
{{ form_widget(translation.content, { 'attr': { 'class': 'form-control page-content' } }) }}
{% endif %}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/NekoWiki/Resources/views/Page/edit.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'NekoWiki::page_layout.html.twig' %}

{% block body %}
<h1>{% trans with {'%pagename%': page.title} %}app.page.crud.updating{% endtrans %}</h1>
<h1>{% trans with {'%pagename%': page.title} %}neko_wiki.page.crud.updating{% endtrans %}</h1>
{{ include('NekoWiki:Page:_page_form.html.twig', {'form': form}) }}
{% endblock %}
2 changes: 1 addition & 1 deletion src/NekoWiki/Resources/views/Page/new.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'NekoWiki::layout.html.twig' %}

{% block body %}
<h1>{% trans with {'%pagename%': page.title} %}app.page.crud.creating{% endtrans %}</h1>
<h1>{% trans with {'%pagename%': page.title} %}neko_wiki.page.crud.creating{% endtrans %}</h1>
{{ include('NekoWiki:Page:_page_form.html.twig', {'form': form}) }}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
{% endif %}
</p>
<p class="description">{{ content | truncate(200) }}</p>
<p class="more">{% trans %}app.search.last_update{% endtrans %} {{ updatedAt | format_datetime }}</p>
<p class="more">{% trans %}neko_wiki.search.last_update{% endtrans %} {{ updatedAt | format_datetime }}</p>
</div>
4 changes: 2 additions & 2 deletions src/NekoWiki/Resources/views/Search/complete_form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{{ form_start(form) }}

<div class="form-group">
{{ form_widget(form.search, {'attr': { 'placeholder': 'app.search.placeholder'|trans, 'class': 'form-control input-lg' }, 'value': content } ) }}
{{ form_widget(form.search, {'attr': { 'placeholder': 'neko_wiki.search.placeholder'|trans, 'class': 'form-control input-lg' }, 'value': content } ) }}
</div>

<p class="text-center">
<button type="submit" class="btn btn-primary btn-lg">{% trans %}app.search.submit_search{% endtrans %}</button>
<button type="submit" class="btn btn-primary btn-lg">{% trans %}neko_wiki.search.submit_search{% endtrans %}</button>
</p>

{{ form_end(form) }}
Expand Down
2 changes: 1 addition & 1 deletion src/NekoWiki/Resources/views/Search/form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="input-group">
{{ form_widget(
form.search,
{ 'attr': { 'placeholder': 'app.search.placeholder' | trans, 'id': 'searchbox', 'class': 'form-control' } }
{ 'attr': { 'placeholder': 'neko_wiki.search.placeholder' | trans, 'id': 'searchbox', 'class': 'form-control' } }
) }}
<span class="input-group-btn">

Expand Down
16 changes: 8 additions & 8 deletions src/NekoWiki/Resources/views/Search/results.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

<div class="row">
<div class="col-md-offset-2 col-md-8">
<h1>{% trans %}app.search.search{% endtrans %}</h1>
<h1>{% trans %}neko_wiki.search.search{% endtrans %}</h1>
{{ render(controller('NekoWiki:Search:completeForm', {'content' : query })) }}
</div>
</div>

{% if potentialMatchPage is not empty %}
<div class="row page-lang-list">
<div class="col-md-12">
<p class="lead">{% trans %}app.search.available_in_other_languages{% endtrans %}</p>
<p class="lead">{% trans %}neko_wiki.search.available_in_other_languages{% endtrans %}</p>
</div>
</div>
<div class="row page-lang-list">
Expand All @@ -33,23 +33,23 @@
<div class="col-md-12">
<p>
{% if potentialMatchPage is empty %}
<i>{% trans %}app.search.does_not_exists{% endtrans %}</i>
<i>{% trans %}neko_wiki.search.does_not_exists{% endtrans %}</i>
{% endif %}
<i>
{{- 'app.search.create_the_page_p1'|trans -}}
{{- 'neko_wiki.search.create_the_page_p1'|trans -}}
<a href="{{ path('new_page', {'title': query|capitalize}) }}" class="non-existant">{{ query|capitalize }}</a>
{{- 'app.search.create_the_page_p2'|trans -}}
{{- 'neko_wiki.search.create_the_page_p2'|trans -}}
</i>
</p>

<h3>{% trans %}app.search.relevant{% endtrans %}</h3>
<h3>{% trans %}neko_wiki.search.relevant{% endtrans %}</h3>
{% for page in mainPager %}
{{ include(
'NekoWiki:Search:_results_list.html.twig',
{'page_slug': page.titleSlug, 'content': page.content, 'updatedAt': page.updatedAt, 'title': page.title}
) }}
{% else %}
<p class="nothing-found">{% trans %}app.search.nothing_relevant{% endtrans %}</p>
<p class="nothing-found">{% trans %}neko_wiki.search.nothing_relevant{% endtrans %}</p>
{% endfor %}
</div>
</div>
Expand All @@ -67,7 +67,7 @@
<div class="row">
<div class="col-md-12">
{% if otherLangPager.count() > 0 %}
<h3>{% trans %}app.search.in_other_languages{% endtrans %}</h3>
<h3>{% trans %}neko_wiki.search.in_other_languages{% endtrans %}</h3>
{% for page in otherLangPager %}
{{ include(
'NekoWiki:Search:_results_list.html.twig',
Expand Down
2 changes: 1 addition & 1 deletion src/NekoWiki/Resources/views/User/profile.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block body %}
<div class="row">
<div class="col-md-12">
<h1>{% trans %}app.user.profile.welcome{% endtrans %}</h1>
<h1>{% trans %}neko_wiki.user.profile.welcome{% endtrans %}</h1>
</div>
</div>
{% endblock body %}
12 changes: 6 additions & 6 deletions src/NekoWiki/Resources/views/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@

<li class="dropdown">
{% if not is_granted('ROLE_USER') %}
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans %}app.user.members{% endtrans %} <span class="caret"></span></a>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans %}neko_wiki.user.members{% endtrans %} <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="{{ path('registration') }}">{% trans %}app.user.registration.register{% endtrans %}</a></li>
<li><a href="{{ path('login') }}">{% trans %}app.user.registration.login{% endtrans %}</a></li>
<li><a href="{{ path('registration') }}">{% trans %}neko_wiki.user.registration.register{% endtrans %}</a></li>
<li><a href="{{ path('login') }}">{% trans %}neko_wiki.user.registration.login{% endtrans %}</a></li>
</ul>
{% else %}
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Me <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="{{ path('profile') }}">{% trans %}app.user.profile.profile{% endtrans %}</a></li>
<li><a href="{{ path('profile') }}">{% trans %}neko_wiki.user.profile.profile{% endtrans %}</a></li>
{% if is_granted('ROLE_ADMIN') %}
<li><a href="{{ path('admin') }}">{% trans %}app.user.admin{% endtrans %}</a></li>
<li><a href="{{ path('admin') }}">{% trans %}neko_wiki.user.admin{% endtrans %}</a></li>
{% endif %}
<li><a href="{{ path('logout') }}">{% trans %}app.user.logout{% endtrans %}</a></li>
<li><a href="{{ path('logout') }}">{% trans %}neko_wiki.user.logout{% endtrans %}</a></li>
</ul>
{% endif %}
</li>
Expand Down
4 changes: 2 additions & 2 deletions src/NekoWiki/Resources/views/page_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
{{ render(controller('NekoWiki:Page:showOtherLanguages', {'page': page})) }}

<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans %}app.page.menu.page{% endtrans %} <span class="caret"></span></a>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans %}neko_wiki.page.menu.page{% endtrans %} <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="{{ path('edit_page', {'page_slug': page.titleSlug, '_locale': page.locale}) }}">{% trans %}app.page.menu.modify{% endtrans %}</a></li>
<li><a href="{{ path('edit_page', {'page_slug': page.titleSlug, '_locale': page.locale}) }}">{% trans %}neko_wiki.page.menu.modify{% endtrans %}</a></li>
</ul>
</li>

Expand Down