Selaa lähdekoodia

Added translatable messages to facilitate translation into other languages

rubens 4 vuotta sitten
vanhempi
commit
d489d39159

+ 10 - 10
app/Http/Controllers/AuthController.php

@@ -26,8 +26,8 @@ class AuthController extends Controller
 
         if (!$user) {
             return response()->json([
-                'message' => 'Given credentials are invalid.',
-                'errors' => 'Username and password don\'t match.'
+                'message' => __('cipi.invalid_login_message'),
+                'errors' => __('cipi.invalid_login')
             ], 401);
         }
 
@@ -65,8 +65,8 @@ class AuthController extends Controller
             ]);
         } else {
             return response()->json([
-                'message' => 'Given token is invalid.',
-                'errors' => 'Invalid token.'
+                'message' => __('cipi.invalid_token_message'),
+                'errors' => __('cipi.invalid_token')
             ], 401);
         }
     }
@@ -87,8 +87,8 @@ class AuthController extends Controller
 
         if (!$user) {
             return response()->json([
-                'message' => 'Given credentials are invalid.',
-                'errors' => 'Username and password don\'t match.'
+                'message' => __('cipi.invalid_login_message'),
+                'errors' => __('cipi.invalid_login')
             ], 401);
         }
 
@@ -103,8 +103,8 @@ class AuthController extends Controller
                 $user->username = $newuser;
             } else {
                 return response()->json([
-                    'message' => 'Required username is used into database.',
-                    'errors' => 'Username Conflict.'
+                    'message' => __('cipi.username_conflict_message'),
+                    'errors' => __('cipi.username_conflict')
                 ], 409);
             }
         }
@@ -148,8 +148,8 @@ class AuthController extends Controller
             $user->save();
         } else {
             return response()->json([
-                'message' => 'Given token is invalid.',
-                'errors' => 'Invalid token.'
+                'message' => __('cipi.invalid_token_message'),
+                'errors' => __('cipi.invalid_token')
             ], 401);
         }
     }

+ 61 - 61
app/Http/Controllers/ServerController.php

