mirror of
https://framagit.org/tom79/fediplan.git
synced 2025-04-05 21:51:50 +02:00
Add more words to translate
This commit is contained in:
parent
0465b89bd4
commit
22eace022c
3 changed files with 16 additions and 13 deletions
|
@ -21,5 +21,5 @@ security:
|
||||||
# Note: Only the *first* access control that matches will be used
|
# Note: Only the *first* access control that matches will be used
|
||||||
access_control:
|
access_control:
|
||||||
# - { path: ^/admin, roles: ROLE_ADMIN }
|
# - { path: ^/admin, roles: ROLE_ADMIN }
|
||||||
- { path: ^/schedule, roles: ROLE_USER }
|
- { path: ^/(en|fr)?/schedule, roles: ROLE_USER }
|
||||||
- { path: ^/scheduled, roles: ROLE_USER }
|
- { path: ^/(en|fr)?/scheduled, roles: ROLE_USER }
|
||||||
|
|
|
@ -27,15 +27,13 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
|
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route("/{_locale}", defaults={"_locale":"en"}, requirements={"_locale": "en|fr"})
|
|
||||||
*/
|
|
||||||
class FediPlanController extends AbstractController
|
class FediPlanController extends AbstractController
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route(name="index")
|
* @Route("/{_locale}",name="index", defaults={"_locale"="en"}, requirements={"_locale": "en|fr"})
|
||||||
*/
|
*/
|
||||||
public function indexAction(Request $request, AuthorizationCheckerInterface $authorizationChecker, ConnectMastodonAccountFlow $flow, Mastodon_api $mastodon_api, TranslatorInterface $translator, EventDispatcherInterface $eventDispatcher)
|
public function indexAction(Request $request, AuthorizationCheckerInterface $authorizationChecker, ConnectMastodonAccountFlow $flow, Mastodon_api $mastodon_api, TranslatorInterface $translator, EventDispatcherInterface $eventDispatcher)
|
||||||
{
|
{
|
||||||
|
@ -148,7 +146,7 @@ class FediPlanController extends AbstractController
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route("/schedule", name="schedule")
|
* @Route("/{_locale}/schedule", name="schedule", defaults={"_locale"="en"}, requirements={"_locale": "en|fr"})
|
||||||
*/
|
*/
|
||||||
public function schedule(Request $request, Mastodon_api $mastodon_api)
|
public function schedule(Request $request, Mastodon_api $mastodon_api)
|
||||||
{
|
{
|
||||||
|
@ -236,7 +234,7 @@ class FediPlanController extends AbstractController
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route("/scheduled", name="scheduled")
|
* @Route("/{_locale}/scheduled", name="scheduled", defaults={"_locale"="en"}, requirements={"_locale": "en|fr"})
|
||||||
*/
|
*/
|
||||||
public function scheduled()
|
public function scheduled()
|
||||||
{
|
{
|
||||||
|
@ -245,7 +243,7 @@ class FediPlanController extends AbstractController
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route("/scheduled/messages/{max_id}", options={"expose"=true}, name="load_more")
|
* @Route("/{_locale}/scheduled/messages/{max_id}", options={"expose"=true}, name="load_more")
|
||||||
*/
|
*/
|
||||||
public function loadMoreAction(Mastodon_api $mastodon_api, String $max_id = null){
|
public function loadMoreAction(Mastodon_api $mastodon_api, String $max_id = null){
|
||||||
|
|
||||||
|
@ -275,7 +273,7 @@ class FediPlanController extends AbstractController
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route("/scheduled/delete/messages/{id}", options={"expose"=true}, name="delete_message", methods={"POST"})
|
* @Route("/{_locale}/scheduled/delete/messages/{id}", options={"expose"=true}, name="delete_message", methods={"POST"}, defaults={"_locale"="en"}, requirements={"_locale": "en|fr"})
|
||||||
*/
|
*/
|
||||||
public function deleteMessage(Mastodon_api $mastodon_api, String $id = null){
|
public function deleteMessage(Mastodon_api $mastodon_api, String $id = null){
|
||||||
|
|
||||||
|
@ -294,7 +292,8 @@ class FediPlanController extends AbstractController
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route("/about", name="about")
|
* @Route("/about",defaults={"_locale"="en"})
|
||||||
|
* @Route("/{_locale}/about", name="about", defaults={"_locale":"en"}, requirements={"_locale": "en|fr"})
|
||||||
*/
|
*/
|
||||||
public function about()
|
public function about()
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,8 +38,12 @@
|
||||||
<img src="{{ asset(flagLink) }}" alt="language">
|
<img src="{{ asset(flagLink) }}" alt="language">
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<a class="dropdown-item" href="{{ path(app.request.attributes.get('_route'), {'_locale':'en' }) }}">English</a>
|
{% set route = app.request.attributes.get('_route') %}
|
||||||
<a class="dropdown-item" href="{{ path(app.request.attributes.get('_route'), {'_locale':'fr' }) }}">Français</a>
|
{% if route == "app_fediplan_about" %}
|
||||||
|
{% set route = "about" %}
|
||||||
|
{% endif %}
|
||||||
|
<a class="dropdown-item" href="{{ path(route, {'_locale':'en' }) }}">English</a>
|
||||||
|
<a class="dropdown-item" href="{{ path(route, {'_locale':'fr' }) }}">Français</a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Add table
Reference in a new issue