Skip to content

Commit

Permalink
Feat. Cambio de Idioma
Browse files Browse the repository at this point in the history
  • Loading branch information
elyambay committed Sep 11, 2018
1 parent 5295a1d commit 23d3606
Show file tree
Hide file tree
Showing 46 changed files with 663 additions and 273 deletions.
26 changes: 26 additions & 0 deletions app/Http/Controllers/LanguageController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Lang;
use Session;


class LanguageController extends Controller
{
public function switchLang($lang){

if (array_key_exists($lang, config('languages'))) {
session()->put('applocale', $lang);
}
return redirect()->back();
}

public function switchLangReport($lang){
if (array_key_exists($lang, config('languages'))) {
session()->put('applocale', $lang);
}
return "true";
}
}
150 changes: 67 additions & 83 deletions app/Http/Controllers/ReporteController.php

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Kernel extends HttpKernel
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\App\Http\Middleware\Localization::class,
],

'api' => [
Expand Down
30 changes: 30 additions & 0 deletions app/Http/Middleware/Localization.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace App\Http\Middleware;

use Closure;
use Session;
use Config;
use App;


class Localization
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (Session::has('applocale') AND array_key_exists(Session::get('applocale'), Config::get('languages'))) {
App::setLocale(Session::get('applocale'));
}
else { // This is optional as Laravel will automatically set the fallback language if there is none specified
App::setLocale(Config::get('app.fallback_locale'));
}
return $next($request);
}
}
4 changes: 2 additions & 2 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
| any other location as required by the application or its packages.
*/

'name' => 'Laravel',
'name' => 'RiartConsulting S&B',

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -90,7 +90,7 @@
|
*/

'fallback_locale' => 'en',
'fallback_locale' => 'es',

