Skip to content

Commit

Permalink
Merge pull request #170 from galdazbiz/master
Browse files Browse the repository at this point in the history
languages improved + fix repeated js in discussions
  • Loading branch information
marktopper authored Feb 12, 2018
2 parents d556476 + f5e6c81 commit b6a8b78
Show file tree
Hide file tree
Showing 16 changed files with 257 additions and 87 deletions.
18 changes: 12 additions & 6 deletions config/chatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,11 @@
| Your headline and your description will be shown on the homepage of your
| forum, unless you change the default theme.
|
| *headline*: This is the main headline on the forum homepage
|
| *description*: This is the main description that will show under the
| headline on the forum homepage.
| *headline_logo*: If this is set an image will be used on the forum home
| instead of text. Specify the relative path to the image here.
|
*/

'headline' => 'Welcome to Chatter',
'description' => 'A simple forum package for your Laravel app.',
'headline_logo' => '/vendor/devdojo/chatter/assets/images/logo-light.png',

/*
Expand Down Expand Up @@ -259,6 +253,18 @@
'paginate' => [
'num_of_results' => 10,
],

/*
|--------------------------------------------------------------------------
| Show missing fields to users in forms
|--------------------------------------------------------------------------
|
| This usually has to be active to show the users what they are missing
| unless you want to manage by your own system in the master template
|
*/

'errors' => false,

/*
|--------------------------------------------------------------------------
Expand Down
14 changes: 13 additions & 1 deletion src/Controllers/ChatterDiscussionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,19 @@ public function store(Request $request)
'title' => 'required|min:5|max:255',
'body_content' => 'required|min:10',
'chatter_category_id' => 'required',
]);
],[
'title.required' => trans('chatter::alert.danger.reason.title_required'),
'title.min' => [
'string' => trans('chatter::alert.danger.reason.title_min'),
],
'title.max' => [
'string' => trans('chatter::alert.danger.reason.title_max'),
],
'body_content.required' => trans('chatter::alert.danger.reason.content_required'),
'body_content.min' => trans('chatter::alert.danger.reason.content_min'),
'chatter_category_id.required' => trans('chatter::alert.danger.reason.category_required'),
]);


Event::fire(new ChatterBeforeNewDiscussion($request, $validator));
if (function_exists('chatter_before_new_discussion')) {
Expand Down
10 changes: 8 additions & 2 deletions src/Controllers/ChatterPostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ public function store(Request $request)
$stripped_tags_body = ['body' => strip_tags($request->body)];
$validator = Validator::make($stripped_tags_body, [
'body' => 'required|min:10',
]);
],[
'body.required' => trans('chatter::alert.danger.reason.content_required'),
'body.min' => trans('chatter::alert.danger.reason.content_min'),
]);

Event::fire(new ChatterBeforeNewResponse($request, $validator));
if (function_exists('chatter_before_new_response')) {
Expand Down Expand Up @@ -158,7 +161,10 @@ public function update(Request $request, $id)
$stripped_tags_body = ['body' => strip_tags($request->body)];
$validator = Validator::make($stripped_tags_body, [
'body' => 'required|min:10',
]);
],[
'body.required' => trans('chatter::alert.danger.reason.content_required'),
'body.min' => trans('chatter::alert.danger.reason.content_min'),
]);

if ($validator->fails()) {
return back()->withErrors($validator)->withInput();
Expand Down
21 changes: 15 additions & 6 deletions src/Lang/en/alert.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
'success' => [
'title' => 'Well done!',
'reason' => [
'submitted_to_post' => 'Response successfully submitted to discussion.',
'updated_post' => 'Successfully updated the Discussion.',
'destroy_post' => 'Successfully deleted the response and discussion.',
'destroy_from_discussion' => 'Successfully deleted the response from the discussion.',
'created_discussion' => 'Successfully created a new discussion.',
'submitted_to_post' => 'Response successfully submitted to '.strtolower(trans('chatter::intro.titles.discussion')).'.',
'updated_post' => 'Successfully updated the '.strtolower(trans('chatter::intro.titles.discussion')).'.',
'destroy_post' => 'Successfully deleted the response and '.strtolower(trans('chatter::intro.titles.discussion')).'.',
'destroy_from_discussion' => 'Successfully deleted the response from the '.strtolower(trans('chatter::intro.titles.discussion')).'.',
'created_discussion' => 'Successfully created a new '.strtolower(trans('chatter::intro.titles.discussion')).'.',
],
],
'info' => [
Expand All @@ -25,7 +25,16 @@
'trouble' => 'Sorry, there seems to have been a problem submitting your response.',
'update_post' => 'Nah ah ah... Could not update your response. Make sure you\'re not doing anything shady.',
'destroy_post' => 'Nah ah ah... Could not delete the response. Make sure you\'re not doing anything shady.',
'create_discussion' => 'Whoops :( There seems to be a problem creating your discussion.',
'create_discussion' => 'Whoops :( There seems to be a problem creating your '.strtolower(trans('chatter::intro.titles.discussion')).'.',
'title_required' => 'Please write a tittle',
'title_min' => 'The title has to have at least :min characters.',
'title_max' => 'The title has to have no more than :max characters.',
'content_required' => 'Please write some content',
'content_min' => 'The content has to have at least :min characters',
'category_required' => 'Please choose a category',



],
],
];
6 changes: 3 additions & 3 deletions src/Lang/en/email.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
'preheader' => 'Just wanted to let you know that someone has responded to a forum post.',
'greeting' => 'Hi there,',
'body' => 'Just wanted to let you know that someone has responded to a forum post at',
'view_discussion' => 'View The Discussion',
'view_discussion' => 'View the '.strtolower(trans('chatter::intro.titles.discussion')).'.',
'farewell' => 'Have a great day!',
'unsuscribe' => [
'message' => 'If you no longer wish to be notified when someone responds to this forum post be sure to uncheck the notification setting at the bottom of the page :)',
'message' => 'If you no longer wish to be notified when someone responds to this form post be sure to uncheck the notification setting at the bottom of the page :)',
'action' => 'Don\'t like these emails?',
'link' => 'Unsubscribe to this Discussion',
'link' => 'Unsubscribe to this '.strtolower(trans('chatter::intro.titles.discussion')).'.',
],
];
39 changes: 39 additions & 0 deletions src/Lang/en/intro.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

return [
/*
|--------------------------------------------------------------------------
| Forum Titles
|--------------------------------------------------------------------------
|
| These are some default titles (words) that will be used throughout your
| forum. You can change these to whatever you would like :)
|
*/