@@ -20,7 +20,7 @@ use Illuminate\Support\Facades\Validator;
 
 class ServerController extends Controller
 {
-    
+
     /**
      * List all servers
      *
@@ -127,7 +127,7 @@ class ServerController extends Controller
         return response()->json($response);
     }
 
-    
+
     /**
      * Add a new server
      *
@@ -241,22 +241,22 @@ class ServerController extends Controller
 
         if ($validator->fails()) {
             return response()->json([
-                'message' => 'Bad Request.',
+                'message' => __('cipi.bad_request'),
                 'errors' => $validator->errors()->getMessages()
             ], 400);
         }
 
         if ($request->ip == $request->server('SERVER_ADDR')) {
             return response()->json([
-                'message' => 'You cannot add a server with the same current server IP.',
-                'errors' => 'Server conflict.'
+                'message' => __('cipi.server_conflict_ip_current_message'),
+                'errors' => __('cipi.server_conflict')
             ], 409);
         }
 
         if (Server::where('ip', $request->ip)->first()) {
             return response()->json([
-                'message' => 'There is another server with same IP into database.',
-                'errors' => 'Server conflict.'
+                'message' => __('cipi.server_conflict_ip_duplicate_message'),
+                'errors' => __('cipi.server_conflict')
             ], 409);
         }
 
@@ -328,15 +328,15 @@ class ServerController extends Controller
 
         if (!$server) {
             return response()->json([
-                'message' => 'Required server does not exists into panel.',
-                'errors' => 'Server not found.'
+                'message' => __('cipi.server_not_found_message_default'),
+                'errors' => __('cipi.server_not_found')
             ], 404);
         }
 
         if ($server->default) {
             return response()->json([
-                'message' => 'Cannot delete default server from panel.',
-                'errors' => 'Bad Request.'
+                'message' => __('cipi.delete_default_server_message'),
+                'errors' => __('cipi.bad_request')
             ], 400);
         }
 
@@ -452,8 +452,8 @@ class ServerController extends Controller
 
         if (!$server) {
             return response()->json([
-                'message' => 'Required server does not exists into panel or it is not installed yet.',
-                'errors' => 'Server not found.'
+                'message' => __('cipi.server_not_found_message'),
+                'errors' => __('cipi.server_not_found')
             ], 404);
         }
 
@@ -568,8 +568,8 @@ class ServerController extends Controller
 
         if (!$server) {
             return response()->json([
-                'message' => 'Panel is not associated to a native server.',
-                'errors' => 'Server not found.'
+                'message' => __('cipi.server_not_found_native_message'),
+                'errors' => __('cipi.server_not_found')
             ], 404);
         }
 
@@ -650,8 +650,8 @@ class ServerController extends Controller
 
         if (!$server) {
             return response()->json([
-                'message' => 'Panel is not associated to a native server.',
-                'errors' => 'Server not found.'
+                'message' => __('cipi.server_not_found_native_message'),
+                'errors' => __('cipi.server_not_found')
             ], 404);
         }
 
@@ -667,7 +667,7 @@ class ServerController extends Controller
             ]);
             if ($validator->fails()) {
                 return response()->json([
-                    'message' => 'Bad Request.',
+                    'message' => __('cipi.bad_request'),
                     'errors' => $validator->errors()->getMessages()
                 ], 400);
             }
@@ -726,8 +726,8 @@ class ServerController extends Controller
 
         if (!$server) {
             return response()->json([
-                'message' => 'Panel is not associated to a native server.',
-                'errors' => 'Server not found.'
+                'message' => __('cipi.server_not_found_native_message'),
+                'errors' => __('cipi.server_not_found')
             ], 404);
         }
 
@@ -737,8 +737,8 @@ class ServerController extends Controller
             PanelDomainSslSSH::dispatch($server, $site)->delay(Carbon::now()->addSeconds(3));
         } else {
             return response()->json([
-                'message' => 'This is a SSL request but any panel domain has been configured for this server.',
-                'errors' => 'Bad Request.'
+                'message' => __('cipi.ssl_request_error_message'),
+                'errors' => __('cipi.bad_request')
             ], 400);
         }
 
@@ -899,8 +899,8 @@ class ServerController extends Controller
 
         if (!$server) {
             return response()->json([
-                'message' => 'Required server does not exists into panel or it is not installed yet.',
-                'errors' => 'Server not found.'
+                'message' => __('cipi.server_not_found_message'),
+                'errors' => __('cipi.server_not_found')
             ], 404);
         }
 
@@ -910,20 +910,20 @@ class ServerController extends Controller
             ]);
             if ($validator->fails()) {
                 return response()->json([
-                    'message' => 'Bad Request.',
+                    'message' => __('cipi.bad_request'),
                     'errors' => $validator->errors()->getMessages()
                 ], 400);
             }
             if (!$server->default && $request->ip == str_replace("\n", '', file_get_contents('https://checkip.amazonaws.com'))) {
                 return response()->json([
-                    'message' => 'You cannot edit a server using the same current server IP.',
-                    'errors' => 'Server conflict.'
+                    'message' => __('cipi.edit_server_current_ip_error_message'),
+                    'errors' => __('cipi.server_conflict')
                 ], 409);
             }
             if (Server::where('ip', $request->ip)->where('server_id', '<>', $server_id)->first()) {
                 return response()->json([
-                    'message' => 'There is another server with same IP into database.',
-                    'errors' => 'Server conflict.'
+                    'message' => __('cipi.server_conflict_ip_duplicate_message'),
+                    'errors' => __('cipi.server_conflict')
                 ], 409);
             }
             if ($server->default) {
@@ -939,7 +939,7 @@ class ServerController extends Controller
             ]);
             if ($validator->fails()) {
                 return response()->json([
-                    'message' => 'Bad Request.',
+                    'message' => __('cipi.bad_request'),
                     'errors' => $validator->errors()->getMessages()
                 ], 400);
             }
@@ -963,14 +963,14 @@ class ServerController extends Controller
         if ($request->php) {
             if (!in_array($request->php, config('cipi.phpvers'))) {
                 return response()->json([
-                    'message' => 'Bad Request.',
+                    'message' => __('cipi.bad_request'),
                     'errors' => 'Invalid PHP version.'
                 ], 400);
             }
             PhpCliSSH::dispatch($server, $request->php)->delay(Carbon::now()->addSeconds(3));
             $server->php = $request->php;
         }
-        
+
         $server->save();
 
         return response()->json([
@@ -1036,8 +1036,8 @@ class ServerController extends Controller
 
         if (!$server) {
             return response()->json([
-                'message' => 'Required server does not exists into panel or it is not installed yet.',
-                'errors' => 'Server not found.'
+                'message' => __('cipi.server_not_found_message'),
+                'errors' => __('cipi.server_not_found')
             ], 404);
         }
 
@@ -1047,14 +1047,14 @@ class ServerController extends Controller
                 //
             } else {
                 return response()->json([
-                    'message' => 'Required server is currently not available.',
-                    'errors' => 'Server Unavailable.'
+                    'message' => __('cipi.server_unavailable_message'),
+                    'errors' => __('cipi.server_unavailable')
                 ], 503);
             }
         } catch (\Throwable $th) {
             return response()->json([
-                'message' => 'Required server is currently not available.',
-                'errors' => 'Server Unavailable.'
+                'message' => __('cipi.server_unavailable_message'),
+                'errors' => __('cipi.server_unavailable')
             ], 503);
         }
     }
@@ -1130,8 +1130,8 @@ class ServerController extends Controller
 
         if (!$server) {
             return response()->json([
-                'message' => 'Required server does not exists into panel or it is not installed yet.',
-                'errors' => 'Server not found.'
+                'message' => __('cipi.server_not_found_message'),
+                'errors' => __('cipi.server_not_found')
             ], 404);
         }
 
@@ -1156,8 +1156,8 @@ class ServerController extends Controller
             $ssh = new SSH2($server->ip, 22);
             if (!$ssh->login('cipi', $server->password)) {
                 return response()->json([
-                    'message' => 'SSH error with server: '.$server->server_id,
-                    'errors' => 'Server Error.'
+                    'message' => __('cipi.server_error_ssh_error_message').$server->server_id,
+                    'errors' => __('cipi.server_error')
                 ], 500);
             }
             $ssh->setTimeout(360);
@@ -1165,8 +1165,8 @@ class ServerController extends Controller
             $ssh->exec('exit');
         } catch (\Throwable $th) {
             return response()->json([
-                'message' => 'Something went wrong.',
-                'errors' => 'Error.'
+                'message' => __('cipi.something_error_message'),
+                'errors' => __('cipi.error')
             ], 500);
         }
 
@@ -1231,18 +1231,18 @@ class ServerController extends Controller
         $server = Server::where('server_id', $server_id)->where('status', 1)->first();
         if (!$server) {
             return response()->json([
-                'message' => 'Required server does not exists into panel or it is not installed yet.',
-                'errors' => 'Server not found.'
+                'message' => __('cipi.server_not_found_message'),
+                'errors' => __('cipi.server_not_found')
             ], 404);
         }
-        
+
         $last_password = $server->password;
         $new_password = Str::random(24);
         $server->password = $new_password;
         $server->save();
 
         RootResetSSH::dispatch($server, $new_password, $last_password)->delay(Carbon::now()->addSeconds(1));
-        
+
         return response()->json([
             'password' => $server->password
         ]);
@@ -1304,16 +1304,16 @@ class ServerController extends Controller
     {
         if (!in_array($service, config('cipi.services'))) {
             return response()->json([
-                'message' => 'Required service is not valid.',
-                'errors' => 'Bad Request.'
+                'message' => __('cipi.invalid_service_error_message'),
+                'errors' => __('cipi.bad_request')
             ], 400);
         }
 
         $server = Server::where('server_id', $server_id)->where('status', 1)->first();
         if (!$server) {
             return response()->json([
-                'message' => 'Required server does not exists into panel or it is not installed yet.',
-                'errors' => 'Server not found.'
+                'message' => __('cipi.server_not_found_message'),
+                'errors' => __('cipi.server_not_found')
             ], 404);
         }
 
@@ -1321,8 +1321,8 @@ class ServerController extends Controller
             $ssh = new SSH2($server->ip, 22);
             if (!$ssh->login('cipi', $server->password)) {
                 return response()->json([
-                    'message' => 'SSH error with server: '.$server->server_id,
-                    'errors' => 'Server Error.'
+                    'message' => __('cipi.server_error_ssh_error_message').$server->server_id,
+                    'errors' => __('cipi.server_error')
                 ], 500);
             }
 
@@ -1354,8 +1354,8 @@ class ServerController extends Controller
             return response()->json([]);
         } catch (\Throwable $th) {
             return response()->json([
-                'message' => 'Something went wrong.',
-                'errors' => 'Error.'
+                'message' => __('cipi.something_error_message'),
+                'errors' => __('cipi.error')
             ], 500);
         }
     }
@@ -1443,11 +1443,11 @@ class ServerController extends Controller
         $server = Server::where('server_id', $server_id)->where('status', 1)->first();
         if (!$server) {
             return response()->json([
-                'message' => 'Required server does not exists into panel or it is not installed yet.',
-                'errors' => 'Server not found.'
+                'message' => __('cipi.server_not_found_message'),
+                'errors' => __('cipi.server_not_found')
             ], 404);
         }
-        
+
         $sites = Site::where('panel', false)->where('server_id', $server->id)->get();
         $response = [];
 
@@ -1508,8 +1508,8 @@ class ServerController extends Controller
         $server = Server::where('server_id', $server_id)->where('status', 1)->first();
         if (!$server) {
             return response()->json([
-                'message' => 'Required server does not exists into panel or it is not installed yet.',
-                'errors' => 'Server not found.'
+                'message' => __('cipi.server_not_found_message'),
+                'errors' => __('cipi.server_not_found')
             ], 404);
         }
 

+ 39 - 39
app/Http/Controllers/SiteController.php

@@ -299,7 +299,7 @@ class SiteController extends Controller
 
         if ($validator->fails()) {
             return response()->json([
-                'message' => 'Bad Request.',
+                'message' => __('cipi.bad_request'),
                 'errors' => $validator->errors()->getMessages()
             ], 400);
         }
@@ -307,8 +307,8 @@ class SiteController extends Controller
         if ($request->php) {
             if (!in_array($request->php, config('cipi.phpvers'))) {
                 return response()->json([
-                    'message' => 'Bad Request.',
-                    'errors' => 'Invalid PHP version.'
+                    'message' => __('cipi.bad_request'),
+                    'errors' => __('cipi.invalid_php_version')
                 ], 400);
             }
             $php = $request->php;
@@ -320,8 +320,8 @@ class SiteController extends Controller
 
         if (!$server) {
             return response()->json([
-                'message' => 'Required server does not exists into panel or it is not installed yet.',
-                'errors' => 'Server not found.'
+                'message' => __('cipi.server_not_found_message'),
+                'errors' => __('cipi.server_not_found')
             ], 404);
         }
 
@@ -338,8 +338,8 @@ class SiteController extends Controller
         }
         if ($conflict) {
             return response()->json([
-                'message' => 'Required domain is used by another site/alias on this server.',
-                'errors' => 'Site domain conflict.'
+                'message' => __('cipi.site_domain_conflict_message'),
+                'errors' => __('cipi.site_domain_conflict')
             ], 409);
         }
 
@@ -572,8 +572,8 @@ class SiteController extends Controller
 
         if (!$site) {
             return response()->json([
-                'message' => 'Required site does not exists into panel.',
-                'errors' => 'Site not found.'
+                'message' => __('cipi.site_not_found_message'),
+                'errors' => __('cipi.site_not_found')
             ], 404);
         }
 
@@ -583,7 +583,7 @@ class SiteController extends Controller
             ]);
             if ($validator->fails()) {
                 return response()->json([
-                    'message' => 'Bad Request.',
+                    'message' => __('cipi.bad_request'),
                     'errors' => $validator->errors()->getMessages()
                 ], 400);
             }
@@ -594,15 +594,15 @@ class SiteController extends Controller
                 foreach ($sites as $site) {
                     if ($request->domain == $site->domain) {
                         return response()->json([
-                            'message' => 'There is another site with same domain into database.',
-                            'errors' => 'Server conflict.'
+                            'message' => __('cipi.server_conflict_domain_message'),
+                            'errors' => __('cipi.server_conflict')
                         ], 409);
                     }
                     foreach ($site->aliases as $alias) {
                         if ($request->domain == $alias->domain) {
                             return response()->json([
-                                'message' => 'There is another alias with same domain into database.',
-                                'errors' => 'Server conflict.'
+                                'message' => __('cipi.server_conflict_alias_message'),
+                                'errors' => __('cipi.server_conflict')
                             ], 409);
                         }
                     }
@@ -673,7 +673,7 @@ class SiteController extends Controller
         }
 
         $site->save();
-        
+
         return response()->json([
             'site_id'           => $site->site_id,
             'domain'            => $site->domain,
@@ -845,8 +845,8 @@ class SiteController extends Controller
 
         if (!$site) {
             return response()->json([
-                'message' => 'Required site does not exists into panel.',
-                'errors' => 'Site not found.'
+                'message' => __('cipi.site_not_found_message'),
+                'errors' => __('cipi.site_not_found')
             ], 404);
         }
 
@@ -919,15 +919,15 @@ class SiteController extends Controller
 
         if (!$site) {
             return response()->json([
-                'message' => 'Required site does not exists into panel.',
-                'errors' => 'Site not found.'
+                'message' => __('cipi.site_not_found_message'),
+                'errors' => __('cipi.site_not_found')
             ], 404);
         }
 
         if ($site->panel) {
             return response()->json([
-                'message' => 'Cannot delete default site from panel.',
-                'errors' => 'Bad Request.'
+                'message' => __('cipi.bad_request_default_site_delete'),
+                'errors' => __('cipi.bad_request')
             ], 400);
         }
 
@@ -979,8 +979,8 @@ class SiteController extends Controller
 
         if (!$site) {
             return response()->json([
-                'message' => 'Required site does not exists into panel.',
-                'errors' => 'Site not found.'
+                'message' => __('cipi.site_not_found_message'),
+                'errors' => __('cipi.site_not_found')
             ], 404);
         }
 
@@ -1047,8 +1047,8 @@ class SiteController extends Controller
 
         if (!$site) {
             return response()->json([
-                'message' => 'Required site does not exists into panel.',
-                'errors' => 'Site not found.'
+                'message' => __('cipi.site_not_found_message'),
+                'errors' => __('cipi.site_not_found')
             ], 404);
         }
 
@@ -1124,8 +1124,8 @@ class SiteController extends Controller
 
         if (!$site) {
             return response()->json([
-                'message' => 'Required site does not exists into panel.',
-                'errors' => 'Site not found.'
+                'message' => __('cipi.site_not_found_message'),
+                'errors' => __('cipi.site_not_found')
             ], 404);
         }
 
@@ -1154,7 +1154,7 @@ class SiteController extends Controller
         }
 
         $site = Site::where('site_id', $site_id)->firstOrFail();
-        
+
         $data = [
             'username'      => $site->username,
             'password'      => $site->password,
@@ -1229,8 +1229,8 @@ class SiteController extends Controller
 
         if (!$site) {
             return response()->json([
-                'message' => 'Required site does not exists into panel.',
-                'errors' => 'Site not found.'
+                'message' => __('cipi.site_not_found_message'),
+                'errors' => __('cipi.site_not_found')
             ], 404);
         }
 
@@ -1311,8 +1311,8 @@ class SiteController extends Controller
 
         if (!$site) {
             return response()->json([
-                'message' => 'Required site does not exists into panel.',
-                'errors' => 'Site not found.'
+                'message' => __('cipi.site_not_found_message'),
+                'errors' => __('cipi.site_not_found')
             ], 404);
         }
 
@@ -1322,7 +1322,7 @@ class SiteController extends Controller
 
         if ($validator->fails()) {
             return response()->json([
-                'message' => 'Bad Request.',
+                'message' => __('cipi.bad_request'),
                 'errors' => $validator->errors()->getMessages()
             ], 400);
         }
@@ -1340,8 +1340,8 @@ class SiteController extends Controller
         }
         if ($conflict) {
             return response()->json([
-                'message' => 'Required domain is used by another site/alias on this server.',
-                'errors' => 'Domain conflict.'
+                'message' => __('cipi.site_domain_conflict_message'),
+                'errors' => __('cipi.site_domain_conflict')
             ], 409);
         }
 
@@ -1409,8 +1409,8 @@ class SiteController extends Controller
 
         if (!$site) {
             return response()->json([
-                'message' => 'Required site does not exists into panel.',
-                'errors' => 'Site not found.'
+                'message' => __('cipi.site_not_found_message'),
+                'errors' => __('cipi.site_not_found')
             ], 404);
         }
 
@@ -1418,8 +1418,8 @@ class SiteController extends Controller
 
         if (!$alias) {
             return response()->json([
-                'message' => 'Required alias does not exists into panel.',
-                'errors' => 'Alias not found.'
+                'message' => __('cipi.alias_not_found_message'),
+                'errors' => __('cipi.alias_not_found')
             ], 404);
         }
 

+ 224 - 0
resources/lang/en/cipi.php

@@ -0,0 +1,224 @@
+<?php
+
+return [
+
+    /*
+    |--------------------------------------------------------------------------
+    | Cipi Translations
+    |--------------------------------------------------------------------------
+    */
+
+    //Errors
+    'error' => 'Error',
+    'forbidden' => 'Forbidden',
+    'return_to_dashboard' => 'Return to Dashboard',
+    'file_not_found' => 'File not found',
+    'internal_server_error' => 'Internal Server Error',
+    'system_error' => 'System Error',
+    'unknown_error' => 'Ops! Something went wrong... try later!',
+    //AuthController errors
+    'invalid_login' => 'Username and password don\'t match',
+    'invalid_login_message' => 'Given credentials are invalid',
+    'invalid_token' => 'Invalid token',
+    'invalid_token_message' => 'Given token is invalid',
+    'username_conflict' => 'Username Conflict',
+    'username_conflict_message' => 'Required username is used into database',
+    //ServerController errors
+    'server_not_found_native_message' => 'Panel is not associated to a native server',
+    'server_conflict_ip_current_message' => 'You cannot add a server with the same current server IP',
+    'server_conflict_ip_duplicate_message' => 'There is another server with same IP into database',
+    'server_not_found_message_default' => 'Required server does not exists into panel',
+    'delete_default_server_message' => 'Cannot delete default server from panel',
+    'ssl_request_error_message' => 'This is a SSL request but any panel domain has been configured for this server',
+    'edit_server_current_ip_error_message' => 'You cannot edit a server using the same current server IP',
+    'server_unavailable' => 'Server Unavailable.',
+    'server_unavailable_message' => 'Required server is currently not available',
+    'server_error' => 'Server Error',
+    'server_error_ssh_error_message' => 'SSH error with server: ',
+    'something_error_message' => 'Something went wrong.',
+    'invalid_service_error_message' => 'Required service is not valid',
+    //SiteController errors
+    'bad_request' => 'Bad Request.',
+    'bad_request_default_site_delete' => 'Cannot delete default site from panel',
+    'invalid_php_version' => 'Invalid PHP version.',
+    'server_not_found' => 'Server not found.',
+    'server_not_found_message' => 'Required server does not exists into panel or it is not installed yet.',
+    'site_domain_conflict' => 'Site domain conflict.',
+    'site_domain_conflict_message' => 'Required domain is used by another site/alias on this server.',
+    'site_not_found' => 'Site not found.',
+    'site_not_found_message' => 'Required site does not exists into panel.',
+    'server_conflict' => 'Server conflict.',
+    'server_conflict_domain_message' => 'There is another site with same domain into database.',
+    'server_conflict_alias_message' => 'There is another alias with same domain into database.',
+    'alias_not_found' => 'Alias not found',
+    'alias_not_found_message' => 'Required alias does not exists into panel',
+    'domain_conflict' => 'Domain conflict',
+    'domain_conflict_message' => 'Required domain is used by another site/alias on this server',
+
+    //Sidebar Menu
+    'menu' => 'MENU',
+    'sidebar_menu' => [
+        'dashboard' => 'Dashboard',
+        'servers' => 'Servers',
+        'sites' => 'Sites',
+        'settings' => 'Settings',
+        'documentation' => 'Documentation',
+        'logout' => 'Logout',
+    ],
+    //Sidebar info
+    'panel_version' => 'Panel version',
+    'logged_in_as' => 'Logged in as',
+
+    //Titles
+    'titles' => [
+        'dashboard' => 'Dashboard',
+        'servers' => 'Manage Servers',
+        'server' => 'Manage Server',
+        'sites' => 'Manage Sites',
+        'site' => 'Manage Site',
+        'settings' => 'Manage Settings',
+    ],
+
+    //General
+    'loading_data' => 'Loading data',
+    'no_results_found' => 'There\'s nothing here, yet!',
+    'loading_please_wait' => 'Loading, please wait',
+    'cpu' => 'CPU',
+    'ram' => 'RAM',
+    'hdd' => 'HDD',
+    'manage' => 'Manage',
+    'login' => 'Login',
+    'username' => 'Username',
+    'password' => 'Password',
+    'host' => 'Host',
+    'port' => 'Port',
+    'path' => 'Path',
+    'database' => 'Database',
+    'name' => 'Name',
+    'new_button' => 'New :type',
+    'actions' => 'Actions',
+    'delete' => 'Delete',
+    'confirm' => 'Confirm',
+    'update' => 'Update',
+    'save' => 'Save',
+    'restart' => 'Restart',
+    'unknown' => 'Unknown',
+    'submit' => 'Submit',
+
+    //Dashboard
+    'dashboard' => 'Dashboard',
+    'add_new_server' => 'ADD A SERVER NOW',
+
+    //PDF
+    'pdf_site_php_version' => 'Your site <i>:domain</i> is PHP :php based!',
+    'pdf_take_care' => 'Take care about this data :)',
+
+    //Servers
+    'server' => 'Server',
+    'servers' => 'Servers',
+    'install' => 'Install',
+    'wait' => 'Wait...',
+    'provider' => 'Provider',
+    'location' => 'Location',
+    'delete_server' => 'Delete Server',
+    'delete_server_confirmation' => 'Are you sure to delete server',
+    'delete_server_confirmation_ip' => 'To confirm it write server IP',
+    'server_setup' => 'Server Setup',
+    'server_setup_title' => 'To install your server:',
+    'server_setup_step1' => 'Use a clean Ubuntu Server 20.04 LTS fresh installation VPS',
+    'server_setup_step2' => 'Login into your VPS via SSH (as root):',
+    'server_setup_step3' => 'Run this command:',
+    'server_setup_step4' => 'Installation may take up to thirty minutes depending on your server resources',
+    'server_setup_step5' => 'Be sure that ports 22, 80 and 443 of your VPS firewall are open',
+    'server_setup_step6' => 'AWS disables root login by default. Use command \'sudo -s\' to run as root',
+    'server_setup_step7' => 'Cipi doesn\'t work with NAT VPN and OpenVZ or in localhost',
+    'server_setup_step8' => 'Before install Cipi, please make sure your server is a clean Ubuntu 20.04 LTS VPS',
+    'create_server_title' => 'Add a New Server',
+    'server_name' => 'Server Name',
+    'server_ip' => 'Server IP',
+    'server_provider' => 'Server Provider',
+    'server_location' => 'Server Location',
+
+    //Server
+    'server_cpu_realtime_load' => 'CPU Realtime Load',
+    'server_ram_realtime_load' => 'RAM Realtime Load',
+    'server_information' => 'Server Information',
+    'system_services' => 'System Services',
+    'tools' => 'Tools',
+    'php_cli_version' => 'PHP CLI version',
+    'manage_cron_jobs' => 'Manage Cron Jobs',
+    'edit_crontab' => 'Edit Crontab',
+    'reset_cipi_password' => 'Reset Cipi user password',
+    'require_reset_cipi_password' => 'Require Reset',
+    'hd_memory_usage' => 'HD Memory Usage',
+    'cipi_build_version' => 'Cipi Build Version',
+    'update_server_modal_title' => 'Update Server Information',
+    'update_server_modal_text' => 'Are your sure to update server information?',
+    'update_server_modal_ip' => 'YOU ARE UPDATING SERVER IP!<br>BE AWARE THAT IF NEW IP: <span id="newip" class="text-danger"></span> IS NOT CORRECT YOU COULD LOST YOUR SERVER CONNECTION!',
+    'server_crontab' => 'Server Crontab',
+    'server_crontab_edit' => 'Edit Server Crontab',
+    'require_password_reset_modal_title' => 'Request Password Reset',
+    'require_password_reset_modal_text' => 'Are you sure to reset Cipi user password?',
+    'new_password_success' => 'New Cipi user password',
+
+    //Sites
+    'site' => 'Site',
+    'sites' => 'Sites',
+    'domain' => 'Domain',
+    'aliases' => 'Aliases',
+    'new_site_modal_title' => 'Add a New Site',
+    'site_domain' => 'Site Domain',
+    'site_base_path' => 'Base Path',
+    'php_version' => 'PHP Version',
+    'site_ready_message' => 'Your site is ready!',
+    'document_root' => 'Document Root',
+    'download_site_data' => 'Download (3 minutes link)',
+    'delete_site_modal_title' => 'Delete Site',
+    'delete_site_modal_text' => 'Are you sure to delete site <b><span id="deletesitename"></span></b> and its database and aliases?',
+
+    //Site
+    'basic_information' => 'Basic information',
+    'manage_aliases' => 'Manage Aliases',
+    'add_alias' => 'Add Alias',
+    'ssl_security' => 'SSL\'s and Security',
+    'ssl_security_text' => 'Require and generate free Let\'s Encrypt certificate for site domain and aliases',
+    'ssl_generate' => 'Generate SSL\'s',
+    'password_resets' => 'Passwords Reset',
+    'application_installer' => 'Application Installer',
+    'coming_soon' => 'Coming soon...',
+    'github_repository' => 'Github Repository',
+    'github_repository_setup' => 'Set up a Github Repository',
+    'github_repository_config' => 'Repo Configuration',
+    'github_repository_scripts' => 'Edit deploy scripts',
+    'github_repository_deploy' => 'To run deploy',
+    'php_fpm_version' => 'PHP-FPM Version',
+    'repository_project' => 'Project',
+    'repository_branch' => 'Branch',
+    'repository_deploy_key' => 'Deploy Key',
+    'repository_deploy_key_info' => '(<a href="#" id="copykey">Copy</a> and add it <a href="https://github.com/settings/ssh/new" target="blank">here</a>)',
+    'deploy_scripts' => 'Site Deploy Scripts',
+    'require_ssh_password_reset_modal_text' => 'Are you sure to reset site SSH password?',
+    'require_mysql_password_reset_modal_text' => 'Are you sure to reset site MySql password?',
+    'new_ssh_password_success' => 'Your SSH password has been reset',
+    'new_mysql_password_success' => 'Your Mysql password has been reset',
+
+    //Settings
+    'change_username' => 'Change Username',
+    'change_username_placeholder' => 'New username (at least 6 chars)',
+    'current_username' => 'Current Username',
+    'change_password' => 'Change Password',
+    'change_password_placeholder' => 'New password (at least 8 chars)',
+    'update_password' => 'Update your Password',
+    'panel_url' => 'Panel URL',
+    'panel_url_force_ssl' => 'Require SSL',
+    'panel_url_text' => 'Custom panel domain/subdomain',
+    'panel_api' => 'Panel API',
+    'panel_api_endpoint' => 'API Endpoint',
+    'renew_api_key' => 'Renew API Key',
+    'documentation' => 'Documentation',
+    'action_authorization_modal_title' => 'Action Authorization',
+    'action_authorization_modal_text' => 'To authorize this action insert your current password',
+    'username_updated_success' => 'Username has been updated',
+    'password_updated_success' => 'Password has been updated',
+    'new_api_key_success' => 'New API Key',
+];