/*
|--------------------------------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions config/languages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php
return [
'en' => 'English',
'es' => 'Español',
];
19 changes: 6 additions & 13 deletions public/css/auxiliar.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,22 @@


box-shadow: 2px 5px 10px var(--color-smoke);

&:hover {
}
.flat:hover {
transition: all 150ms linear;
color: #202129;
background-color: #e1e2e2;
opacity: 1;
opacity: .85;
}

&:active {
}
.flat:active {
transition: all 150ms linear;
opacity: .75;
background-color: #d5d6d6;
opacity: 1;

}

&:focus {
outline: 1px dotted #959595;
outline-offset: -4px;
}

}

.items li:last-child{
padding-bottom: 0.5em !important;
}
Expand All @@ -98,4 +91,4 @@

.wrap{
overflow-wrap: normal;
}
}
11 changes: 11 additions & 0 deletions public/css/translation.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

.language-switch-tooltip {
position: fixed;
right: 85px;
padding:0px 0.5rem;
text-align: right;
background-color: #323232;
border-radius: 2px;
color: #FFF;
width:auto;
}
3 changes: 2 additions & 1 deletion public/plugins/datatables/dataTables-materialize.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ table.dataTable thead .sorting_desc_disabled {
float: left;
margin-right: .5rem; }
.dataTables_wrapper .dataTables_filter input {
width: calc(100% - 7rem); }
width: calc(100% - 7rem);
padding-left: 1em; }
.dataTables_wrapper .dataTables_filter .btn-floating {
margin-right: .5rem; }
.dataTables_wrapper .dataTables_info {
Expand Down
2 changes: 2 additions & 0 deletions resources/lang/en/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@

'failed' => 'These credentials do not match our records.',
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
'user_label' => 'Username',
'password_label' => 'Password',

];
7 changes: 7 additions & 0 deletions resources/lang/en/beneficiosReportCharts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
return [
"breadcrumb_report" => "Report",
"breadcrumb_home" => "Home",
"breadcrumb_results"=> "Results",
"title_practices" => "Práctices",
];
7 changes: 7 additions & 0 deletions resources/lang/en/beneficiosReportIndex.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
return [
"breadcrumb_report" => "Report",
"breadcrumb_home" => "Home",
"title_list" => "List of Indicators",
"button_sample" => "Universe Composition",
];
11 changes: 11 additions & 0 deletions resources/lang/en/cargosClientes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
return [
"button_new_position" => "Position",
"button_review" => "Review",
"table_description" => "Description",
"table_salary" => "Salary",
"table_options" => "Options",
"label_list" => "List of Positions",
"label_greeting" => "Greetings",
"first_time_p" => "This is the first time you participate on this study. Please create a new position",
];
11 changes: 11 additions & 0 deletions resources/lang/en/editEmpresa.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
return[
"label_description" => "Description",
"label_club" => "Club",
"label_segment" => "Segment",
"label_branches" => "Number of Branches",
"label_headcount" => "Number of Employees",
"label_origin" => "Origin",
"label_edit" => "Edit Organization",
"button_save" => "Save",
];
13 changes: 13 additions & 0 deletions resources/lang/en/homepage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
return[
"table_description" => "Description",
"table_club" => "Club",
"table_segment" => "Segment",
"table_branches" => "No. Branches",
"table_headcount" => "Head Count",
"table_origin" => "Origin",
"button_list" => "List",
"button_edit" => "Edit",
"button_report" => "Report",
"button_done" => "Done",
];
6 changes: 6 additions & 0 deletions resources/lang/en/layout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
return [
"menu_panel" => "Panel",
"menu_complete" => "Complete",
"menu_report" => "Report",
];
10 changes: 10 additions & 0 deletions resources/lang/en/reportFilter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
return [
"label_filter" => "Filter Position",
"label_level" => "Level",
"label_position" => "Position",
"label_description" => "Description of Position",
"button_report" => "Report",
"select_option" => "Select a position",
"select_level" => "Select a level",
];
10 changes: 10 additions & 0 deletions resources/lang/en/reportLayout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
return [
"menu_panel" => "Panel",
"menu_concepts" => "Thecnical Concepts",
"menu_methodology" => "Methodology",
"menu_sheet" => "Thecnical Sheet",
"menu_indicators" => "Indicators by Position",
"menu_search" => "Search by Position",
"menu_universe" => "Universe",
];
49 changes: 49 additions & 0 deletions resources/lang/en/reportReport.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
return [
"button_currency_gs" => "Convert to GS.",
"button_currency_us" => "Convert to U\$D",
"p_currency_gs" => "Values shown in thousands of Guaraníes",
"p_currency_us" => "Values shown in American Dollars",
"label_tab_universe" => "All Participants",
"label_tab_national" => "National",
"label_tab_international" => "International",
"table_concepts" => "Concepts",
"table_cases" => "Number of Cases",
"table_occupants" => "Number of Ocuppants",
"table_min" => "Minimum",
"table_perc25" => "25th Percentile",
"table_average" => "Average",
"table_median" => "Median",
"table_perc75" => "75th Percentile",
"table_max" => "Maximum",
"table_company" => "Your Company",
"table_avg_compare" => "Compare to Average",
"table_median_compare" => "Compare to Median",
"table_perc75_compare" => "Compare to 75th Perc.",
"table_max_compare" => "Compare to Maximum",
"title_universe" => "All Participants",
"title_national" => "National",
"title_international" => "International",
"chart_salary" => "Monthly Base Salary",
"chart_annual_cash" => "Annual Guaranted Cash",
"chart_total_comp" => "Annual Total Compensation",
"concept_salary" => "Monthly Base Salary",
"concept_annual_salary" => "Annual Base Salary",
"concept_annual_gratif." => "Annual Fixed Additional",
"concept_13month" => "13th Month",
"concept_annual_cash" => "Annual Guaranteed Cash",
"concept_total_incentives" => "Annual total short-term incentives",
"concept_bonus" => "Bonus",
"concept_13month_impacted" => "13th Month - Impacted by: (annual base salary + additional fixed + annual total short-term incentives)/12",
"concept_total_compensation"=> "Annual Total Compensation",
"concept_variable_pay" => "Annual Variable Pay",
"concept_mooring" => "Annual Additional: mooring",
"concept_fuel_type" => "Annual Additional: fuel type",
"concept_shipping" => "Annual Additional: available shipping",
"concept_load" => "Annual Additional: type of load",
"concept_total_benefits" => "Annual Total Benefits",
"concept_annual_cash_total" => "Annual Total Cash",
"concept_annual_commission" => "Annual Total Commission",
"concept_total_additional" => "Annual Total Incentives",

];
3 changes: 2 additions & 1 deletion resources/lang/es/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@

'failed' => 'Los datos no corresponden a nuestros registros',
'throttle' => 'Demasiados intentos de autenticación. Por favor intétalo en :seconds segundos.',

'user_label' => 'Usuario',
'password_label' => 'Contraseña',
];
7 changes: 7 additions & 0 deletions resources/lang/es/beneficiosReportCharts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
return [
"breadcrumb_report" => "Reporte",
"breadcrumb_home" => "Inicio",
"breadcrumb_results"=> "Resultados",
"title_practices" => "Prácticas",
];
7 changes: 7 additions & 0 deletions resources/lang/es/beneficiosReportIndex.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
return [
"breadcrumb_report" => "Reporte",
"breadcrumb_home" => "Inicio",
"title_list" => "Lista de Indicadores",
"button_sample" => "Composición de la Muestra",
];
11 changes: 11 additions & 0 deletions resources/lang/es/cargosClientes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
return [
"button_new_position" => "Cargo",
"button_review" => "Revisar",
"table_description" => "Descripción",
"table_salary" => "Salario",
"table_options" => "Opciones",
"label_list" => "Listado de Cargos",
"label_greeting" => "Saludos",
"first_time_p" => "Esta la primera vez que participa de la Encuesta. Por favor ingrese un cargo nuevo",
];
11 changes: 11 additions & 0 deletions resources/lang/es/editEmpresa.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
return[
"label_description" => "Descripción",
"label_club" => "Club",
"label_segment" => "Segmento",
"label_branches" => "Cantidad de Sucursales",
"label_headcount" => "Cantidad de Empleados",
"label_origin" => "Origen",
"label_edit" => "Editar Empresa",
"button_save" => "Save",
];
13 changes: 13 additions & 0 deletions resources/lang/es/homepage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
return[
"table_description" => "Descripción",
"table_club" => "Club",
"table_segment" => "Segmento",
"table_branches" => "Nro. Sucursales",
"table_headcount" => "Nro. Emp.",
"table_origin" => "Origen",
"button_list" => "Listar",
"button_edit" => "Editar",
"button_report" => "Reporte",
"button_done" => "Finalizar",
];
6 changes: 6 additions & 0 deletions resources/lang/es/layout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
return [
"menu_panel" => "Panel de Empresas",
"menu_complete" => "Completar",
"menu_report" => "Reporte",
];
4 changes: 2 additions & 2 deletions resources/lang/es/pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
|
*/

'previous' => '&laquo; Previous',
'next' => 'Next &raquo;',
'previous' => '&laquo; Anterior',
'next' => 'Siguiente &raquo;',

];
10 changes: 10 additions & 0 deletions resources/lang/es/reportFilter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
return [
"label_filter" => "Filtrar Cargo",
"label_level" => "Nivel",
"label_position" => "Cargo",
"label_description" => "Descripcion del Cargo",
"button_report" => "Reporte",
"select_option" => "Elija una Opción",
"select_level" => "Elija una Opción",
];
Loading

0 comments on commit 23d3606

Please sign in to comment.