'titles' => [
'discussion' => 'Discussion',
'discussions' => 'Discussions',
],

/*
|--------------------------------------------------------------------------
| The main headline and description of your forum
|--------------------------------------------------------------------------
|
| Your headline and your description will be shown on the homepage of your
| forum, unless you change the default theme.
|
| *headline*: This is the main headline on the forum homepage
|
| *description*: This is the main description that will show under the
| headline on the forum homepage.
|
*/

'headline' => 'Welcome to Chatter',
'description' => 'A simple forum package for your Laravel app.',

];


13 changes: 7 additions & 6 deletions src/Lang/en/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
'edit' => 'Edit',
'yes' => 'Yes',
'no' => 'No',
'all' => 'All',
'minutes' => '1 minute| :count minutes',
],

'discussion' => [
'new' => 'New Discussion',
'all' => 'All Discussions',
'create' => 'Create Discussion',
'new' => 'New '.trans('chatter::intro.titles.discussion'),
'all' => 'All '.trans('chatter::intro.titles.discussion'),
'create' => 'Create '.trans('chatter::intro.titles.discussion'),
'posted_by' => 'Posted by',
'head_details' => 'Posted in Category',

Expand All @@ -27,10 +28,10 @@
],

'editor' => [
'title' => 'Title of Discussion',
'title' => 'Title of '.trans('chatter::intro.titles.discussion'),
'select' => 'Select a Category',
'tinymce_placeholder' => 'Type Your Discussion Here...',
'select_color_text' => 'Select a Color for this Discussion (optional)',
'tinymce_placeholder' => 'Type Your '.trans('chatter::intro.titles.discussion'),.' Here...',
'select_color_text' => 'Select a Color for this '.trans('chatter::intro.titles.discussion').' (optional)',
],