+ 16 - 16
resources/views/dashboard.blade.php

@@ -2,7 +2,7 @@
 
 
 @section('title')
-Dashboard
+    {{ __('cipi.titles.dashboard') }}
 @endsection
 
 
@@ -35,37 +35,37 @@ count=0;
 $.ajax({
     type: 'GET',
     url: '/api/servers',
-    success: function(data) { 
-        $('#mainloading').addClass('d-none');       
+    success: function(data) {
+        $('#mainloading').addClass('d-none');
         data.forEach(server => {
             if(server.status > 0) {
                 $.ajax({
                     type: 'GET',
                     url: '/api/servers/'+server.server_id+'/healthy',
                     beforeSend: function() {
-                        $('#ram-'+server.server_id).html('<i class="fas fa-spinner fa-spin"></i>');
-                        $('#cpu-'+server.server_id).html('<i class="fas fa-spinner fa-spin"></i>');
-                        $('#hdd-'+server.server_id).html('<i class="fas fa-spinner fa-spin"></i>');
+                        $('#ram-'+server.server_id).html('<i class="fas fa-spinner fa-spin" title="{{ __('cipi.loading_please_wait') }}"></i>');
+                        $('#cpu-'+server.server_id).html('<i class="fas fa-spinner fa-spin" title="{{ __('cipi.loading_please_wait') }}"></i>');
+                        $('#hdd-'+server.server_id).html('<i class="fas fa-spinner fa-spin" title="{{ __('cipi.loading_please_wait') }}"></i>');
                     },
-                    success: function(data) {        
+                    success: function(data) {
                         $('#ram-'+server.server_id).html(data.ram+'%');
                         $('#cpu-'+server.server_id).html(data.cpu+'%');
                         $('#hdd-'+server.server_id).html(data.hdd+'%');
                     }
                 });
-                $('#dashboard').append('<div class="row servercard" serverid="'+server.server_id+'"><div class="col-sm-12 mb-4"><div class="card border-left-default shadow h-100 py-2"><div class="card-body"><div class="row no-gutters align-items-center"><div class="col mr-2"><div class="text-xs font-weight-bold text-default text-uppercase mb-1 d-none d-lg-block">Server</div><div class="h4 mb-0 font-weight-bold text-gray-800 mb-1">'+server.name+'</div></div><div class="col mr-2 d-none d-xl-block"><div class="text-xs font-weight-bold text-default text-uppercase mb-1 text-center">SITES</div><div class="h6 mb-0 font-weight-bold text-gray-800 mb-1 text-center">'+server.sites+'</div></div><div class="col mr-2 d-none d-lg-block"><div class="text-xs font-weight-bold text-default text-uppercase mb-1 text-center">CPU</div><div class="h6 mb-0 font-weight-bold text-gray-800 mb-1 text-center" id="cpu-'+server.server_id+'"><i class="fas fa-spinner fa-spin"></i></div></div><div class="col mr-2 d-none d-lg-block"><div class="text-xs font-weight-bold text-default text-uppercase mb-1 text-center">RAM</div><div class="h6 mb-0 font-weight-bold text-gray-800 mb-1 text-center" id="ram-'+server.server_id+'"><i class="fas fa-spinner fa-spin"></i></div></div><div class="col mr-2 d-none d-lg-block"><div class="text-xs font-weight-bold text-default text-uppercase mb-1 text-center">HDD</div><div class="h6 mb-0 font-weight-bold text-gray-800 mb-1 text-center" id="hdd-'+server.server_id+'"><i class="fas fa-spinner fa-spin"></i></div></div><div class="col-auto"><a href="/servers/'+server.server_id+'"><i class="fas fa-arrow-circle-right fa-2x text-gray-300" id="ping-'+server.server_id+'"></i></a></div></div></div></div></div></div>');
+                $('#dashboard').append('<div class="row servercard" serverid="'+server.server_id+'"><div class="col-sm-12 mb-4"><div class="card border-left-default shadow h-100 py-2"><div class="card-body"><div class="row no-gutters align-items-center"><div class="col mr-2"><div class="text-xs font-weight-bold text-default text-uppercase mb-1 d-none d-lg-block">{{ __('cipi.server') }}</div><div class="h4 mb-0 font-weight-bold text-gray-800 mb-1">'+server.name+'</div></div><div class="col mr-2 d-none d-xl-block"><div class="text-xs font-weight-bold text-default text-uppercase mb-1 text-center">{{ __('cipi.sites') }}</div><div class="h6 mb-0 font-weight-bold text-gray-800 mb-1 text-center">'+server.sites+'</div></div><div class="col mr-2 d-none d-lg-block"><div class="text-xs font-weight-bold text-default text-uppercase mb-1 text-center">{{ __('cipi.cpu') }}</div><div class="h6 mb-0 font-weight-bold text-gray-800 mb-1 text-center" id="cpu-'+server.server_id+'"><i class="fas fa-spinner fa-spin" title="{{ __('cipi.loading_please_wait') }}"></i></div></div><div class="col mr-2 d-none d-lg-block"><div class="text-xs font-weight-bold text-default text-uppercase mb-1 text-center">{{ __('cipi.ram') }}</div><div class="h6 mb-0 font-weight-bold text-gray-800 mb-1 text-center" id="ram-'+server.server_id+'"><i class="fas fa-spinner fa-spin" title="{{ __('cipi.loading_please_wait') }}"></i></div></div><div class="col mr-2 d-none d-lg-block"><div class="text-xs font-weight-bold text-default text-uppercase mb-1 text-center">{{ __('cipi.hdd') }}</div><div class="h6 mb-0 font-weight-bold text-gray-800 mb-1 text-center" id="hdd-'+server.server_id+'"><i class="fas fa-spinner fa-spin" title="{{ __('cipi.loading_please_wait') }}"></i></div></div><div class="col-auto"><a href="/servers/'+server.server_id+'" title="{{ __('cipi.manage') }}"><i class="fas fa-arrow-circle-right fa-2x text-gray-300" id="ping-'+server.server_id+'"></i></a></div></div></div></div></div></div>');
                 count=count+1;
             }
         });
         if(count = 0) {
-            $('#dashboard').html('<div class="col-sm-12 text-center"><div class="space"></div><div class="space"></div><div class="space"></div><i class="fab fa-linux fa-10x"></i><h4>There\'s nothing here, yet!</h4><div class="space"></div><a href="/servers" class="btn btn-primary">ADD A SERVER NOW!</a><div class="space"></div></div>');
+            $('#dashboard').html('<div class="col-sm-12 text-center"><div class="space"></div><div class="space"></div><div class="space"></div><i class="fab fa-linux fa-10x"></i><h4>{{ __('cipi.no_results_found') }}</h4><div class="space"></div><a href="/servers" class="btn btn-primary">{{ __('cipi.add_new_server') }}!</a><div class="space"></div></div>');
         }
     }
 });
 
 
 //Refresh Servers Status
-setInterval(function() { 
+setInterval(function() {
     $('.servercard').each(function(server) {
         var thisserverping = $(this).attr('serverid');
         (function(thisserverping){
@@ -79,7 +79,7 @@ setInterval(function() {
                     $('#ping-'+thisserverping).addClass('fa-spinner');
                     $('#ping-'+thisserverping).addClass('fa-spin');
                 },
-                success: function(data) {    
+                success: function(data) {
                     $('#ping-'+thisserverping).removeClass('text-secondary');
                     $('#ping-'+thisserverping).removeClass('fa-spinner');
                     $('#ping-'+thisserverping).removeClass('fa-spin');
@@ -92,7 +92,7 @@ setInterval(function() {
 }, 10000);
 
 //Refresh Servers Status
-setInterval(function() { 
+setInterval(function() {
     $('.servercard').each(function(server) {
         var thisserverstatus = $(this).attr('serverid');
         (function(thisserverstatus){
@@ -100,9 +100,9 @@ setInterval(function() {
                 type: 'GET',
                 url: '/api/servers/'+thisserverstatus+'/healthy',
                 beforeSend: function() {
-                    $('#ram-'+thisserverstatus).html('<i class="fas fa-spinner fa-spin"></i>');
-                    $('#cpu-'+thisserverstatus).html('<i class="fas fa-spinner fa-spin"></i>');
-                    $('#hdd-'+thisserverstatus).html('<i class="fas fa-spinner fa-spin"></i>');
+                    $('#ram-'+thisserverstatus).html('<i class="fas fa-spinner fa-spin" title="{{ __('cipi.loading_please_wait') }}"></i>');
+                    $('#cpu-'+thisserverstatus).html('<i class="fas fa-spinner fa-spin" title="{{ __('cipi.loading_please_wait') }}"></i>');
+                    $('#hdd-'+thisserverstatus).html('<i class="fas fa-spinner fa-spin" title="{{ __('cipi.loading_please_wait') }}"></i>');
                 },
                 success: function(data) {
                     $('#ram-'+thisserverstatus).html(data.ram+'%');
@@ -117,4 +117,4 @@ setInterval(function() {
 </script>
 
 
-@endsection
+@endsection

+ 3 - 3
resources/views/errors/403.blade.php

@@ -5,7 +5,7 @@
         <meta charset="utf-8" />
         <meta http-equiv="X-UA-Compatible" content="IE=edge" />
         <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
-        <title>{{ config('cipi.name') }} | Forbidden</title>
+        <title>{{ config('cipi.name') }} | {{ __('cipi.forbidden') }}</title>
         <link href="/assets/css/app.css" rel="stylesheet" />
         <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/js/all.min.js"></script>
     </head>
@@ -20,10 +20,10 @@
                             <div class="col-lg-6">
                                 <div class="text-center mt-4">
                                     <img class="mb-4 img-error" src="/assets/img/forbidden.jpg" />
-                                    <p class="lead"><b>Error 403</b> | Forbidden</p>
+                                    <p class="lead"><b>{{ __('cipi.error') }} 403</b> | {{ __('cipi.forbidden') }}</p>
                                     <a href="/">
                                         <i class="fas fa-arrow-left mr-1"></i>
-                                        Return to Dashboard
+                                        {{ __('cipi.return_to_dashboard') }}
                                     </a>
                                 </div>
                             </div>

+ 3 - 3
resources/views/errors/404.blade.php

@@ -5,7 +5,7 @@
         <meta charset="utf-8" />
         <meta http-equiv="X-UA-Compatible" content="IE=edge" />
         <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
-        <title>{{ config('cipi.name') }} | File Not Found</title>
+        <title>{{ config('cipi.name') }} | {{ __('cipi.file_not_found') }}</title>
         <link href="/assets/css/app.css" rel="stylesheet" />
         <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/js/all.min.js"></script>
     </head>
@@ -20,10 +20,10 @@
                             <div class="col-lg-6">
                                 <div class="text-center mt-4">
                                     <img class="mb-4 img-error" src="/assets/img/notfound.png" />
-                                    <p class="lead"><b>Error 404</b> | File not found</p>
+                                    <p class="lead"><b>{{ __('cipi.error') }} 404</b> | {{ __('cipi.file_not_found') }}</p>
                                     <a href="/">
                                         <i class="fas fa-arrow-left mr-1"></i>
-                                        Return to Dashboard
+                                        {{ __('cipi.return_to_dashboard') }}
                                     </a>
                                 </div>
                             </div>

+ 3 - 3
resources/views/errors/500.blade.php

@@ -5,7 +5,7 @@
         <meta charset="utf-8" />
         <meta http-equiv="X-UA-Compatible" content="IE=edge" />
         <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
-        <title>{{ config('cipi.name') }} | Error</title>
+        <title>{{ config('cipi.name') }} | {{ __('cipi.error') }}</title>
         <link href="/assets/css/app.css" rel="stylesheet" />
         <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/js/all.min.js"></script>
     </head>
@@ -20,10 +20,10 @@
                             <div class="col-lg-6">
                                 <div class="text-center mt-4">
                                     <img class="mb-4 img-error" src="/assets/img/error.png" />
-                                    <p class="lead"><b>Error 500</b> | Internal Server Error</p>
+                                    <p class="lead"><b>{{ __('cipi.error') }} 500</b> | {{ __('cipi.internal_server_error') }}</p>
                                     <a href="/">
                                         <i class="fas fa-arrow-left mr-1"></i>
-                                        Return to Dashboard
+                                        {{ __('cipi.return_to_dashboard') }}
                                     </a>
                                 </div>
                             </div>

+ 9 - 9
resources/views/login.blade.php

@@ -5,7 +5,7 @@
         <meta charset="utf-8" />
         <meta http-equiv="X-UA-Compatible" content="IE=edge" />
         <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
-        <title>{{ config('cipi.name') }} | Login</title>
+        <title>{{ config('cipi.name') }} | {{ __('cipi.login') }}</title>
         <meta name="csrf-token" content="{{ csrf_token() }}">
         <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/js/all.min.js"></script>
         <link rel="icon" type="image/png" href="/favicon.png" />
@@ -31,18 +31,18 @@
                                     <div class="card-body">
                                         <form>
                                             <div class="text-center">
-                                                <h1>Login</h1>
+                                                <h1>{{ __('cipi.login') }}</h1>
                                             </div>
                                             <div class="form-group">
-                                                <label class="small mb-1" for="username">Username</label>
+                                                <label class="small mb-1" for="username">{{ __('cipi.username') }}</label>
                                                 <input class="form-control py-4" id="username" type="email" placeholder="john.doe" />
                                             </div>
                                             <div class="form-group">
-                                                <label class="small mb-1" for="password">Password</label>
+                                                <label class="small mb-1" for="password">{{ __('cipi.password') }}</label>
                                                 <input class="form-control py-4" id="password" type="password" placeholder="********" />
                                             </div>
                                             <div class="form-group d-flex justify-content-end mt-4 mb-0">
-                                                <a class="btn btn-primary" id="login">OK <i class="fas fa-circle-notch fa-spin d-none" id="loading"></i></a>
+                                                <a class="btn btn-primary" id="login">{{ __('cipi.login') }} <i class="fas fa-circle-notch fa-spin d-none" id="loading"></i></a>
                                             </div>
                                         </form>
                                     </div>
@@ -64,7 +64,7 @@
 
             //Clear current auth
             localStorage.clear();
-        
+
             //Validation check
             function loginValidate() {
                 validation = true;
@@ -139,12 +139,12 @@
             $(document).keypress(function(e) {
                 var keycode = (e.keyCode ? e.keyCode : e.which);
                 if(keycode == '13'){
-                    loginSubmit(); 
+                    loginSubmit();
                 }
             });
 
         </script>
 
     </body>
-    
-</html>
+
+</html>

+ 15 - 15
resources/views/pdf.blade.php

@@ -10,38 +10,38 @@
 </head>
 <body>
 	<center>
-		<h4>SITE</h4>
+		<h4>{{ strtoupper(__('cipi.site')) }}</h4>
 		<h1>{{ $domain }}</h1>
     </center>
 	<br>
     <h3>SSH/SFTP</h3>
 	<ul>
-		<li><b>Host</b> {{$ip}}</li>
-		<li><b>Port</b> 22</li>
-		<li><b>User</b> {{$username}}</li>
-        <li><b>Pass</b> {{$password}}</li>
-        <li><b>Path</b> /home/{{ $username }}/web/{{ $path }}</li>
+		<li><b>{{ __('cipi.host') }}</b> {{$ip}}</li>
+		<li><b>{{ __('cipi.port') }}</b> 22</li>
+		<li><b>{{ __('cipi.username') }}</b> {{$username}}</li>
+        <li><b>{{ __('cipi.password') }}</b> {{$password}}</li>
+        <li><b>{{ __('cipi.path') }}</b> /home/{{ $username }}/web/{{ $path }}</li>
 	</ul>
 	<br>
 	<hr>
 	<br>
-	<h3>Database</h3>
+	<h3>{{ __('cipi.database') }}</h3>
 	<ul>
-		<li><b>Host</b> 127.0.0.1</li>
-		<li><b>Port</b> 3306</li>
-		<li><b>User</b> {{$username}}</li>
-		<li><b>Pass</b> {{$dbpass}}</li>
-		<li><b>Name</b> {{$username}}</li>
+		<li><b>{{ __('cipi.host') }}</b> 127.0.0.1</li>
+		<li><b>{{ __('cipi.port') }}</b> 3306</li>
+		<li><b>{{ __('cipi.username') }}</b> {{$username}}</li>
+		<li><b>{{ __('cipi.password') }}</b> {{$dbpass}}</li>
+		<li><b>{{ __('cipi.name') }}</b> {{$username}}</li>
     </ul>
     <br>
 	<hr>
     <br>
     <center>
-        <p>Your site <i>{{ $domain }}</i> is PHP {{ $php }} based!</p>
+        <p>{!! __('pdf_site_php_version', ['domain' => $domain, 'php' => $php]) !!}</p>
     </center>
     <br>
 	<center>
-		<p>Take care about this data :)</p>
+		<p>{{ __('cipi.pdf_take_care') }}</p>
 	</center>
     <br>
     <br>
@@ -50,4 +50,4 @@
 		<h5>{{ config('cipi.name') }}<br>({{ config('cipi.website') }})</h5>
 	</center>
 </body>
-</html>
+</html>

+ 44 - 44
resources/views/server.blade.php

@@ -2,7 +2,7 @@
 
 
 @section('title')
-Manage Server
+    {{ __('cipi.titles.server') }}
 @endsection
 
 
@@ -10,7 +10,7 @@ Manage Server
 @section('content')
 <ol class="breadcrumb mb-4">
     <li class="ml-1 breadcrumb-item active">IP:<b><span class="ml-1" id="serveriptop"></span></b></li>
-    <li class="ml-1 breadcrumb-item active">Sites:<b><span class="ml-1" id="serversites"></span></b></li>
+    <li class="ml-1 breadcrumb-item active">{{ __('cipi.sites') }}:<b><span class="ml-1" id="serversites"></span></b></li>
     <li class="ml-1 breadcrumb-item active">Ping:<b><span class="ml-1" id="serverping"><i class="fas fa-circle-notch fa-spin"></i></span></b></li>
 </ol>
 <div class="row">
@@ -18,7 +18,7 @@ Manage Server
         <div class="card mb-4">
             <div class="card-header">
                 <i class="fas fa-microchip fs-fw mr-1"></i>
-                CPU Realtime Load
+                {{ __('cipi.server_cpu_realtime_load') }}
             </div>
             <div class="card-body">
                 <canvas id="cpuChart" width="100%" height="40"></canvas>
@@ -30,7 +30,7 @@ Manage Server
         <div class="card mb-4">
             <div class="card-header">
                 <i class="fas fa-memory fs-fw mr-1"></i>
-                RAM Realtime Usage
+                {{ __('cipi.server_ram_realtime_load') }}
             </div>
             <div class="card-body">
                 <canvas id="ramChart" width="100%" height="40"></canvas>
@@ -44,31 +44,31 @@ Manage Server
         <div class="card mb-4">
             <div class="card-header">
                 <i class="fas fa-info-circle fs-fw mr-1"></i>
-                Server information
+                {{ __('cipi.server_information') }}
             </div>
             <div class="card-body">
-                <p>Server name:</p>
+                <p>{{ __('cipi.server_name') }}:</p>
                 <div class="input-group">
                     <input class="form-control" type="text" placeholder="Production" id="servername" autocomplete="off" />
                 </div>
                 <div class="space"></div>
-                <p>Server IP:</p>
+                <p>{{ __('cipi.server_ip') }}:</p>
                 <div class="input-group">
                     <input class="form-control" type="text" placeholder="123.123.123.123" id="serverip" autocomplete="off" />
                 </div>
                 <div class="space"></div>
-                <p>Server Provider:</p>
+                <p>{{ __('cipi.server_provider') }}:</p>
                 <div class="input-group">
                     <input class="form-control" type="text" placeholder="Digital Ocean" id="serverprovider" autocomplete="off" />
                 </div>
                 <div class="space"></div>
-                <p>Server Location:</p>
+                <p>{{ __('cipi.server_location') }}:</p>
                 <div class="input-group">
                     <input class="form-control" type="text" placeholder="Amsterdam" id="serverlocation" autocomplete="off" />
                 </div>
                 <div class="space"></div>
                 <div class="text-center">
-                    <button class="btn btn-primary" type="button" id="updateServer">Update</button>
+                    <button class="btn btn-primary" type="button" id="updateServer">{{ __('cipi.update') }}</button>
                 </div>
                 <div class="space"></div>
                 <div class="space"></div>
@@ -80,32 +80,32 @@ Manage Server
         <div class="card mb-4">
             <div class="card-header">
                 <i class="fas fa-power-off fs-fw mr-1"></i>
-                System services
+                {{ __('cipi.system_services') }}
             </div>
             <div class="card-body">
                 <p>nginx</p>
                 <div class="text-center">
-                    <button class="btn btn-warning" type="button" id="restartnginx">Restart <i class="fas fa-circle-notch fa-spin d-none" id="loadingnginx"></i></button>
+                    <button class="btn btn-warning" type="button" id="restartnginx">{{ __('cipi.restart') }} <i class="fas fa-circle-notch fa-spin d-none" id="loadingnginx"></i></button>
                 </div>
                 <div class="space"></div>
                 <p>PHP-FPM</p>
                 <div class="text-center">
-                    <button class="btn btn-warning" type="button" id="restartphp">Restart <i class="fas fa-circle-notch fa-spin d-none" id="loadingphp"></i></button>
+                    <button class="btn btn-warning" type="button" id="restartphp">{{ __('cipi.restart') }} <i class="fas fa-circle-notch fa-spin d-none" id="loadingphp"></i></button>
                 </div>
                 <div class="space"></div>
                 <p>MySql</p>
                 <div class="text-center">
-                    <button class="btn btn-warning" type="button" id="restartmysql">Restart <i class="fas fa-circle-notch fa-spin d-none" id="loadingmysql"></i></button>
+                    <button class="btn btn-warning" type="button" id="restartmysql">{{ __('cipi.restart') }} <i class="fas fa-circle-notch fa-spin d-none" id="loadingmysql"></i></button>
                 </div>
                 <div class="space"></div>
                 <p>Redis</p>
                 <div class="text-center">
-                    <button class="btn btn-warning" type="button" id="restartredis">Restart <i class="fas fa-circle-notch fa-spin d-none" id="loadingredis"></i></button>
+                    <button class="btn btn-warning" type="button" id="restartredis">{{ __('cipi.restart') }} <i class="fas fa-circle-notch fa-spin d-none" id="loadingredis"></i></button>
                 </div>
                 <div class="space"></div>
                 <p>Supervisor</p>
                 <div class="text-center">
-                    <button class="btn btn-warning" type="button" id="restartsupervisor">Restart <i class="fas fa-circle-notch fa-spin d-none" id="loadingsupervisor"></i></button>
+                    <button class="btn btn-warning" type="button" id="restartsupervisor">{{ __('cipi.restart') }} <i class="fas fa-circle-notch fa-spin d-none" id="loadingsupervisor"></i></button>
                 </div>
                 <div class="space"></div>
             </div>
@@ -115,10 +115,10 @@ Manage Server
         <div class="card mb-4">
             <div class="card-header">
                 <i class="fas fa-tools fs-fw mr-1"></i>
-                Tools
+                {{ __('cipi.tools') }}
             </div>
             <div class="card-body">
-                <p>PHP CLI version:</p>
+                <p>{{ __('cipi.php_cli_version') }}:</p>
                 <div class="input-group">
                     <select class="form-control" id="phpver">
                         <option value="8.0" id="php80">8.0</option>
@@ -130,22 +130,22 @@ Manage Server
                     </div>
                 </div>
                 <div class="space"></div>
-                <p>Manage Cron Jobs:</p>
+                <p>{{ __('cipi.manage_cron_jobs') }}:</p>
                 <div>
-                    <button class="btn btn-primary" type="button" id="editcrontab">Edit Crontab</button>
+                    <button class="btn btn-primary" type="button" id="editcrontab">{{ __('cipi.edit_crontab') }}</button>
                 </div>
                 <div class="space"></div>
-                <p>Reset cipi user password:</p>
+                <p>{{ __('cipi.reset_cipi_password') }}:</p>
                 <div>
-                    <button class="btn btn-danger" type="button" id="rootreset">Require Reset</button>
+                    <button class="btn btn-danger" type="button" id="rootreset">{{ __('cipi.require_reset_cipi_password') }}</button>
                 </div>
                 <div class="space"></div>
-                <p>HD memory usage:</p>
+                <p>{{ __('cipi.hd_memory_usage') }}:</p>
                 <div>
-                    <span class="btn" id="hd"><i class="fas fa-circle-notch fa-spin"></i></span>
+                    <span class="btn" id="hd"><i class="fas fa-circle-notch fa-spin" title="{{ __('cipi.loading_data') }}"></i></span>
                 </div>
                 <div class="space"></div>
-                <p>Cipi build version:</p>
+                <p>{{ __('cipi.cipi_build_version') }}:</p>
                 <div>
                     <span class="btn btn-secondary" id="serverbuild"><i class="fas fa-circle-notch fa-spin"></i></span>
                 </div>
@@ -164,16 +164,16 @@ Manage Server
     <div class="modal-dialog" role="document" id="updateserverdialog">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title" id="updateServerModalLabel">Update server information</h5>
+                <h5 class="modal-title" id="updateServerModalLabel">{{ __('cipi.update_server_modal_title') }}</h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                 <span aria-hidden="true">&times;</span>
                 </button>
             </div>
             <div class="modal-body">
-                <p>Are your sure to update server information?</p>
-                <p class="d-none" id="ipnotice"><b>YOU ARE UPDATING SERVER IP!<br>BE AWARE THAT IF NEW IP: <span id="newip" class="text-danger"></span> IS NOT CORRECT YOU COULD LOST YOUR SERVER CONNECTION!</b></p>
+                <p>{{ __('cipi.update_server_modal_text') }}</p>
+                <p class="d-none" id="ipnotice"><b>{!! __('cipi.update_server_modal_ip') !!}</b></p>
                 <div class="text-center">
-                    <button class="btn btn-primary" type="button" id="submit">Confirm <i class="fas fa-circle-notch fa-spin d-none" id="loading"></i></button>
+                    <button class="btn btn-primary" type="button" id="submit">{{ __('cipi.confirm') }} <i class="fas fa-circle-notch fa-spin d-none" id="loading"></i></button>
                 </div>
                 <div class="space"></div>
             </div>
@@ -184,17 +184,17 @@ Manage Server
     <div class="modal-dialog" role="document">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title" id="crontabModalLabel">Server Crontab</h5>
+                <h5 class="modal-title" id="crontabModalLabel">{{ __('cipi.server_crontab') }}</h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                 <span aria-hidden="true">&times;</span>
                 </button>
             </div>
             <div class="modal-body">
-                <p>Edit server crontab:</p>
+                <p>{{ __('cipi.server_crontab_edit') }}:</p>
                 <div id="crontab" style="height:250px;width:100%;"></div>
                 <div class="space"></div>
                 <div class="text-center">
-                    <button class="btn btn-primary" type="button" id="crontabsubmit">Save <i class="fas fa-circle-notch fa-spin d-none" id="crontableloading"></i></button>
+                    <button class="btn btn-primary" type="button" id="crontabsubmit">{{ __('cipi.save') }} <i class="fas fa-circle-notch fa-spin d-none" id="crontableloading"></i></button>
                 </div>
                 <div class="space"></div>
             </div>
@@ -205,16 +205,16 @@ Manage Server
     <div class="modal-dialog" role="document">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title" id="rootresetModalLabel">Request password reset</h5>
+                <h5 class="modal-title" id="rootresetModalLabel">{{ __('cipi.require_password_reset_modal_title') }}</h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                 <span aria-hidden="true">&times;</span>
                 </button>
             </div>
             <div class="modal-body">
-                <p>Are you sure to reset cipi user password?</p>
+                <p>{{ __('cipi.require_password_reset_modal_text') }}</p>
                 <div class="space"></div>
                 <div class="text-center">
-                    <button class="btn btn-danger" type="button" id="rootresetsubmit">Confirm <i class="fas fa-circle-notch fa-spin d-none" id="rootresetloading"></i></button>
+                    <button class="btn btn-danger" type="button" id="rootresetsubmit">{{ __('cipi.confirm') }} <i class="fas fa-circle-notch fa-spin d-none" id="rootresetloading"></i></button>
                 </div>
                 <div class="space"></div>
             </div>
@@ -277,7 +277,7 @@ Manage Server
                 $('#mainloading').addClass('d-none');
                 $('#serveriptop').html(data.ip);
                 $('#serversites').html(data.sites);
-                $('#maintitle').html(data.name);
+                $('#maintitle').html('- '+data.name);
                 $('#servername').val(data.name);
                 $('#serverip').val(data.ip);
                 $('#serverprovider').val(data.provider);
@@ -288,7 +288,7 @@ Manage Server
                 if(data.build) {
                     $('#serverbuild').html(data.build);
                 } else {
-                    $('#serverbuild').html('unknow');
+                    $('#serverbuild').html('{{ __('cipi.unknown') }}');
                 }
                 switch (data.php) {
                     case '8.0':
@@ -317,7 +317,7 @@ Manage Server
             type: 'GET',
             beforeSend: function() {
                 $('#serverping').empty();
-                $('#serverping').html('<i class="fas fa-circle-notch fa-spin"></i>');
+                $('#serverping').html('<i class="fas fa-circle-notch fa-spin" title="{{ __('cipi.loading_data') }}"></i>');
             },
             success: function(data) {
                 $('#serverping').empty();
@@ -325,7 +325,7 @@ Manage Server
             },
         });
     }
-    setInterval(function() { 
+    setInterval(function() {
         getPing();
     }, 10000);
     getPing();
@@ -341,7 +341,7 @@ Manage Server
                 'php': $('#phpver').val(),
             }),
             beforeSend: function() {
-                $('#changephp').html('<i class="fas fa-circle-notch fa-spin"></i>');
+                $('#changephp').html('<i class="fas fa-circle-notch fa-spin" title="{{ __('cipi.loading_please_wait') }}"></i>');
             },
             success: function(data) {
                 $('#changephp').empty();
@@ -433,7 +433,7 @@ Manage Server
             url: '/api/servers/{{ $server_id }}/rootreset',
             type: 'POST',
             success: function(data) {
-                success('New cipi user password:<br><b>'+data.password+'</b>');
+                success('{{ __('cipi.new_password_success') }}:<br><b>'+data.password+'</b>');
                 $(window).scrollTop(0);
                 $('#rootresetModal').modal('toggle');
             },
@@ -702,12 +702,12 @@ Manage Server
     }
 
     //First step charts
-    setTimeout(function(cpuChart,ramChart){ 
+    setTimeout(function(cpuChart,ramChart){
         chartsUpdate(cpuChart,ramChart);
     }, 500,cpuChart,ramChart);
 
     //Other steps charts
-    setInterval(function(cpuChart,ramChart){ 
+    setInterval(function(cpuChart,ramChart){
         chartsUpdate(cpuChart,ramChart);
     }, 30000,cpuChart,ramChart);
 
@@ -715,4 +715,4 @@ Manage Server
     chartsUpdate(cpuChart,ramChart);
 
 </script>
-@endsection
+@endsection

+ 50 - 54
resources/views/servers.blade.php

@@ -2,7 +2,7 @@
 
 
 @section('title')
-Servers
+    {{ __('cipi.titles.servers') }}
 @endsection
 
 
@@ -13,7 +13,7 @@ Servers
         <div class="card mb-4">
             <div class="card-header text-right">
                 <button class="btn btn-sm btn-secondary" id="newServer">
-                    <i class="fas fa-plus mr-1"></i><b>New Server</b>
+                    <i class="fas fa-plus mr-1"></i><b>{{ __('cipi.new_button', ['type' => __('cipi.server')]) }}</b>
                 </button>
             </div>
             <div class="card-body">
@@ -21,11 +21,11 @@ Servers
                     <table class="table table-bordered" id="dt" width="100%" cellspacing="0">
                         <thead>
                             <tr>
-                                <th class="text-center d-none d-md-table-cell">Name</th>
+                                <th class="text-center d-none d-md-table-cell">{{ __('cipi.name') }}</th>
                                 <th class="text-center">IP</th>
-                                <th class="text-center d-none d-lg-table-cell">Provider</th>
-                                <th class="text-center d-none d-xl-table-cell">Location</th>
-                                <th class="text-center">Actions</th>
+                                <th class="text-center d-none d-lg-table-cell">{{ __('cipi.provider') }}</th>
+                                <th class="text-center d-none d-xl-table-cell">{{ __('cipi.location') }}</th>
+                                <th class="text-center">{{ __('cipi.actions') }}</th>
                             </tr>
                         </thead>
                     </table>
@@ -43,53 +43,51 @@ Servers
     <div class="modal-dialog" role="document" id="newserverdialog">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title" id="newServerModalLabel">Add a new server</h5>
+                <h5 class="modal-title" id="newServerModalLabel">{{ __('cipi.create_server_title') }}</h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                 <span aria-hidden="true">&times;</span>
                 </button>
             </div>
             <div class="modal-body">
                 <div id="newserverform">
-                    <label for="newservername">Server name</label>
+                    <label for="newservername">{{ __('cipi.server_name') }}</label>
                     <div class="input-group">
                         <input class="form-control" type="text" id="newservername" placeholder="Production Server" autocomplete="off" />
                     </div>
                     <div class="space"></div>
-                    <label for="newserverip">Server IP</label>
+                    <label for="newserverip">{{ __('cipi.server_ip') }}</label>
                     <div class="input-group">
                         <input class="form-control" type="text" id="newserverip" placeholder="123.45.67.89" autocomplete="off" />
                     </div>
                     <div class="space"></div>
-                    <label for="newserverprovider">Server provider</label>
+                    <label for="newserverprovider">{{ __('cipi.server_provider') }}</label>
                     <div class="input-group">
                         <input class="form-control" type="text" id="newserverprovider" placeholder="Digital Ocean" autocomplete="off" />
                     </div>
                     <div class="space"></div>
-                    <label for="newserverlocation">Server location</label>
+                    <label for="newserverlocation">{{ __('cipi.server_location') }}</label>
                     <div class="input-group">
                         <input class="form-control" type="text" id="newserverlocation" placeholder="Amsterdam" autocomplete="off" />
                     </div>
                     <div class="space"></div>
                     <div class="text-center">
-                        <button class="btn btn-primary" type="button" id="submit">Confirm <i class="fas fa-circle-notch fa-spin d-none" id="loading"></i></button>
+                        <button class="btn btn-primary" type="button" id="submit">{{ __('cipi.confirm') }} <i class="fas fa-circle-notch fa-spin d-none" id="loading"></i></button>
                     </div>
                 </div>
                 <div id="newserverok" class="d-none">
-                    <p><b>To install your server:</b>
-                        <ul>
-                            <li>Use a clean Ubuntu Server 20.04 LTS fresh installation VPS</li>
-                            <li>Login into your VPS via SSH (as root):<br>
-                                <code><i>ssh root@<span id="newserverssh"></span></i></code>
-                            </li>
-                            <li>Run this command:<br>
-                                <code><i>wget -O - {{ URL::to('/sh/setup/') }}/<span id="newserverid"></span> | bash</i></code>
-                            </li>
-                            <li>Installation may take up to thirty minutes depending on your server resources</li>
-                            <li>Be sure that ports 22, 80 and 443 of your VPS firewall are open</li>
-                            <li>AWS disables root login by default. Use command 'sudo -s' to run as root</li>
-                            <li>Cipi doesn't work with NAT VPN and OpenVZ or in localhost</li>
-                            <li>Before install Cipi, please make sure your server is a clean Ubuntu 20.04 LTS VPS</li>
-                        </ul>
+                    <p><b>{{ __('cipi.server_setup_title') }}</b>
+                    <ul>
+                        <li>{!! __('cipi.server_setup_step1') !!}</li>
+                        <li>{!! __('cipi.server_setup_step2') !!}<br>
+                            <code><i>ssh root@<span id="newserverssh"></span></i></code></li>
+                        <li>{!! __('cipi.server_setup_step3') !!}<br>
+                            <code><i>wget -O - {{ URL::to('/sh/setup/') }}/<span id="newserverid"></span> | bash</i></code></li>
+                        <li>{!! __('cipi.server_setup_step4') !!}</li>
+                        <li>{!! __('cipi.server_setup_step5') !!}</li>
+                        <li>{!! __('cipi.server_setup_step6') !!}</li>
+                        <li>{!! __('cipi.server_setup_step7') !!}</li>
+                        <li>{!! __('cipi.server_setup_step8') !!}</li>
+                    </ul>
                     </p>
                 </div>
                 <div class="space"></div>
@@ -101,26 +99,24 @@ Servers
     <div class="modal-dialog modal-lg" role="document">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title" id="installServerModalLabel">Server Setup</h5>
+                <h5 class="modal-title" id="installServerModalLabel">{{ __('cipi.server_setup') }}</h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                 <span aria-hidden="true">&times;</span>
                 </button>
             </div>
             <div class="modal-body">
-                <p><b>To install your server:</b>
+                <p><b>{{ __('cipi.server_setup_title') }}</b>
                     <ul>
-                        <li>Use a clean Ubuntu Server 20.04 LTS fresh installation VPS</li>
-                        <li>Login into your VPS via SSH (as root):<br>
-                            <code><i>ssh root@<span id="installserverssh"></span></i></code>
-                        </li>
-                        <li>Run this command:<br>
-                            <code><i>wget -O - {{ URL::to('/sh/setup/') }}/<span id="installserverid"></span> | bash</i></code>
-                        </li>
-                        <li>Installation may take up to thirty minutes depending on your server resources</li>
-                        <li>Be sure that ports 22, 80 and 443 of your VPS firewall are open</li>
-                        <li>AWS disables root login by default. Use command 'sudo -s' to run as root</li>
-                        <li>Cipi doesn't work with NAT VPN and OpenVZ or in localhost</li>
-                        <li>Before install Cipi, please make sure your server is a clean Ubuntu 20.04 LTS VPS</li>
+                        <li>{!! __('cipi.server_setup_step1') !!}</li>
+                        <li>{!! __('cipi.server_setup_step2') !!}<br>
+                            <code><i>ssh root@<span id="installserverssh"></span></i></code></li>
+                        <li>{!! __('cipi.server_setup_step3') !!}<br>
+                            <code><i>wget -O - {{ URL::to('/sh/setup/') }}/<span id="installserverid"></span> | bash</i></code></li>
+                        <li>{!! __('cipi.server_setup_step4') !!}</li>
+                        <li>{!! __('cipi.server_setup_step5') !!}</li>
+                        <li>{!! __('cipi.server_setup_step6') !!}</li>
+                        <li>{!! __('cipi.server_setup_step7') !!}</li>
+                        <li>{!! __('cipi.server_setup_step8') !!}</li>
                     </ul>
                 </p>
                 <div class="space"></div>
@@ -132,22 +128,22 @@ Servers
     <div class="modal-dialog" role="document">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title" id="deleteServerModalLabel">Delete server</h5>
+                <h5 class="modal-title" id="deleteServerModalLabel">{{ __('cipi.delete_server') }}</h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                 <span aria-hidden="true">&times;</span>
                 </button>
             </div>
             <div class="modal-body">
-                <p>Are you sure to delete server <b><span id="deleteservername"></span></b>?</p>
+                <p>{{ __('cipi.delete_server_confirmation') }} <b><span id="deleteservername"></span></b>?</p>
                 <div class="space"></div>
-                <label for="deleteserverip">To confirm it write server IP: <i><span id="deleteserveriptocopy"></span></i></label>
+                <label for="deleteserverip">{{ __('cipi.delete_server_confirmation_ip') }}: <i><span id="deleteserveriptocopy"></span></i></label>
                 <div class="input-group">
                     <input class="form-control" type="text" id="deleteserverip" autocomplete="off" />
                 </div>
                 <input type="hidden" id="deleteserverid" value="" />
                 <div class="space"></div>
                 <div class="text-center">
-                    <button class="btn btn-danger" type="button" id="delete">Delete <i class="fas fa-circle-notch fa-spin d-none" id="loadingdelete"></i></button>
+                    <button class="btn btn-danger" type="button" id="delete">{{ __('cipi.delete') }} <i class="fas fa-circle-notch fa-spin d-none" id="loadingdelete"></i></button>
                 </div>
                 <div class="space"></div>
             </div>
@@ -166,7 +162,7 @@ Servers
 
 @section('js')
 <script>
-    //Get DT Data 
+    //Get DT Data
     getData('/api/servers');
 
     //Datatable
@@ -180,7 +176,7 @@ Servers
                 { data: 'provider' },
                 { data: 'location' },
                 { data: {
-                    'server_id': 'server_id', 
+                    'server_id': 'server_id',
                     'default': 'default',
                     'name': 'name',
                     'status': 'status',
@@ -210,18 +206,18 @@ Servers
                     'render': function ( data, type, row, meta ) {
                         if(data['status'] == 0) {
                             if(data['default']) {
-                                return '<span class="btn btn-sm btn-warning mr-3"><i class="fas fa-circle-notch fa-spin fa-fw"></i> <b class="d-none d-sm-inline">Wait...</b></span><span class="disabled btn btn-sm btn-danger"><i class="fas fa-times fa-fw"></i> <b class="d-none d-sm-inline">Delete</b></span>';
+                                return '<span class="btn btn-sm btn-warning mr-3"><i class="fas fa-circle-notch fa-spin fa-fw"></i> <b class="d-none d-sm-inline">{{ __('cipi.wait') }}</b></span><span class="disabled btn btn-sm btn-danger"><i class="fas fa-times fa-fw"></i> <b class="d-none d-sm-inline">{{ __('cipi.delete') }}</b></span>';
                             } else {
-                                return '<button data-id="'+data['server_id']+'" data-ip="'+data['ip']+'" class="btinstall btn btn-sm btn-secondary mr-3"><i class="fas fa-terminal fa-fw"></i> <b class="d-none d-sm-inline">Install</b></button><button data-id="'+data['server_id']+'" data-name="'+data['name']+'" data-ip="'+data['ip']+'" class="btdelete btn btn-sm btn-danger"><i class="fas fa-times fa-fw"></i> <b class="d-none d-sm-inline">Delete</b></button>';
+                                return '<button data-id="'+data['server_id']+'" data-ip="'+data['ip']+'" class="btinstall btn btn-sm btn-secondary mr-3"><i class="fas fa-terminal fa-fw"></i> <b class="d-none d-sm-inline">{{ __('cipi.install') }}</b></button><button data-id="'+data['server_id']+'" data-name="'+data['name']+'" data-ip="'+data['ip']+'" class="btdelete btn btn-sm btn-danger"><i class="fas fa-times fa-fw"></i> <b class="d-none d-sm-inline">{{ __('cipi.delete') }}</b></button>';
                             }
-                        } else {    
+                        } else {
                             if(data['default']) {
-                                return '<button data-id="'+data['server_id']+'" class="btmanage btn btn-sm btn-primary mr-3"><i class="fas fa-cog fa-fw"></i> <b class="d-none d-sm-inline">Manage</b></button><span class="disabled btn btn-sm btn-danger"><i class="fas fa-times fa-fw"></i> <b class="d-none d-sm-inline">Delete</b></span>';
+                                return '<button data-id="'+data['server_id']+'" class="btmanage btn btn-sm btn-primary mr-3"><i class="fas fa-cog fa-fw"></i> <b class="d-none d-sm-inline">{{ __('cipi.manage') }}</b></button><span class="disabled btn btn-sm btn-danger"><i class="fas fa-times fa-fw"></i> <b class="d-none d-sm-inline">{{ __('cipi.delete') }}</b></span>';
                             } else {
-                                return '<button data-id="'+data['server_id']+'" class="btmanage btn btn-sm btn-primary mr-3"><i class="fas fa-cog fa-fw"></i> <b class="d-none d-sm-inline">Manage</b></button><button data-id="'+data['server_id']+'" data-name="'+data['name']+'" data-ip="'+data['ip']+'" class="btdelete btn btn-sm btn-danger"><i class="fas fa-times fa-fw"></i> <b class="d-none d-sm-inline">Delete</b></button>';
+                                return '<button data-id="'+data['server_id']+'" class="btmanage btn btn-sm btn-primary mr-3"><i class="fas fa-cog fa-fw"></i> <b class="d-none d-sm-inline">{{ __('cipi.manage') }}</b></button><button data-id="'+data['server_id']+'" data-name="'+data['name']+'" data-ip="'+data['ip']+'" class="btdelete btn btn-sm btn-danger"><i class="fas fa-times fa-fw"></i> <b class="d-none d-sm-inline">{{ __('cipi.delete') }}</b></button>';
                             }
                         }
-                       
+
                     }
                 }
             ],
@@ -387,4 +383,4 @@ Servers
         }
     });
 </script>
-@endsection
+@endsection

+ 22 - 22
resources/views/settings.blade.php

@@ -2,7 +2,7 @@
 
 
 @section('title')
-Settings
+    {{ __('cipi.titles.settings') }}
 @endsection
 
 
@@ -13,12 +13,12 @@ Settings
         <div class="card mb-4">
             <div class="card-header">
                 <i class="fas fa-user fs-fw mr-1"></i>
-                Change Username
+                {{ __('cipi.change_username') }}
             </div>
             <div class="card-body">
-                <p>Current username: <b><span id="currentuser"></span></b></p>
+                <p>{{ __('cipi.current_username') }}: <b><span id="currentuser"></span></b></p>
                 <div class="input-group">
-                    <input class="form-control" type="text" placeholder="New username (at least 6 chars)" id="newuser" autocomplete="off" />
+                    <input class="form-control" type="text" placeholder="{{ __('cipi.change_username_placeholder') }}" id="newuser" autocomplete="off" />
                     <div class="input-group-append">
                         <button class="btn btn-primary" type="button" id="changeuser"><i class="fas fa-edit"></i></button>
                     </div>
@@ -31,12 +31,12 @@ Settings
         <div class="card mb-4">
             <div class="card-header">
                 <i class="fas fa-key fs-fw mr-1"></i>
-                Change Password
+                {{ __('cipi.change_password') }}
             </div>
             <div class="card-body">
-                <p>Update your password</p>
+                <p>{{ __('cipi.update_password') }}</p>
                 <div class="input-group">
-                    <input class="form-control" type="text" placeholder="New password (at least 8 chars)" id="newpass" autocomplete="off" />
+                    <input class="form-control" type="text" placeholder="{{ __('cipi.change_password_placeholder') }}" id="newpass" autocomplete="off" />
                     <div class="input-group-append">
                         <button class="btn btn-primary" type="button" id="changepass"><i class="fas fa-edit"></i></button>
                     </div>
@@ -51,14 +51,14 @@ Settings
         <div class="card mb-4">
             <div class="card-header">
                 <i class="fas fa-globe fs-fw mr-1"></i>
-                Panel URL
+                {{ __('cipi.panel_url') }}
             </div>
             <div class="card-body">
-                <p>Custom panel domain/subdomain</p>
+                <p>{{ __('cipi.panel_url_text') }}</p>
                 <div class="input-group">
                     <input class="form-control" type="text" placeholder="panel.domain.ltd" id="panelurl" autocomplete="off" />
                     <div class="input-group-append">
-                        <button class="btn btn-warning" type="button" id="panelurlssl" data-toggle="tooltip" data-placement="top" title="Require SSL"><i class="fas fa-lock"></i></button>
+                        <button class="btn btn-warning" type="button" id="panelurlssl" data-toggle="tooltip" data-placement="top" title="{{ __('cipi.panel_url_force_ssl') }}"><i class="fas fa-lock"></i></button>
                     </div>
                     <div class="input-group-append">
                         <button class="btn btn-primary" type="button" id="panelurlsubmit"><i class="fas fa-edit"></i></button>
@@ -72,14 +72,14 @@ Settings
         <div class="card mb-4">
             <div class="card-header">
                 <i class="fas fa-code fs-fw mr-1"></i>
-                Panel API
+                {{ __('cipi.panel_api') }}
             </div>
             <div class="card-body">
-                <p>API Endpoint:  <b>{{ URL::to('/api/') }}</b></p>
+                <p>{{ __('cipi.panel_api_endpoint') }}:  <b>{{ URL::to('/api/') }}</b></p>
                 <div class="text-center">
-                    <button class="btn btn-primary mr-3" type="button" id="newapikey">Renew API Key</button>
+                    <button class="btn btn-primary mr-3" type="button" id="newapikey">{{ __('cipi.renew_api_key') }}</button>
                     <a href="/api/docs" target="_blank">
-                        <button class="btn btn-warning" type="button">Documentation</button>
+                        <button class="btn btn-warning" type="button">{{ __('cipi.documentation') }}</button>
                     </a>
                 </div>
                 <div class="space"></div>
@@ -96,19 +96,19 @@ Settings
     <div class="modal-dialog" role="document">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title" id="authorizeModalLabel">Action Authorization</h5>
+                <h5 class="modal-title" id="authorizeModalLabel">{{ __('cipi.action_authorization_modal_title') }}</h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                 <span aria-hidden="true">&times;</span>
                 </button>
             </div>
             <div class="modal-body">
-                <p>To authorize this action insert your current password:</p>
+                <p>{{ __('cipi.action_authorization_modal_text') }}:</p>
                 <div class="input-group">
                     <input class="form-control" type="password" id="currentpass" />
                 </div>
                 <div class="space"></div>
                 <div class="text-center">
-                    <button class="btn btn-primary" type="button" id="submit">Submit <i class="fas fa-circle-notch fa-spin d-none" id="loading"></i></button>
+                    <button class="btn btn-primary" type="button" id="submit">{{ __('cipi.submit') }} <i class="fas fa-circle-notch fa-spin d-none" id="loading"></i></button>
                 </div>
                 <div class="space"></div>
             </div>
@@ -257,15 +257,15 @@ Settings
                     localStorage.refresh_token=data.refresh_token;
                     localStorage.username=data.username;
                     if(patchcall == 'changeuser') {
-                        success('Username has been updated');
+                        success('{{ __('cipi.username_updated_success') }}');
                         $('#currentuser').html(localStorage.username);
                         $('#username').html(localStorage.username);
                     }
                     if(patchcall == 'changepass') {
-                        success('Password has been updated');
+                        success('{{ __('cipi.password_updated_success') }}');
                     }
                     if(patchcall == 'newapikey') {
-                        success('New API Key:<br><b>'+data.apikey+'</b>');
+                        success('{{ __('cipi.new_api_key_success') }}:<br><b>'+data.apikey+'</b>');
                     }
                     $('#authorizeModal').modal("hide");
                     $(window).scrollTop(0);
@@ -277,7 +277,7 @@ Settings
                         $('#newuser').val('');
                         $('#newpass').val('');
                         $('#currentpass').val('');
-                        fail('Ops! Something went wrong... Try again!');
+                        fail('{{ __('cipi.unknown_error') }}');
                         $('#authorizeModal').modal("hide");
                     }
                 }
@@ -290,4 +290,4 @@ Settings
         $('#currentpass').removeClass('is-invalid');
     });
 </script>
-@endsection
+@endsection

+ 42 - 42
resources/views/site.blade.php

@@ -2,7 +2,7 @@
 
 
 @section('title')
-Manage Site
+    {{ __('cipi.titles.site') }}
 @endsection
 
 
@@ -10,30 +10,30 @@ Manage Site
 @section('content')
 <ol class="breadcrumb mb-4">
     <li class="ml-1 breadcrumb-item active">IP:<b><span class="ml-1" id="siteip"></span></b></li>
-    <li class="ml-1 breadcrumb-item active">ALIASES:<b><span class="ml-1" id="sitealiases"></span></b></li>
+    <li class="ml-1 breadcrumb-item active text-uppercase">{{ __('cipi.aliases') }}:<b><span class="ml-1" id="sitealiases"></span></b></li>
     <li class="ml-1 breadcrumb-item active">PHP:<b><span class="ml-1" id="sitephp"></span></b></li>
-    <li class="ml-1 breadcrumb-item active">DIR:<b><span class="ml-1">/home/</span><span id="siteuserinfo"></span>/web/<span id="sitebasepathinfo"></span></b></li>
+    <li class="ml-1 breadcrumb-item active text-uppercase">{{ __('cipi.site_base_path') }}:<b><span class="ml-1">/home/</span><span id="siteuserinfo"></span>/web/<span id="sitebasepathinfo"></span></b></li>
 </ol>
 <div class="row">
     <div class="col-xl-4">
         <div class="card mb-4">
             <div class="card-header">
                 <i class="fas fa-info-circle fs-fw mr-1"></i>
-                Basic information
+                {{ __('cipi.basic_information') }}
             </div>
             <div class="card-body">
-                <p>Domain:</p>
+                <p>{{ __('cipi.domain') }}:</p>
                 <div class="input-group">
                     <input class="form-control" type="text" placeholder="e.g. domain.ltd" id="sitedomain" autocomplete="off" />
                 </div>
                 <div class="space"></div>
-                <p>Basepath:</p>
+                <p>{{ __('cipi.site_base_path') }}:</p>
                 <div class="input-group">
                     <input class="form-control" type="text" placeholder="e.g. public" id="sitebasepath" autocomplete="off" />
                 </div>
                 <div class="space"></div>
                 <div class="text-center">
-                    <button class="btn btn-primary" type="button" id="updateSite">Update <i class="fas fa-circle-notch fa-spin d-none" id="updateSiteloading"></i></button>
+                    <button class="btn btn-primary" type="button" id="updateSite">{{ __('cipi.update') }} <i class="fas fa-circle-notch fa-spin d-none" id="updateSiteloading"></i></button>
                 </div>
                 <div class="space"></div>
             </div>
@@ -43,10 +43,10 @@ Manage Site
         <div class="card mb-4">
             <div class="card-header">
                 <i class="fas fa-globe fs-fw mr-1"></i>
-                Manage aliases
+                {{ __('cipi.manage_aliases') }}
             </div>
             <div class="card-body">
-                <p>Add alias:</p>
+                <p>{{ __('cipi.add_alias') }}:</p>
                 <div class="input-group">
                     <input class="form-control" type="text" placeholder="e.g. www.domain.ltd" id="siteaddalias" autocomplete="off" />
                     <div class="input-group-append">
@@ -55,7 +55,7 @@ Manage Site
                 </div>
                 <div class="space"></div>
                 <div style="min-height:135px">
-                    <p>Aliases:</p>
+                    <p>{{ __('cipi.aliases') }}:</p>
                     <div id="sitealiaseslist"></div>
                 </div>
                 <div class="space"></div>
@@ -66,14 +66,14 @@ Manage Site
         <div class="card mb-4">
             <div class="card-header">
                 <i class="fas fa-lock fs-fw mr-1"></i>
-                SSLs and Security
+                {{ __('cipi.ssl_security') }}
             </div>
             <div class="card-body">
-                <p>Require and generate free Let's Encrypt certificate for site domain and aliases:</p>
-                <button class="btn btn-success btn" type="button" id="sitessl">Generate SSLs <i class="fas fa-circle-notch fa-spin d-none" id="sitesslloading"></i></button>
+                <p>{{ __('cipi.ssl_security_text') }}:</p>
+                <button class="btn btn-success btn" type="button" id="sitessl">{{ __('cipi.ssl_generate') }} <i class="fas fa-circle-notch fa-spin d-none" id="sitesslloading"></i></button>
                 <div class="space"></div>
                 <div class="space"></div>
-                <p>Passwords reset:</p>
+                <p>{{ __('cipi.password_resets') }}:</p>
                 <button class="btn btn-warning btn mr-3" type="button" id="sitesshreset">SSH</button>
                 <button class="btn btn-warning btn mr-3" type="button" id="sitemysqlreset">MySql</button>
                 <div class="space" style="min-height:38px"></div>
@@ -86,7 +86,7 @@ Manage Site
         <div class="card mb-4">
             <div class="card-header">
                 <i class="fas fa-rocket fs-fw mr-1"></i>
-                Application installer
+                {{ __('cipi.application_installer') }}
             </div>
             <div class="card-body text-center">
                 <div class="space"></div>
@@ -94,7 +94,7 @@ Manage Site
                 <div class="space"></div>
                 <div class="space"></div>
                 <div class="space"></div>
-                <h5>Coming soon...</h5>
+                <h5>{{ __('cipi.coming_soon') }}</h5>
                 <div class="space"></div>
                 <div class="space"></div>
                 <div class="space"></div>
@@ -108,20 +108,20 @@ Manage Site
         <div class="card mb-4">
             <div class="card-header">
                 <i class="fab fa-github fs-fw mr-1"></i>
-                Github repository
+                {{ __('cipi.github_repository') }}
             </div>
             <div class="card-body">
-                <p>Set up a Github repository</p>
+                <p>{{ __('cipi.github_repository_setup') }}</p>
                 <div class="text-center">
-                    <button class="btn btn-warning" type="button" style="min-width:200px" id="sitesetrepo">Repo configuration</button>
+                    <button class="btn btn-warning" type="button" style="min-width:200px" id="sitesetrepo">{{ __('cipi.github_repository_config') }}</button>
                     <div class="space"></div>
                 </div>
                 <div class="text-center">
-                    <button class="btn btn-warning" type="button" style="min-width:200px" id="editdeploy">Edit deploy scripts</button>
+                    <button class="btn btn-warning" type="button" style="min-width:200px" id="editdeploy">{{ __('cipi.github_repository_scripts') }}</button>
                     <div class="space"></div>
                 </div>
                 <p>
-                    To run deploy:
+                    {{ __('cipi.github_repository_deploy') }}:
                     <ul style="font-size:14px;">
                         <li>ssh <span id="repodeployinfouser1"></span>@<span id="repodeployinfoip"></span></li>
                         <li>sh /home/<span id="repodeployinfouser2"></span>/git/deploy.sh</li>
@@ -129,15 +129,15 @@ Manage Site
                 </p>
             </div>
         </div>
-    </div>  
+    </div>
     <div class="col-xl-4">
         <div class="card mb-4">
             <div class="card-header">
                 <i class="fas fa-tools fs-fw mr-1"></i>
-                Tools
+                {{ __('cipi.tools') }}
             </div>
             <div class="card-body">
-                <p>PHP-FPM version:</p>
+                <p>{{ __('cipi.php_fpm_version') }}:</p>
                 <div class="input-group">
                     <select class="form-control" id="sitephpver">
                         <option value="8.0" id="php80">8.0</option>
@@ -155,7 +155,7 @@ Manage Site
                 </div>
                 <div class="space"></div>
                 <div class="text-center">
-                    <button class="btn btn-primary" type="button" id="sitesupervisorupdate">Update <i class="fas fa-circle-notch fa-spin d-none" id="sitesupervisorupdateloading"></i></button>
+                    <button class="btn btn-primary" type="button" id="sitesupervisorupdate">{{ __('cipi.update') }} <i class="fas fa-circle-notch fa-spin d-none" id="sitesupervisorupdateloading"></i></button>
                 </div>
                 <div class="space"></div>
             </div>
@@ -173,29 +173,29 @@ Manage Site
     <div class="modal-dialog" role="document" id="repositorydialog">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title" id="repositoryModalLabel">Github repository</h5>
+                <h5 class="modal-title" id="repositoryModalLabel">{{ __('cipi.github_repository') }}</h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                 <span aria-hidden="true">&times;</span>
                 </button>
             </div>
             <div class="modal-body">
-                <label for="repositoryproject">Project</label>
+                <label for="repositoryproject">{{ __('cipi.repository_project') }}</label>
                 <div class="input-group">
                     <input class="form-control" type="text" id="repositoryproject" placeholder="e.g. johndoe/helloworld" autocomplete="off" />
                 </div>
                 <div class="space"></div>
-                <label for="repositorybranch">Branch</label>
+                <label for="repositorybranch">{{ __('cipi.repository_branch') }}</label>
                 <div class="input-group">
                     <input class="form-control" type="text" id="repositorybranch" placeholder="e.g. develop" autocomplete="off" />
                 </div>
                 <div class="space"></div>
-                <label for="deploykey">Deploy Key (<a href="#" id="copykey">Copy</a> and add it <a href="https://github.com/settings/ssh/new" target="blank">here</a>)</label>
+                <label for="deploykey">{{ __('cipi.repository_deploy_key') }} {!! __('cipi.repository_deploy_key_info') !!}</label>
                 <div class="input-group">
                     <textarea id="deploykey" readonly style="width:100%;height:150px;font-size:10px;"></textarea>
                 </div>
                 <div class="space"></div>
                 <div class="text-center">
-                    <button class="btn btn-primary" type="button" id="repositorysubmit">Confirm <i class="fas fa-circle-notch fa-spin d-none" id="repositoryloading"></i></button>
+                    <button class="btn btn-primary" type="button" id="repositorysubmit">{{ __('cipi.confirm') }} <i class="fas fa-circle-notch fa-spin d-none" id="repositoryloading"></i></button>
                 </div>
             </div>
         </div>
@@ -205,17 +205,17 @@ Manage Site
     <div class="modal-dialog" role="document">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title" id="deployModalLabel">Site deploy scripts</h5>
+                <h5 class="modal-title" id="deployModalLabel">{{ __('cipi.deploy_scripts') }}</h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                 <span aria-hidden="true">&times;</span>
                 </button>
             </div>
             <div class="modal-body">
-                <p>Edit site deploy scripts:</p>
+                <p>{{ __('cipi.github_repository_scripts') }}:</p>
                 <div id="deploy" style="height:250px;width:100%;"></div>
                 <div class="space"></div>
                 <div class="text-center">
-                    <button class="btn btn-primary" type="button" id="deploysubmit">Save <i class="fas fa-circle-notch fa-spin d-none" id="deployloading"></i></button>
+                    <button class="btn btn-primary" type="button" id="deploysubmit">{{ __('cipi.save') }} <i class="fas fa-circle-notch fa-spin d-none" id="deployloading"></i></button>
                 </div>
                 <div class="space"></div>
             </div>
@@ -226,16 +226,16 @@ Manage Site
     <div class="modal-dialog" role="document">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title" id="sshresetModalLabel">Request password reset</h5>
+                <h5 class="modal-title" id="sshresetModalLabel">{{ __('cipi.require_password_reset_modal_title') }}</h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                 <span aria-hidden="true">&times;</span>
                 </button>
             </div>
             <div class="modal-body">
-                <p>Are you sure to reset site SSH password?</p>
+                <p>{{ __('cipi.require_ssh_password_reset_modal_text') }}</p>
                 <div class="space"></div>
                 <div class="text-center">
-                    <button class="btn btn-danger" type="button" id="sshresetsubmit">Confirm <i class="fas fa-circle-notch fa-spin d-none" id="sshresetloading"></i></button>
+                    <button class="btn btn-danger" type="button" id="sshresetsubmit">{{ __('cipi.confirm') }} <i class="fas fa-circle-notch fa-spin d-none" id="sshresetloading"></i></button>
                 </div>
                 <div class="space"></div>
             </div>
@@ -246,16 +246,16 @@ Manage Site
     <div class="modal-dialog" role="document">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title" id="mysqlresetModalLabel">Request password reset</h5>
+                <h5 class="modal-title" id="mysqlresetModalLabel">{{ __('cipi.require_password_reset_modal_title') }}</h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                 <span aria-hidden="true">&times;</span>
                 </button>
             </div>
             <div class="modal-body">
-                <p>Are you sure to reset site MySql password?</p>
+                <p>{{ __('cipi.require_mysql_password_reset_modal_text') }}</p>
                 <div class="space"></div>
                 <div class="text-center">
-                    <button class="btn btn-danger" type="button" id="mysqlresetsubmit">Confirm <i class="fas fa-circle-notch fa-spin d-none" id="mysqlresetloading"></i></button>
+                    <button class="btn btn-danger" type="button" id="mysqlresetsubmit">{{ __('cipi.confirm') }} <i class="fas fa-circle-notch fa-spin d-none" id="mysqlresetloading"></i></button>
                 </div>
                 <div class="space"></div>
             </div>
@@ -289,7 +289,7 @@ Manage Site
                 $('#sitephp').html(data.php);
                 $('#sitebasepathinfo').html(data.basepath);
                 $('#siteuserinfo').html(data.username);
-                $('#maintitle').html(data.domain);
+                $('#maintitle').html('- '+data.domain);
                 $('#sitedomain').val(data.domain);
                 $('#sitebasepath').val(data.basepath);
                 $('#currentdomain').val(data.domain);
@@ -348,7 +348,7 @@ Manage Site
                 $('#sshresetloading').removeClass('d-none');
             },
             success: function(data) {
-                success('Your SSH password has been reset:<br><b>'+data.password+'</b><br><a href="'+data.pdf+'" target="_blank" style="color:#ffffff">Download PDF (3 minutes link)</a>');
+                success('{{ __('cipi.new_ssh_password_success') }}:<br><b>'+data.password+'</b><br><a href="'+data.pdf+'" target="_blank" style="color:#ffffff">{{ __('cipi.download_site_data') }}</a>');
                 $('#sshresetloading').addClass('d-none');
                 $('#sshresetModal').modal('toggle');
                 $(window).scrollTop(0);
@@ -368,7 +368,7 @@ Manage Site
                 $('#mysqlresetloading').removeClass('d-none');
             },
             success: function(data) {
-                success('Your Mysql password has been reset:<br><b>'+data.password+'</b><br><a href="'+data.pdf+'" target="_blank" style="color:#ffffff">Download PDF (3 minutes link)</a>');
+                success('{{ __('cipi.new_mysql_password_success') }}:<br><b>'+data.password+'</b><br><a href="'+data.pdf+'" target="_blank" style="color:#ffffff">{{ __('cipi.download_site_data') }}</a>');
                 $('#mysqlresetloading').addClass('d-none');
                 $('#mysqlresetModal').modal('toggle');
                 $(window).scrollTop(0);

+ 292 - 292
resources/views/sites.blade.php

@@ -2,140 +2,140 @@
 
 
 @section('title')
-Sites
+    {{ __('cipi.titles.sites') }}
 @endsection
 
 
 
 @section('content')
-<div class="row">
-    <div class="col-xl-12">
-        <div class="card mb-4">
-            <div class="card-header text-right">
-                <button class="btn btn-sm btn-secondary" id="newSite">
-                    <i class="fas fa-plus mr-1"></i><b>New Site</b>
-                </button>
-            </div>
-            <div class="card-body">
-                <div class="table-responsive">
-                    <table class="table table-bordered" id="dt" width="100%" cellspacing="0">
-                        <thead>
+    <div class="row">
+        <div class="col-xl-12">
+            <div class="card mb-4">
+                <div class="card-header text-right">
+                    <button class="btn btn-sm btn-secondary" id="newSite">
+                        <i class="fas fa-plus mr-1"></i><b>{{ __('cipi.new_button', ['type' => __('cipi.site')]) }}</b>
+                    </button>
+                </div>
+                <div class="card-body">
+                    <div class="table-responsive">
+                        <table class="table table-bordered" id="dt" width="100%" cellspacing="0">
+                            <thead>
                             <tr>
-                                <th class="text-center">Domain</th>
-                                <th class="text-center text-center d-none d-md-table-cell">Aliases</th>
-                                <th class="text-center d-none d-lg-table-cell">Server</th>
+                                <th class="text-center">{{ __('cipi.domain') }}</th>
+                                <th class="text-center text-center d-none d-md-table-cell">{{ __('cipi.aliases') }}</th>
+                                <th class="text-center d-none d-lg-table-cell">{{ __('cipi.server') }}</th>
                                 <th class="text-center d-none d-xl-table-cell">IP</th>
-                                <th class="text-center">Actions</th>
+                                <th class="text-center">{{ __('cipi.actions') }}</th>
                             </tr>
-                        </thead>
-                    </table>
+                            </thead>
+                        </table>
+                    </div>
                 </div>
             </div>
         </div>
     </div>
-</div>
 @endsection
 
 
 
 @section('extra')
-<div class="modal fade" id="newSiteModal" tabindex="-1" role="dialog" aria-labelledby="newSiteModalLabel" aria-hidden="true">
-    <div class="modal-dialog" role="document" id="newsitedialog">
-        <div class="modal-content">
-            <div class="modal-header">
-                <h5 class="modal-title" id="newSiteModalLabel">Add a new site</h5>
-                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                <span aria-hidden="true">&times;</span>
-                </button>
-            </div>
-            <div class="modal-body">
-                <div id="newsiteform">
-                    <label for="newsitedomain">Site domain</label>
-                    <div class="input-group">
-                        <input class="form-control" type="text" id="newsitedomain" placeholder="e.g. domain.ltd" autocomplete="off" />
-                    </div>
-                    <div class="space"></div>
-                    <label for="newsiteserver">Server</label>
-                    <div class="input-group">
-                        <select class="form-control" id="newsiteserver"></select>
-                    </div>
-                    <div class="space"></div>
-                    <label for="newsiteprovider">PHP Version</label>
-                    <div class="input-group">
-                        <select class="form-control" id="newsitephp">
-                            <option value="8.0" selected>8.0</option>
-                            <option value="7.4">7.4</option>
-                            <option value="7.3">7.3</option>
-                        </select>
-                    </div>
-                    <div class="space"></div>
-                    <label for="newsitebasepath">Basepath</label>
-                    <div class="input-group">
-                        <input class="form-control" type="text" id="newsitebasepath" placeholder="e.g. public" autocomplete="off" />
-                    </div>
-                    <div class="space"></div>
-                    <div class="text-center">
-                        <button class="btn btn-primary" type="button" id="submit">Confirm <i class="fas fa-circle-notch fa-spin d-none" id="loading"></i></button>
-                    </div>
+    <div class="modal fade" id="newSiteModal" tabindex="-1" role="dialog" aria-labelledby="newSiteModalLabel" aria-hidden="true">
+        <div class="modal-dialog" role="document" id="newsitedialog">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <h5 class="modal-title" id="newSiteModalLabel">{{ __('cipi.new_site_modal_title') }}</h5>
+                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                        <span aria-hidden="true">&times;</span>
+                    </button>
                 </div>
-                <div id="newsiteok" class="d-none container">
-                    <div class="row">
-                        <div class="col-xs-12">
-                            <p><b>Your site is ready!</b></b>
+                <div class="modal-body">
+                    <div id="newsiteform">
+                        <label for="newsitedomain">{{ __('cipi.site_domain') }}</label>
+                        <div class="input-group">
+                            <input class="form-control" type="text" id="newsitedomain" placeholder="e.g. domain.ltd" autocomplete="off" />
                         </div>
-                    </div>
-                    <div class="row">
-                        <div class="col-xl-12">
-                            <p>Domain:<br><b><span id="newsitedomainok"></b></b></p>
-                            <p>Server IP:<br><b><span id="newsiteip"></b></b></p>
-                            <p>SSH Username:<br><b><span id="newsiteusername"></b></p>
-                            <p>SSH Password:<br><b><span id="newsitepassword"></b></p>
-                            <p>MySQL database:<br><b><span id="newsitedbname"></b></p>
-                            <p>MySQL username:<br><b><span id="newsitedbusername"></b></p>
-                            <p>MySQL password:<br><b><span id="newsitedbpassword"></b></p>
+                        <div class="space"></div>
+                        <label for="newsiteserver">{{ __('cipi.server') }}</label>
+                        <div class="input-group">
+                            <select class="form-control" id="newsiteserver"></select>
                         </div>
-                    </div>
-                    <div class="row">
-                        <div class="col-xl-12">
-                            <p>Document root:<br><b>/home/<span id="newsitebasepathuser"></span>/web/<span id="newsitebasepath"></b></p>
+                        <div class="space"></div>
+                        <label for="newsiteprovider">{{ __('cipi.php_version') }}</label>
+                        <div class="input-group">
+                            <select class="form-control" id="newsitephp">
+                                <option value="8.0" selected>8.0</option>
+                                <option value="7.4">7.4</option>
+                                <option value="7.3">7.3</option>
+                            </select>
+                        </div>
+                        <div class="space"></div>
+                        <label for="newsitebasepath">{{ __('cipi.site_base_path') }}</label>
+                        <div class="input-group">
+                            <input class="form-control" type="text" id="newsitebasepath" placeholder="e.g. public" autocomplete="off" />
+                        </div>
+                        <div class="space"></div>
+                        <div class="text-center">
+                            <button class="btn btn-primary" type="button" id="submit">{{ __('cipi.confirm') }} <i class="fas fa-circle-notch fa-spin d-none" id="loading"></i></button>
                         </div>
                     </div>
-                    <div class="space"></div>
-                    <div class="row">
-                        <div class="col-xl-12 text-center">
-                            <a href="" target="_blank" id="newsitepdf">
-                                <button class="btn btn-success" type="button"><i class="fas fa-file-pdf"></i> Download (3 minutes link)</button>
-                            </a>
+                    <div id="newsiteok" class="d-none container">
+                        <div class="row">
+                            <div class="col-xs-12">
+                                <p><b>{{ __('cipi.site_ready_message') }}</b></b>
+                            </div>
+                        </div>
+                        <div class="row">
+                            <div class="col-xl-12">
+                                <p>{{ __('cipi.domain') }}:<br><b><span id="newsitedomainok"></b></b></p>
+                                <p>{{ __('cipi.server_ip') }}:<br><b><span id="newsiteip"></b></b></p>
+                                <p>SSH {{ __('cipi.username') }}:<br><b><span id="newsiteusername"></b></p>
+                                <p>SSH {{ __('cipi.password') }}:<br><b><span id="newsitepassword"></b></p>
+                                <p>MySQL {{ __('cipi.database') }}:<br><b><span id="newsitedbname"></b></p>
+                                <p>MySQL {{ __('cipi.username') }}:<br><b><span id="newsitedbusername"></b></p>
+                                <p>MySQL {{ __('cipi.password') }}:<br><b><span id="newsitedbpassword"></b></p>
+                            </div>
+                        </div>
+                        <div class="row">
+                            <div class="col-xl-12">
+                                <p>{{ __('cipi.document_root') }}:<br><b>/home/<span id="newsitebasepathuser"></span>/web/<span id="newsitebasepath"></b></p>
+                            </div>
+                        </div>
+                        <div class="space"></div>
+                        <div class="row">
+                            <div class="col-xl-12 text-center">
+                                <a href="" target="_blank" id="newsitepdf">
+                                    <button class="btn btn-success" type="button"><i class="fas fa-file-pdf"></i> {{ __('cipi.download_site_data') }}</button>
+                                </a>
+                            </div>
                         </div>
+                        <div class="space"></div>
                     </div>
-                    <div class="space"></div>
                 </div>
             </div>
         </div>
     </div>
-</div>
-<div class="modal fade" id="deleteSiteModal" tabindex="-1" role="dialog" aria-labelledby="deleteSiteModalLabel" aria-hidden="true">
-    <div class="modal-dialog" role="document">
-        <div class="modal-content">
-            <div class="modal-header">
-                <h5 class="modal-title" id="deleteSiteModalLabel">Delete site</h5>
-                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                <span aria-hidden="true">&times;</span>
-                </button>
-            </div>
-            <div class="modal-body">
-                <p>Are you sure to delete site <b><span id="deletesitename"></span></b> and its database and aliases?</p>
-                <div class="space"></div>
-                <input type="hidden" id="deletesiteid" value="" />
-                <div class="space"></div>
-                <div class="text-center">
-                    <button class="btn btn-danger" type="button" id="delete">Delete <i class="fas fa-circle-notch fa-spin d-none" id="loadingdelete"></i></button>
+    <div class="modal fade" id="deleteSiteModal" tabindex="-1" role="dialog" aria-labelledby="deleteSiteModalLabel" aria-hidden="true">
+        <div class="modal-dialog" role="document">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <h5 class="modal-title" id="deleteSiteModalLabel">{{ __('cipi.delete_site_modal_title') }}</h5>
+                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                        <span aria-hidden="true">&times;</span>
+                    </button>
+                </div>
+                <div class="modal-body">
+                    <p>Are you sure to delete site <b><span id="deletesitedomain"></span></b> and its database and aliases?</p>
+                    <div class="space"></div>
+                    <input type="hidden" id="deletesiteid" value="" />
+                    <div class="space"></div>
+                    <div class="text-center">
+                        <button class="btn btn-danger" type="button" id="delete">{{ __('cipi.delete') }} <i class="fas fa-circle-notch fa-spin d-none" id="loadingdelete"></i></button>
+                    </div>
+                    <div class="space"></div>
                 </div>
-                <div class="space"></div>
             </div>
         </div>
     </div>
-</div>
 @endsection
 
 
@@ -147,208 +147,208 @@ Sites
 
 
 @section('js')
-<script>
-    //Get DT Data 
-    getData('/api/sites');
+    <script>
+        //Get DT Data
+        getData('/api/sites');
 
-    //Datatable
-    function dtRender() {
-        $('#dt').DataTable( {
-            'processing': true,
-            'data': JSON.parse(localStorage.getItem('dtdata')),
-            'columns': [
-                { data: 'domain' },
-                { data: 'aliases' },
-                { data: 'server_name' },
-                { data: 'server_ip' },
-                { data: {
-                    'site_id': 'site_id',
-                    'domain': 'domain',
-                }}
-            ],
-            'columnDefs': [
-                {
-                    'targets': 1,
-                    'className': 'd-none d-md-table-cell text-center',
-                },
-                {
-                    'targets': 2,
-                    'className': 'text-center d-none d-lg-table-cell',
-                },
-                {
-                    'targets': 3,
-                    'className': 'text-center d-none d-xl-table-cell',
-                },
-                {
-                    'targets': 4,
-                    'className': 'text-center',
-                    'render': function ( data, type, row, meta ) {
-                        return '<button data-id="'+data['site_id']+'" class="btmanage btn btn-sm btn-primary mr-3"><i class="fas fa-cog fa-fw"></i> <b class="d-none d-sm-inline">Manage</b></button><button data-id="'+data['site_id']+'" data-name="'+data['domain']+'" class="btdelete btn btn-sm btn-danger"><i class="fas fa-times fa-fw"></i> <b class="d-none d-sm-inline">Delete</b></button>';
+        //Datatable
+        function dtRender() {
+            $('#dt').DataTable( {
+                'processing': true,
+                'data': JSON.parse(localStorage.getItem('dtdata')),
+                'columns': [
+                    { data: 'domain' },
+                    { data: 'aliases' },
+                    { data: 'server_name' },
+                    { data: 'server_ip' },
+                    { data: {
+                            'site_id': 'site_id',
+                            'domain': 'domain',
+                        }}
+                ],
+                'columnDefs': [
+                    {
+                        'targets': 1,
+                        'className': 'd-none d-md-table-cell text-center',
+                    },
+                    {
+                        'targets': 2,
+                        'className': 'text-center d-none d-lg-table-cell',
+                    },
+                    {
+                        'targets': 3,
+                        'className': 'text-center d-none d-xl-table-cell',
+                    },
+                    {
+                        'targets': 4,
+                        'className': 'text-center',
+                        'render': function ( data, type, row, meta ) {
+                            return '<button data-id="'+data['site_id']+'" class="btmanage btn btn-sm btn-primary mr-3"><i class="fas fa-cog fa-fw"></i> <b class="d-none d-sm-inline">{{ __('cipi.manage') }}</b></button><button data-id="'+data['site_id']+'" data-domain="'+data['domain']+'" class="btdelete btn btn-sm btn-danger"><i class="fas fa-times fa-fw"></i> <b class="d-none d-sm-inline">{{ __('cipi.delete') }}</b></button>';
+                        }
                     }
+                ],
+                'bLengthChange': false,
+                'bAutoWidth': true,
+                'responsive': true,
+                'drawCallback': function(settings) {
+                    //Manage Site
+                    $(".btmanage").click(function() {
+                        window.location.href = '/sites/'+$(this).attr('data-id');
+                    });
+                    //Delete Site
+                    $(".btdelete").click(function() {
+                        siteDelete($(this).attr('data-id'),$(this).attr('data-domain'));
+                    });
                 }
-            ],
-            'bLengthChange': false,
-            'bAutoWidth': true,
-            'responsive': true,
-            'drawCallback': function(settings) {
-                //Manage Site
-                $(".btmanage").click(function() {
-                    window.location.href = '/sites/'+$(this).attr('data-id');
-                });
-                //Delete Site
-                $(".btdelete").click(function() {
-                    siteDelete($(this).attr('data-id'),$(this).attr('data-domain'));
+            });
+        }
+
+        //Delete Site
+        function siteDelete(site_id,domain) {
+            $('#deletesiteid').val(site_id);
+            $('#deletesitedomain').html(domain);
+            $('#deleteSiteModal').modal();
+            $('#delete').click(function() {
+                $.ajax({
+                    url: '/api/sites/'+$('#deletesiteid').val(),
+                    type: 'DELETE',
+                    contentType: 'application/json',
+                    dataType: 'json',
+                    beforeSend: function() {
+                        $('#loadingdelete').removeClass('d-none');
+                    },
+                    complete: function(data) {
+                        setTimeout(function() {
+                            $('#dt').DataTable().clear().destroy();
+                        }, 4500);
+                        setTimeout(function() {
+                            getData('/api/sites',false);
+                        }, 6000);
+                        setTimeout(function() {
+                            $('#deleteSiteModal').modal('toggle');
+                            $('#deletesitedomain').html('');
+                            $('#deletesiteid').val('');
+                            $('#loadingdelete').addClass('d-none');
+                        }, 6500);
+                    },
                 });
-            }
+            });
+        }
+
+        //Auto Update List
+        setInterval(function() {
+            $('#dt').DataTable().clear().destroy();
+            getData('/api/sites',false);
+        }, 45000);
+
+        //Get server domains
+        $('#newsiteserver').change(function() {
+            getDataNoDT('/api/servers/'+$('#newsiteserver').val()+'/domains');
         });
-    }
 
-    //Delete Site
-    function siteDelete(site_id,domain) {
-        $('#deletesiteid').val(site_id);
-        $('#deletesitedomain').html(domain);
-        $('#deleteSiteModal').modal();
-        $('#delete').click(function() {
-            $.ajax({
-                url: '/api/sites/'+$('#deletesiteid').val(),
-                type: 'DELETE',
-                contentType: 'application/json',
-                dataType: 'json',
-                beforeSend: function() {
-                    $('#loadingdelete').removeClass('d-none');
-                },
-                complete: function(data) {
-                    setTimeout(function() {
-                        $('#dt').DataTable().clear().destroy();
-                    }, 4500);
-                    setTimeout(function() {
-                        getData('/api/sites',false);
-                    }, 6000);
-                    setTimeout(function() {
-                        $('#deleteSiteModal').modal('toggle');
-                        $('#deletesitedomain').html('');
-                        $('#deletesiteid').val('');
-                        $('#loadingdelete').addClass('d-none');
-                    }, 6500);
-                },
+        //Check Domain Conflict
+        function domainConflict(domain) {
+            conflict = 0;
+            JSON.parse(localStorage.otherdata).forEach(item => {
+                if(item == domain) {
+                    conflict = conflict + 1;
+                }
             });
-        });
-    }
+            return conflict;
+        }
 
-    //Auto Update List
-    setInterval(function() {
-        $('#dt').DataTable().clear().destroy();
-        getData('/api/sites',false);
-    }, 45000);
+        //Server list
+        function getServers() {
+            $('#newsiteserver').empty();
+            $.ajax({
+                type: 'GET',
+                url: '/api/servers',
+                success: function(data) {
+                    data.forEach(server => {
+                        if(server.status) {
+                            if(server.default) {
+                                $('#newsiteserver').append('<option value="'+server.server_id+'" selected>'+server.name+' ('+server.ip+')</option>');
+                                getDataNoDT('/api/servers/'+server.server_id+'/domains');
+                            } else {
+                                $('#newsiteserver').append('<option value="'+server.server_id+'">'+server.name+' ('+server.ip+')</option>');
+                            }
+                        }
+                    });
+                }
+            });
+        }
+        getServers();
 
-    //Get server domains
-    $('#newsiteserver').change(function() {
-        getDataNoDT('/api/servers/'+$('#newsiteserver').val()+'/domains');
-    });
+        //New Site
+        $('#newSite').click(function() {
+            $('#loading').addClass('d-none');
+            $('#newsiteform').removeClass('d-none');
+            $('#newsiteok').addClass('d-none');
+            $('#newsiteip').html();
+            $('#newsiteusername').html();
+            $('#newsitepassword').html();
+            $('#newsitedbname').html();
+            $('#newsitedbusername').html();
+            $('#newsitedbpassword').html();
+            $('#newsitebasepathuser').html();
+            $('#newsitebasepath').html();
+            $('#newsitedomainok').html();
+            $('#newsitepdf').attr('href','#');
+            $('#newSiteModal').modal();
+        });
 
-    //Check Domain Conflict
-    function domainConflict(domain) {
-        conflict = 0;
-        JSON.parse(localStorage.otherdata).forEach(item => {
-            if(item == domain) {
-                conflict = conflict + 1;
-            }
+        //New Site Validation
+        $('#newsitedomain').keyup(function() {
+            $('#newsitedomain').removeClass('is-invalid');
+            $('#submit').removeClass('disabled');
         });
-        return conflict;
-    }
 
-    //Server list
-    function getServers() {
-        $('#newsiteserver').empty();
-        $.ajax({
-            type: 'GET',
-            url: '/api/servers',
-            success: function(data) {
-                data.forEach(server => {
-                    if(server.status) {
-                        if(server.default) {
-                            $('#newsiteserver').append('<option value="'+server.server_id+'" selected>'+server.name+' ('+server.ip+')</option>');
-                            getDataNoDT('/api/servers/'+server.server_id+'/domains');
-                        } else {
-                            $('#newsiteserver').append('<option value="'+server.server_id+'">'+server.name+' ('+server.ip+')</option>');
-                        }
-                    }
+        //New Site Submit
+        $('#submit').click(function() {
+            validation = true;
+            if(!$('#newsitedomain').val() || $('#newsitedomain').val().length < 5 || domainConflict($('#newsitedomain').val()) > 0) {
+                $('#newsitedomain').addClass('is-invalid');
+                $('#submit').addClass('disabled');
+                validation = false;
+            }
+            if(validation) {
+                $.ajax({
+                    url: '/api/sites',
+                    type: 'POST',
+                    contentType: 'application/json',
+                    dataType: 'json',
+                    data: JSON.stringify({
+                        'domain':   $('#newsitedomain').val(),
+                        'server_id':$('#newsiteserver').val(),
+                        'php':      $('#newsitephp').val(),
+                        'basepath': $('#newsitebasepath').val()
+                    }),
+                    beforeSend: function() {
+                        $('#loading').removeClass('d-none');
+                    },
+                    success: function(data) {
+                        $('#dt').DataTable().clear().destroy();
+                        getData('/api/sites',false);
+                        $('#loading').addClass('d-none');
+                        $('#newsiteip').html(data.server_ip);
+                        $('#newsiteusername').html(data.username);
+                        $('#newsitepassword').html(data.password);
+                        $('#newsitedbname').html(data.database);
+                        $('#newsitedbusername').html(data.database_username);
+                        $('#newsitedbpassword').html(data.database_password);
+                        $('#newsitebasepathuser').html(data.username);
+                        $('#newsitebasepath').html(data.basepath);
+                        $('#newsitedomainok').html(data.domain);
+                        $('#newsitepdf').attr('href',data.pdf);
+                        $('#newsiteform').addClass('d-none');
+                        $('#newsiteok').removeClass('d-none');
+                        $('#newsitedomain').val('');
+                        $('#newsitephp').val('8.0');
+                        $('#newsitebasepath').val('');
+                        getServers();
+                    },
                 });
             }
         });
-    }
-    getServers();
-
-    //New Site
-    $('#newSite').click(function() {
-        $('#loading').addClass('d-none');
-        $('#newsiteform').removeClass('d-none');
-        $('#newsiteok').addClass('d-none');
-        $('#newsiteip').html();
-        $('#newsiteusername').html();
-        $('#newsitepassword').html();
-        $('#newsitedbname').html();
-        $('#newsitedbusername').html();
-        $('#newsitedbpassword').html();
-        $('#newsitebasepathuser').html();
-        $('#newsitebasepath').html();
-        $('#newsitedomainok').html();
-        $('#newsitepdf').attr('href','#');
-        $('#newSiteModal').modal();
-    });
-
-    //New Site Validation
-    $('#newsitedomain').keyup(function() {
-        $('#newsitedomain').removeClass('is-invalid');
-        $('#submit').removeClass('disabled');
-    });
-
-    //New Site Submit
-    $('#submit').click(function() {
-        validation = true;
-        if(!$('#newsitedomain').val() || $('#newsitedomain').val().length < 5 || domainConflict($('#newsitedomain').val()) > 0) {
-            $('#newsitedomain').addClass('is-invalid');
-            $('#submit').addClass('disabled');
-            validation = false;
-        }
-        if(validation) {
-            $.ajax({
-                url: '/api/sites',
-                type: 'POST',
-                contentType: 'application/json',
-                dataType: 'json',
-                data: JSON.stringify({
-                    'domain':   $('#newsitedomain').val(),
-                    'server_id':$('#newsiteserver').val(),
-                    'php':      $('#newsitephp').val(),
-                    'basepath': $('#newsitebasepath').val()
-                }),
-                beforeSend: function() {
-                    $('#loading').removeClass('d-none');
-                },
-                success: function(data) {
-                    $('#dt').DataTable().clear().destroy();
-                    getData('/api/sites',false);
-                    $('#loading').addClass('d-none');
-                    $('#newsiteip').html(data.server_ip);
-                    $('#newsiteusername').html(data.username);
-                    $('#newsitepassword').html(data.password);
-                    $('#newsitedbname').html(data.database);
-                    $('#newsitedbusername').html(data.database_username);
-                    $('#newsitedbpassword').html(data.database_password);
-                    $('#newsitebasepathuser').html(data.username);
-                    $('#newsitebasepath').html(data.basepath);
-                    $('#newsitedomainok').html(data.domain);
-                    $('#newsitepdf').attr('href',data.pdf);
-                    $('#newsiteform').addClass('d-none');
-                    $('#newsiteok').removeClass('d-none');
-                    $('#newsitedomain').val('');
-                    $('#newsitephp').val('8.0');
-                    $('#newsitebasepath').val('');
-                    getServers();
-                },
-            });
-        }
-    });
-</script>
-@endsection
+    </script>
+@endsection

+ 17 - 17
resources/views/template.blade.php

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <script>if(localStorage.getItem('username') === null){window.location.replace('/login');} //Session Check</script>
 <html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
-    
+
     <head>
     <meta charset="utf-8" />
         <meta http-equiv="X-UA-Compatible" content="IE=edge" />
@@ -35,7 +35,7 @@
             }
             #mainloadingicon {
                 margin: 0 auto;
-                margin-top: 100px;    
+                margin-top: 100px;
                 z-index: 100000;
             }
         </style>
@@ -51,38 +51,38 @@
                 <nav class="sb-sidenav accordion sb-sidenav-dark" id="sidenavAccordion">
                     <div class="sb-sidenav-menu">
                         <div class="nav">
-                            <div class="sb-sidenav-menu-heading">MENU</div>
+                            <div class="sb-sidenav-menu-heading">{{ __('cipi.menu') }}</div>
                             <a class="nav-link {{ request()->is('dashboard*') ? 'active' : '' }}" href="/dashboard">
                                 <div class="sb-nav-link-icon"><i class="fas fa-fw fa-th-large"></i></div>
-                                Dashboard
+                                {{ __('cipi.sidebar_menu.dashboard') }}
                             </a>
                             <a class="nav-link {{ request()->is('servers*') ? 'active' : '' }}" href="/servers">
                                 <div class="sb-nav-link-icon"><i class="fas fa-fw fa-server"></i></div>
-                                Servers
+                                {{ __('cipi.sidebar_menu.servers') }}
                             </a>
                             <a class="nav-link {{ request()->is('sites*') ? 'active' : '' }}" href="/sites">
                                 <div class="sb-nav-link-icon"><i class="fas fa-fw fa-rocket"></i></div>
-                                Sites
+                                {{ __('cipi.sidebar_menu.sites') }}
                             </a>
                             <a class="nav-link {{ request()->is('settings*') ? 'active' : '' }}" href="/settings">
                                 <div class="sb-nav-link-icon"><i class="fas fa-fw fa-cog"></i></div>
-                                Settings
+                                {{ __('cipi.sidebar_menu.settings') }}
                             </a>
                             <a class="nav-link" href="{{ config('cipi.docs') }}" target="_blank">
                                 <div class="sb-nav-link-icon"><i class="fas fa-fw fa-book"></i></div>
-                                Documentation
+                                {{ __('cipi.sidebar_menu.documentation') }}
                             </a>
                             <a class="nav-link" href="#" id="logout">
                                 <div class="sb-nav-link-icon"><i class="fas fa-fw fa-sign-out-alt"></i></div>
-                                Logout
+                                {{ __('cipi.sidebar_menu.logout') }}
                             </a>
                         </div>
                     </div>
                     <div class="sb-sidenav-footer">
-                        <div class="small">Panel version:</div>
+                        <div class="small">{{ __('cipi.panel_version') }}:</div>
                         <span id="panelversion"></span>
                         <div class="space"></div>
-                        <div class="small">Logged in as:</div>
+                        <div class="small">{{ __('cipi.logged_in_as') }}:</div>
                         <span id="username"></span>
                     </div>
                 </nav>
@@ -127,20 +127,20 @@
                 </main>
             </div>
             <div id="mainloading" class="d-none">
-                <p><i class="fas fa-circle-notch fa-spin" id="mainloadingicon"></i> Loading data...</p>
+                <p><i class="fas fa-circle-notch fa-spin" id="mainloadingicon"></i> {{ __('cipi.loading_data') }}...</p>
             </div>
             @yield('extra')
             <div class="modal fade" id="errorModal" tabindex="-1" role="dialog" aria-labelledby="errorModalLabel" aria-hidden="true">
                 <div class="modal-dialog" role="document">
                     <div class="modal-content">
                         <div class="modal-header">
-                            <h5 class="modal-title" id="errorModalLabel">System Error</h5>
+                            <h5 class="modal-title" id="errorModalLabel">{{ __('cipi.system_error') }}</h5>
                             <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                             <span aria-hidden="true">&times;</span>
                             </button>
                         </div>
                         <div class="modal-body">
-                            <p>Ops! Something went wrong... try later!</p>
+                            <p>{{ __('cipi.unknown_error') }}</p>
                             <div class="space"></div>
                         </div>
                     </div>
@@ -189,7 +189,7 @@
                 $('#fail').addClass('d-none');
                 $('#failtext').empty();
             });
-            
+
             //Tooltips
             $(function () {
                 $('[data-toggle="tooltip"]').tooltip()
@@ -320,7 +320,7 @@
                     }
                 });
             });
-        </script>     
+        </script>
         @yield('js')
     </body>
-</html>
+</html>