Skip to content

Commit

Permalink
Merge pull request #32 from GoteoFoundation/improve_locales
Browse files Browse the repository at this point in the history
Improve locales
  • Loading branch information
davidbeig authored Mar 28, 2023
2 parents 7b7e751 + 1d00b56 commit 922951c
Show file tree
Hide file tree
Showing 20 changed files with 105 additions and 528 deletions.
8 changes: 8 additions & 0 deletions assets/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ body {
background-color: $color-cyan;
}

form {
#authorization_accept_or_refuse {
label {
margin: 0 2em 0 1em;
}
}
}

footer {
background-color: $background-grey;
flex: 0 0 auto;
Expand Down
1 change: 1 addition & 0 deletions config/routes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
oauth2:
resource: '@LeagueOAuth2ServerBundle/Resources/config/routes.php'
type: php
prefix: /{_locale}
8 changes: 4 additions & 4 deletions src/Form/AuthorizationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('accept_or_refuse', ChoiceType::class, [
'label' => $this->translator->trans("Accept or Refuse", domain: "authorization"),
'label' => $this->translator->trans("authorization.accept_or_refuse.label", domain: "authorization"),
'choices' => $this->acceptOrRefuseChoices(),
'attr' => [
'class' => 'form-check'
Expand All @@ -32,15 +32,15 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
'required' => true,
])
->add('submit', SubmitType::class, [
'label' => $this->translator->trans("Submit", domain: "authorization")
'label' => $this->translator->trans("authorization.submit.label", domain: "authorization")
]);
}

private function acceptOrRefuseChoices(): array
{
return [
$this->translator->trans('Accept', domain: "authorization") => 'accept',
$this->translator->trans('Refuse', domain: "authorization") => 'refuse'
$this->translator->trans('authorization.accept.label', domain: "authorization") => 'accept',
$this->translator->trans('authorization.refuse.label', domain: "authorization") => 'refuse'
];
}
}
6 changes: 3 additions & 3 deletions templates/oauth2/authorization.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'base.html.twig' %}

{% block title %}{{ "Log in!" | trans({}, "login")}}{% endblock %}
{% block title %}{{ "login.log_in" | trans({}, "login")}}{% endblock %}

{% block body %}
<div class="container h-100 mb-5">
Expand All @@ -9,15 +9,15 @@
<div class="card">
<div class="card-body m-2">
{{ form_start(form) }}
<h1 class="h3 mb-3 font-weight-normal">{{ "Please, authorize or refuse" | trans({}, "authorization" ) }}</h1>
<h1 class="h3 mb-3 font-weight-normal">{{ "authorization.title" | trans({}, "authorization" ) }}</h1>

{% if client %}
<p>
{{ "authorization.terms_and_conditions" | trans({'%terms_and_conditions_url%': 'https://participa.goteo.org/pages/terms-and-conditions', '%client_name%': client.getName() }, "authorization") | raw }}
</p>
{% endif %}

{{ form_row(form.accept_or_refuse, {'attr': { 'class': 'form-check'}}) }}
{{ form_row(form.accept_or_refuse, {'attr': { 'class': 'form-check mt-3'}}) }}

{{ form_widget(form.submit, {'attr': {'class': 'form-control btn-primary btn btn-lg btn-cyan mt-5'}}) }}
{{ form_end(form) }}
Expand Down
16 changes: 8 additions & 8 deletions templates/security/login.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'base.html.twig' %}

{% block title %}{{ "Log in!" | trans({}, "login") }}{% endblock %}
{% block title %}{{ "login.log_in!" | trans({}, "login") }}{% endblock %}

{% block body %}
<div class="container h-100 mb-5">
Expand All @@ -15,31 +15,31 @@

{% if app.user %}
<div class="mb-3">
{{ "You are logged in as %s," | trans({"%s": app.user.username}, "login") }} <a href="{{ path('app_logout') }}">{{ "Logout" | trans({}, "login") }}</a>
{{ "login.logged_in_as" | trans({"%s": app.user.username}, "login") }} <a href="{{ path('app_logout') }}">{{ "login.logout" | trans({}, "login") }}</a>
</div>
{% endif %}

<h1 class="h1 mb-3 mt-3 card-title">{{ "Please sign in" | trans({}, "security") }}</h1>
<h1 class="h1 mt-3 card-title">{{ "login.please_sign_in" | trans({}, "login") }}</h1>

<label class="form-label" for="inputEmail">{{ "Email" | trans({}, "login") }}</label>
<label class="form-label mt-3" for="inputEmail">{{ "login.email" | trans({}, "login") }}</label>
<input
type="email"
value="{{ last_username }}"
name="email"
id="inputEmail"
class="form-control"
autocomplete="email"
placeholder="{{ "Email or user name" | trans({}, "login") }}"
placeholder="{{ "login.email_or_username" | trans({}, "login") }}"
required autofocus>