'email' => [
Expand Down
19 changes: 13 additions & 6 deletions src/Lang/es/alert.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
'success' => [
'title' => '¡Bien hecho!',
'reason' => [
'submitted_to_post' => 'Respuesta enviada correctamente a la discusión.',
'updated_post' => 'Discusión actualizada correctamente.',
'destroy_post' => 'Se ha borrado correctamente la respuesta y la discusión.',
'destroy_from_discussion' => 'Se ha borrado correctamente la respuesta de la discusión.',
'created_discussion' => 'Se ha creado correctamente una nueva discusión.',
'submitted_to_post' => 'Respuesta enviada correctamente a la '.strtolower(trans('chatter::intro.titles.discussion')),
'updated_post' => trans('chatter::intro.titles.discussion').' actualizada correctamente.',
'destroy_post' => 'Se ha borrado correctamente la respuesta y la '.strtolower(trans('chatter::intro.titles.discussion')),
'destroy_from_discussion' => 'Se ha borrado correctamente la respuesta de la '.strtolower(trans('chatter::intro.titles.discussion')),
'created_discussion' => 'Se ha creado correctamente una nueva '.strtolower(trans('chatter::intro.titles.discussion')),
],
],
'info' => [
Expand All @@ -25,7 +25,14 @@
'trouble' => 'Parece que ha ocurrido un problema al intentar enviar la respuesta, vuelve a intentarlo más tarde.',
'update_post' => '¡Oh! No se ha podido actualizar la respuesta.',
'destroy_post' => '¡Oh! No se ha podido borrar la respuesta.',
'create_discussion' => '¡Ups! Parece que hay un problema al crear la discusión. :(',
'create_discussion' => '¡Ups! Parece que hay un problema al crear la '.strtolower(trans('chatter::intro.titles.discussion')).'. :(',
'title_required' => 'Por favor escribe un título',
'title_min' => 'El título debe tener al menos :min caracteres.',
'title_max' => 'El título no debe superar los :max caracteres.',
'content_required' => 'Es necesario escribir algo en el contenido',
'content_min' => 'El contenido debe tener al menos :min caracteres',
'category_required' => 'Por favor selecciona una categoría',

],
],
];
6 changes: 3 additions & 3 deletions src/Lang/es/email.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
return [
'preheader' => 'Este texto es como un encabezado. Algunos clientes muestran este texto como una vista previa.',
'greeting' => 'Hola,',
'body' => 'Te informamos que alguien ha respondido a una discusión publicada en',
'view_discussion' => 'Ver la discusión',
'body' => 'Te informamos que alguien ha respondido a una '.strtolower(trans('chatter::intro.titles.discussion')).' publicada en',
'view_discussion' => 'Ver la '.strtolower(trans('chatter::intro.titles.discussion')),
'farewell' => 'Que tengas un buen día.',
'unsuscribe' => [
'message' => 'Si ya no deseas ser notificado cuando alguien más responda, asegurate de desmarcar la configuración de notificación al final de la página :)',
'action' => '¿No le gustan estos correos electrónicos?',
'link' => 'Anular la suscripción a la discusión',
'link' => 'Anular la suscripción a la '.strtolower(trans('chatter::intro.titles.discussion')),
],
];
39 changes: 39 additions & 0 deletions src/Lang/es/intro.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

