mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-05 18:52:44 +01:00
eddb9adc73
* Clean up Client Show * Working on Show Client menu action * working on client view permissions * Finishing up Client Statement View * Workig on client settings * add mix manifest * css for client settings * Client Settings * Working on Client Settings * Implement StartupCheck and static seeders * Implement cached statics in view composers * Working on client settings * Payment Terms * Working on Payment Terms View Composer * Payment Terms builder * Client Settings * refactor companies table * Refactor for company settings, move settings to json * Set object cast on settings column of Company table * Fixes for refactor of companies and clients table * Test * Client Settings Datamapper * Client Settings * Default client language * Client Settings * Working on client settings options * Client Settings * Settings Json serialization/deserialization handling
110 lines
2.3 KiB
PHP
110 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
/**
|
|
* Class TranslationController
|
|
* @package App\Http\Controllers
|
|
*/
|
|
class TranslationController extends Controller
|
|
{
|
|
/**
|
|
* Display a listing of the resource.
|
|
*
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function index()
|
|
{
|
|
$strings = Cache::rememberForever('lang.js', function () {
|
|
$lang = config('app.locale');
|
|
|
|
$files = glob(resource_path('lang/' . $lang . '/*.php'));
|
|
$strings = [];
|
|
|
|
foreach ($files as $file) {
|
|
$name = basename($file, '.php');
|
|
$strings[$name] = require $file;
|
|
}
|
|
|
|
return $strings;
|
|
});
|
|
|
|
header('Content-Type: text/javascript');
|
|
echo('i18n = ' . $this->easyMinify(json_encode($strings)) . ';');
|
|
exit();
|
|
}
|
|
|
|
private function easyMinify($javascript){
|
|
return preg_replace(array("/\s+\n/", "/\n\s+/", "/ +/"), array("\n", "\n ", " "), $javascript);
|
|
}
|
|
|
|
/**
|
|
* Show the form for creating a new resource.
|
|
*
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function create()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Store a newly created resource in storage.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function store(Request $request)
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Display the specified resource.
|
|
*
|
|
* @param int $id
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function show($id)
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Show the form for editing the specified resource.
|
|
*
|
|
* @param int $id
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function edit($id)
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Update the specified resource in storage.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @param int $id
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function update(Request $request, $id)
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Remove the specified resource from storage.
|
|
*
|
|
* @param int $id
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function destroy($id)
|
|
{
|
|
//
|
|
}
|
|
}
|