<label class="form-label" for="inputPassword">{{ "Password" | trans({}, "login") }}</label>
<label class="form-label mt-3" for="inputPassword">{{ "login.password" | trans({}, "login") }}</label>
<input
type="password"
name="password"
id="inputPassword"
class="form-control"
autocomplete="current-password"
placeholder="{{ "Password" | trans({}, "login") }}"
placeholder="{{ "login.password" | trans({}, "login") }}"
required>

<input type="hidden" name="_csrf_token"
Expand All @@ -59,7 +59,7 @@

<div class="d-grid">
<button class="btn btn-primary btn-lg btn-cyan mt-3" type="submit">
{{ "Sign in" | trans({}, "login") }}
{{ "login.sign_in" | trans({}, "login") }}
</button>
</div>
</form>
Expand Down
17 changes: 11 additions & 6 deletions translations/authorization.ca.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
"Please, authorize or refuse": "Siusplau, autoritza o rebutja"
"Accept": "Autoritzar"
"Refuse": "Rebutjar"
"Submit": "Guardar"
authorization.terms_and_conditions: "Per continuar, Goteo compartirà el teu nom, la teva adreça electrònica, la teva preferència d'idioma i la teva foto de perfil amb %client_name%. Abans d'utilitzar aquesta aplicació, pots consultar els <a href='%terms_and_conditions_url%'>termes i condicions d'us</a> de l'aplicación %client_name%."
"Accept or Refuse": "Accepta o rebutja"
authorization:
title: "Siusplau, autoritza o rebutja"
accept:
label: "Autoritzar"
refuse:
label: "Rebutjar"
submit:
label: "Guardar"
terms_and_conditions: "Per continuar, Goteo compartirà el teu nom, la teva adreça electrònica, la teva preferència d'idioma i la teva foto de perfil amb %client_name%. Abans d'utilitzar aquesta aplicació, pots consultar els <a href='%terms_and_conditions_url%'>termes i condicions d'us</a> de l'aplicación %client_name%."
accept_or_refuse:
label: "Accepta o rebutja"
17 changes: 11 additions & 6 deletions translations/authorization.en.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
"Please, authorize or refuse": "Please, authorize or refuse"
"Accept": "Accept"
"Refuse": "Refuse"
"Submit": "Submit"
authorization.terms_and_conditions: "To continue, Goteo will share your name, email address, language preference and profile picture with %client_name%. Before using this app, you can review the <a href='%terms_and_conditions_url%'>terms and conditions</a> of the %client_name% application."
"Accept or Refuse": "Accept or refuse"
authorization:
title: "Please, authorize or refuse"
accept:
label: "Accept"
refuse:
label: "Refuse"
submit:
label: "Submit"
terms_and_conditions: "To continue, Goteo will share your name, email address, language preference and profile picture with %client_name%. Before using this app, you can review the <a href='%terms_and_conditions_url%'>terms and conditions</a> of the %client_name% application."
accept_or_refuse:
label: "Accept or refuse"
17 changes: 11 additions & 6 deletions translations/authorization.es.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
"Please, authorize or refuse": "Por favor, autoriza o rechaza"
"Accept": "Autorizar"
"Refuse": "Rechazar"
"Submit": "Guardar"
authorization.terms_and_conditions: "Para continuar, Goteo compartirá tu nombre, tu dirección de correo electrónica, tu preferencia de idioma y tu foto de perfil con %client_name%. Antes de utilizar esta aplicación, puedes consultar la <a href='%terms_and_conditions_url%'>terminos y condiciones de uso</a> de la aplicación %client_name%."
"Accept or Refuse": "Acepta o rechaza"
authorization:
title: "Por favor, autoriza o rechaza"
accept:
label: "Autorizar"
refuse:
label: "Rechazar"
submit:
label: "Guardar"
terms_and_conditions: "Para continuar, Goteo compartirá tu nombre, tu dirección de correo electrónica, tu preferencia de idioma y tu foto de perfil con %client_name%. Antes de utilizar esta aplicación, puedes consultar los <a href='%terms_and_conditions_url%'>términos y condiciones de uso</a> de la aplicación %client_name%."
accept_or_refuse:
label: "Acepta o rechaza"
12 changes: 7 additions & 5 deletions translations/home.ca.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
home.title: "Benvingut al servidor de autenticació de la Plataforma Goteo!"
home.description: "Aquest servidor permet fer login fent servir l'aplicació de la Plataforma Goteo. Per a poder fer-la servir, només cal que ens enviis un email informant-nos de la teva aplicació i ens possarem en contacte per a gestionar l'us del Oauth de Goteo."
home.mail.subject: "Accés al servidor de Oauth de Goteo.org"
home.mail.body: "M'agradaria poder fer servir l'oauth de Goteo dintre de la meva aplicació."
home.mail.description: "Aconsegueix accés al servidor d'Oauth"
home:
title: "Benvingut al servidor de autenticació de la Plataforma Goteo!"
description: "Aquest servidor permet fer login fent servir l'aplicació de la Plataforma Goteo. Per a poder fer-la servir, només cal que ens enviis un email informant-nos de la teva aplicació i ens possarem en contacte per a gestionar l'us del Oauth de Goteo."
mail:
subject: "Accés al servidor de Oauth de Goteo.org"
body: "M'agradaria poder fer servir l'oauth de Goteo dintre de la meva aplicació."
description: "Aconsegueix accés al servidor d'Oauth"
12 changes: 7 additions & 5 deletions translations/home.en.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
home.title: "Welcome to the authentication server of the Goteo Platform!"
home.description: "This server allows you to log in using the Goteo Platform application. To use it, just send us an email informing us of your application and we will contact you to manage the use of Goteo's Oauth"
home.mail.subject: "Access to Goteo.org's Oauth server"
home.mail.body: "I would like to be able to use Goteo's Oauth inside my application."
home.mail.description: "Get access to the Oauth server"
home:
title: "Welcome to the authentication server of the Goteo Platform!"
description: "This server allows you to log in using the Goteo Platform application. To use it, just send us an email informing us of your application and we will contact you to manage the use of Goteo's Oauth"
mail:
subject: "Access to Goteo.org's Oauth server"
body: "I would like to be able to use Goteo's Oauth inside my application."
description: "Get access to the Oauth server"
12 changes: 7 additions & 5 deletions translations/home.es.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
home.title: "¡Bienvenido al servidor de autenticación de la Plataforma Goteo!"
home.description: "Este servidor te permite iniciar sesión utilizando la aplicación de la Plataforma Goteo. Para utilizarlo, sólo tienes que enviarnos un correo informándonos de tu aplicación y nos pondremos en contacto contigo para gestionar el uso del Oauth de Goteo"
home.mail.subject: "Acceso al servidor Oauth de Goteo.org"
home.mail.body: "Me gustaría poder utilizar el servidor de Oauth de Goteo dentro de mi aplicación"
home.mail.description: "Obtén acceso al servidor Oauth"
home:
title: "¡Bienvenido al servidor de autenticación de la Plataforma Goteo!"
description: "Este servidor te permite iniciar sesión utilizando la aplicación de la Plataforma Goteo. Para utilizarlo, sólo tienes que enviarnos un correo informándonos de tu aplicación y nos pondremos en contacto contigo para gestionar el uso del Oauth de Goteo"
mail:
subject: "Acceso al servidor Oauth de Goteo.org"
body: "Me gustaría poder utilizar el servidor de Oauth de Goteo dentro de mi aplicación"
description: "Obtén acceso al servidor Oauth"
16 changes: 9 additions & 7 deletions translations/login.ca.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"Email": Email
"Email or user name": "Correu electrònic o nom d'usuari"
"Password": "Contrasenya"
"Sign in": "Inicia sessió"
"Log in!": "Iniciar sessió"
"You are logged in as %s,": "Has iniciat sessió com a %s,"
"Logout": "Tancar sessió"
login:
email: Email
email_or_username: "Correu electrònic o nom d'usuari"
password: "Contrasenya"
sign_in: "Inicia sessió"
log_in: "Iniciar sessió"
logged_in_as: "Has iniciat sessió com a %s,"
logout: "Tancar sessió"
please_sign_in: "Si us plau, inicia sessió"
16 changes: 9 additions & 7 deletions translations/login.en.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"Email": Email
"Email or user name": "Email or user name"
"Password": "Password"
"Sign in": "Sign in"
"Log in!": "Log in!"
"You are logged in as %s,": "You are logged in as %s,"
"Logout": "Logout"
login:
email: Email
email_or_username: "Email or user name"
password: "Password"
sign_in: "Sign in"
log_in: "Log in!"
logged_in_as: "You are logged in as %s,"
logout: "Logout"
please_sign_in: "Please, sign in"
16 changes: 9 additions & 7 deletions translations/login.es.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"Email": Email
"Email or user name": "Correo electrónico o nombre de usuario"
"Password": "Contraseña"
"Sign in": "Inicia sessión"
"Log in!": "Iniciar sessión"
"You are logged in as %s,": "Has iniciado sessión como %s,"
"Logout": "Cerrar sessió"
login:
email: Email
email_or_username: "Correo electrónico o nombre de usuario"
password: "Contraseña"
sign_in: "Inicia sessión"
log_in: "Iniciar sessión"
logged_in_as: "Has iniciado sessión como %s,"
logout: "Cerrar sessió"
please_sign_in: "Por favor, inicia sessión"
20 changes: 0 additions & 20 deletions translations/security.ca.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions translations/security.en.yaml

This file was deleted.

Loading

0 comments on commit 922951c

Please sign in to comment.