return [
/*
|--------------------------------------------------------------------------
| Forum Titles
|--------------------------------------------------------------------------
|
| These are some default titles (words) that will be used throughout your
| forum. You can change these to whatever you would like :)
|
*/

'titles' => [
'discussion' => 'Discusión',
'discussions' => 'Discusiones',
],

/*
|--------------------------------------------------------------------------
| The main headline and description of your forum
|--------------------------------------------------------------------------
|
| Your headline and your description will be shown on the homepage of your
| forum, unless you change the default theme.
|
| *headline*: This is the main headline on the forum homepage
|
| *description*: This is the main description that will show under the
| headline on the forum homepage.
|
*/

'headline' => 'Bienvenidos a Chatter',
'description' => 'Un foro con un simple librería para Laravel',

];


15 changes: 8 additions & 7 deletions src/Lang/es/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
'edit' => 'Editar',
'yes' => 'Si',
'no' => 'No',
'all' => 'Todo',
'minutes' => '1 minuto| :count minutos',
],

'discussion' => [
'new' => 'Nueva Discusión',
'all' => 'Todas las discusiones',
'create' => 'Crear una discusión',
'new' => 'Nueva '.strtolower(trans('chatter::intro.titles.discussion')),
'all' => 'Todas las '.strtolower(trans('chatter::intro.titles.discussions')),
'create' => 'Crear una '.strtolower(trans('chatter::intro.titles.discussion')),
'posted_by' => 'Publicado por',
'head_details' => 'Publicado en categoria',

Expand All @@ -27,14 +28,14 @@
],

'editor' => [
'title' => 'Titulo de la discusión',
'title' => 'Titulo de la '.strtolower(trans('chatter::intro.titles.discussion')),
'select' => 'Selecciona una categoria',
'tinymce_placeholder' => 'Agrega el contenido para la discusión aquí...',
'select_color_text' => 'Selecciona un color para la discusión (opcional)',
'tinymce_placeholder' => 'Agrega el contenido para la '.strtolower(trans('chatter::intro.titles.discussion')).' aquí...',
'select_color_text' => 'Selecciona un color para la '.strtolower(trans('chatter::intro.titles.discussion')).' (opcional)',
],

'email' => [
'notify' => 'Notificarme cuando alguien conteste en la discusión',
'notify' => 'Notificarme cuando alguien conteste en la '.strtolower(trans('chatter::intro.titles.discussion')),
],

'auth' => 'Por favor <a href="/:home/login">Inicia sesión</a>
Expand Down
6 changes: 6 additions & 0 deletions src/Lang/nl/alert.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
'update_post' => 'Helaas, je kan deze reactie niet wijzigen.',
'destroy_post' => 'Helaas, je kan deze reactie niet verwijderen.',
'create_discussion' => 'Helaas, er is een probleem opgetreden tijdens het plaatsen van je discussie :(',
'title_required' => 'Please write a tittle',
'title_min' => 'The title has to have at least :min characters.',
'title_max' => 'The title has to have no more than :max characters.',
'content_required' => 'Please write some content',
'content_min' => 'The content has to have at least :min characters',
'category_required' => 'Please choose a category',
],
],
];
39 changes: 39 additions & 0 deletions src/Lang/nl/intro.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

return [
/*
|--------------------------------------------------------------------------
| Forum Titles
|--------------------------------------------------------------------------
|
| These are some default titles (words) that will be used throughout your
| forum. You can change these to whatever you would like :)
|
*/

'titles' => [
'discussion' => 'Discussie',
'discussions' => 'Discussies',
],

/*
|--------------------------------------------------------------------------
| The main headline and description of your forum
|--------------------------------------------------------------------------
|
| Your headline and your description will be shown on the homepage of your
| forum, unless you change the default theme.
|
| *headline*: This is the main headline on the forum homepage
|
| *description*: This is the main description that will show under the
| headline on the forum homepage.
|
*/

'headline' => 'Welcome to Chatter',
'description' => 'A simple forum package for your Laravel app.',

];


2 changes: 2 additions & 0 deletions src/Lang/nl/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
'edit' => 'Wijzig',
'yes' => 'Ja',
'no' => 'Nee',
'all' => 'Toon',
'minutes' => '1 minuut| :count minuten',

],

'discussion' => [
Expand Down
Loading

0 comments on commit b6a8b78

Please sign in to comment.