mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-11 05:32:39 +01:00
b989cf82b7
* working on js localizations * remove dependencies * Pad Hashes to at least 10 characters in length * Inject JS translations into front end dynamically * Implement VueJS for Client Edit Page with reactivity * Conditionally hide rows if not enabled (custom_value) * Split client template into smaller components * implementing ui buttons * CRUD cycles of a client * Working on Client CRUD - Integrity constraint issues
102 lines
2.0 KiB
PHP
102 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
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('window.i18n = ' . json_encode($strings) . ';');
|
|
exit();
|
|
}
|
|
|
|
/**
|
|
* 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)
|
|
{
|
|
//
|
|
}
|
|
}
|