[Notes][Translate] Added Code to support translating UI to other langs
这个提交包含在:
		
							父节点
							
								
									fba3a16ecc
								
							
						
					
					
						当前提交
						f507acde67
					
				
					共有  6 个文件被更改,包括 56 次插入 和 30 次删除
				
			
		|  | @ -8,6 +8,9 @@ class Notes extends CI_Controller { | ||||||
| 
 | 
 | ||||||
| 		$this->load->model('user_model'); | 		$this->load->model('user_model'); | ||||||
| 		if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } | 		if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } | ||||||
|  | 
 | ||||||
|  | 		// Load language files
 | ||||||
|  | 		$this->lang->load('notes'); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -0,0 +1,23 @@ | ||||||
|  | <?php | ||||||
|  | 
 | ||||||
|  | defined('BASEPATH') OR exit('No direct script access allowed'); | ||||||
|  | 
 | ||||||
|  | $lang['notes_menu_notes'] = 'Notes'; | ||||||
|  | $lang['notes_edit_note'] = 'Edit Note'; | ||||||
|  | $lang['notes_your_notes'] = 'Your Notes'; | ||||||
|  | 
 | ||||||
|  | $lang['notes_welcome'] = "You don't currently have any notes, these are a fantastic way of storing data like ATU settings, beacons and general station notes and its better than paper as you can't lose them!"; | ||||||
|  | 
 | ||||||
|  | $lang['notes_create_note'] = 'Create Note'; | ||||||
|  | 
 | ||||||
|  | $lang['notes_input_title'] = 'Title'; | ||||||
|  | $lang['notes_input_category'] = 'Category'; | ||||||
|  | $lang['notes_input_notes_content'] = 'Note Contents'; | ||||||
|  | $lang['notes_input_btn_save_note'] = 'Save Note'; | ||||||
|  | $lang['notes_input_btn_edit_note'] = 'Edit Note'; | ||||||
|  | $lang['notes_input_btn_delete_note'] = 'Delete Note'; | ||||||
|  | 
 | ||||||
|  | $lang['notes_selection_general'] = 'General'; | ||||||
|  | $lang['notes_selection_antennas'] = 'Antennas'; | ||||||
|  | $lang['notes_selection_satellites'] = 'Satellites'; | ||||||
|  | 
 | ||||||
|  | @ -3,13 +3,13 @@ | ||||||
| 
 | 
 | ||||||
| <div class="card"> | <div class="card"> | ||||||
|   <div class="card-header"> |   <div class="card-header"> | ||||||
|     <h2 class="card-title">Create Note</h2> |     <h2 class="card-title"><?php echo $this->lang->line('notes_create_note'); ?></h2>
 | ||||||
|     <ul class="nav nav-tabs card-header-tabs"> |     <ul class="nav nav-tabs card-header-tabs"> | ||||||
| 	    <li class="nav-item"> | 	    <li class="nav-item"> | ||||||
| 	    	<a class="nav-link" href="<?php echo site_url('notes'); ?>">Notes</a> | 	    	<a class="nav-link" href="<?php echo site_url('notes'); ?>"><?php echo $this->lang->line('notes_menu_notes'); ?></a>
 | ||||||
| 	    </li> | 	    </li> | ||||||
| 	    <li class="nav-item"> | 	    <li class="nav-item"> | ||||||
| 	    	<a class="nav-link active" href="<?php echo site_url('notes/add'); ?>">Create Note</a> | 	    	<a class="nav-link active" href="<?php echo site_url('notes/add'); ?>"><?php echo $this->lang->line('notes_create_note'); ?></a>
 | ||||||
| 	    </li> | 	    </li> | ||||||
| 	</ul> | 	</ul> | ||||||
|   </div> |   </div> | ||||||
|  | @ -26,26 +26,26 @@ | ||||||
|     <form method="post" action="<?php echo site_url('notes/add'); ?>" name="notes_add" id="notes_add"> |     <form method="post" action="<?php echo site_url('notes/add'); ?>" name="notes_add" id="notes_add"> | ||||||
| 
 | 
 | ||||||
| 	<div class="form-group"> | 	<div class="form-group"> | ||||||
| 		<label for="inputTitle">Title</label> | 		<label for="inputTitle"><?php echo $this->lang->line('notes_input_title'); ?></label>
 | ||||||
| 		<input type="text" name="title" class="form-control" id="inputTitle"> | 		<input type="text" name="title" class="form-control" id="inputTitle"> | ||||||
| 	</div> | 	</div> | ||||||
| 
 | 
 | ||||||
| 	<div class="form-group"> | 	<div class="form-group"> | ||||||
| 	   <label for="catSelect">Category</label> | 	   <label for="catSelect"><?php echo $this->lang->line('notes_input_category'); ?></label>
 | ||||||
| 	   <select name="category" class="form-control" id="catSelect"> | 	   <select name="category" class="form-control" id="catSelect"> | ||||||
| 	   	<option value="General" selected="selected">General</option> | 	   	<option value="General" selected="selected"><?php echo $this->lang->line('notes_selection_general'); ?></option>
 | ||||||
| 		<option value="Antennas">Antennas</option> | 		<option value="Antennas"><?php echo $this->lang->line('notes_selection_antennas'); ?></option>
 | ||||||
| 		<option value="Satellites">Satellites</option> | 		<option value="Satellites"><?php echo $this->lang->line('notes_selection_satellites'); ?></option>
 | ||||||
| 	   </select> | 	   </select> | ||||||
| 	</div> | 	</div> | ||||||
| 
 | 
 | ||||||
| 	<div class="form-group"> | 	<div class="form-group"> | ||||||
| 		<label for="inputTitle">Note Contents</label> | 		<label for="inputTitle"><?php echo $this->lang->line('notes_input_notes_content'); ?></label>
 | ||||||
| 		<div id="quillArea"></div> | 		<div id="quillArea"></div> | ||||||
| 		<textarea name="content" style="display:none" id="hiddenArea"></textarea> | 		<textarea name="content" style="display:none" id="hiddenArea"></textarea> | ||||||
| 	</div> | 	</div> | ||||||
| 
 | 
 | ||||||
| 	<button type="submit" value="Submit" class="btn btn-primary">Save Note</button> | 	<button type="submit" value="Submit" class="btn btn-primary"><?php echo $this->lang->line('notes_input_btn_save_note'); ?></button>
 | ||||||
| 	</form> | 	</form> | ||||||
|   </div> |   </div> | ||||||
| </div> | </div> | ||||||
|  |  | ||||||
|  | @ -4,13 +4,13 @@ | ||||||
| <?php foreach ($note->result() as $row) { ?>
 | <?php foreach ($note->result() as $row) { ?>
 | ||||||
| <div class="card"> | <div class="card"> | ||||||
|   <div class="card-header"> |   <div class="card-header"> | ||||||
|     <h2 class="card-title">Edit Note</h2> |     <h2 class="card-title"><?php echo $this->lang->line('notes_edit_note'); ?></h2>
 | ||||||
| 	<ul class="nav nav-tabs card-header-tabs"> | 	<ul class="nav nav-tabs card-header-tabs"> | ||||||
| 	    <li class="nav-item"> | 	    <li class="nav-item"> | ||||||
| 	    	<a class="nav-link" href="<?php echo site_url('notes'); ?>">Notes</a> | 	    	<a class="nav-link" href="<?php echo site_url('notes'); ?>"><?php echo $this->lang->line('notes_menu_notes'); ?></a>
 | ||||||
| 	    </li> | 	    </li> | ||||||
| 	    <li class="nav-item"> | 	    <li class="nav-item"> | ||||||
| 	    	<a class="nav-link" href="<?php echo site_url('notes/add'); ?>">Create Note</a> | 	    	<a class="nav-link" href="<?php echo site_url('notes/add'); ?>"><?php echo $this->lang->line('notes_create_note'); ?></a>
 | ||||||
| 	    </li> | 	    </li> | ||||||
| 	</ul> | 	</ul> | ||||||
|   </div> |   </div> | ||||||
|  | @ -27,27 +27,27 @@ | ||||||
| 	<form method="post" action="<?php echo site_url('notes/edit'); ?>/<?php echo $id; ?>" name="notes_add" id="notes_add"> | 	<form method="post" action="<?php echo site_url('notes/edit'); ?>/<?php echo $id; ?>" name="notes_add" id="notes_add"> | ||||||
| 
 | 
 | ||||||
| 	<div class="form-group"> | 	<div class="form-group"> | ||||||
| 		<label for="inputTitle">Title</label> | 		<label for="inputTitle"><?php echo $this->lang->line('notes_input_title'); ?></label>
 | ||||||
| 		<input type="text" name="title" class="form-control" value="<?php echo $row->title; ?>" id="inputTitle"> | 		<input type="text" name="title" class="form-control" value="<?php echo $row->title; ?>" id="inputTitle"> | ||||||
| 	</div> | 	</div> | ||||||
| 
 | 
 | ||||||
| 	<div class="form-group"> | 	<div class="form-group"> | ||||||
| 	   <label for="catSelect">Category</label> | 	   <label for="catSelect"><?php echo $this->lang->line('notes_input_category'); ?></label>
 | ||||||
| 	   <select name="category" class="form-control" id="catSelect"> | 	   <select name="category" class="form-control" id="catSelect"> | ||||||
| 	   	<option value="General" selected="selected">General</option> | 	    <option value="General" selected="selected"><?php echo $this->lang->line('notes_selection_general'); ?></option>
 | ||||||
| 		<option value="Antennas">Antennas</option> | 		<option value="Antennas"><?php echo $this->lang->line('notes_selection_antennas'); ?></option>
 | ||||||
| 		<option value="Satellites">Satellites</option> | 		<option value="Satellites"><?php echo $this->lang->line('notes_selection_satellites'); ?></option>
 | ||||||
| 	   </select> | 	   </select> | ||||||
| 	</div> | 	</div> | ||||||
| 
 | 
 | ||||||
| 	<div class="form-group"> | 	<div class="form-group"> | ||||||
| 		<label for="inputTitle">Note Contents</label> | 		<label for="inputTitle"><?php echo $this->lang->line('notes_input_notes_content'); ?></label>
 | ||||||
| 		<div id="quillArea"><?php echo $row->note; ?></div>
 | 		<div id="quillArea"><?php echo $row->note; ?></div>
 | ||||||
| 		<textarea name="content" style="display:none" id="hiddenArea"></textarea> | 		<textarea name="content" style="display:none" id="hiddenArea"></textarea> | ||||||
| 	</div> | 	</div> | ||||||
| 
 | 
 | ||||||
| 	<input type="hidden" name="id" value="<?php echo $id; ?>" /> | 	<input type="hidden" name="id" value="<?php echo $id; ?>" /> | ||||||
| 	<button type="submit" value="Submit" class="btn btn-primary">Save Note</button> | 	<button type="submit" value="Submit" class="btn btn-primary"><?php echo $this->lang->line('notes_input_btn_save_note'); ?></button>
 | ||||||
| 	</form> | 	</form> | ||||||
|   </div> |   </div> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -2,13 +2,13 @@ | ||||||
| 
 | 
 | ||||||
| 	<div class="card"> | 	<div class="card"> | ||||||
| 	  <div class="card-header"> | 	  <div class="card-header"> | ||||||
| 	  	<h2 class="card-title">Notes</h2> | 	  	<h2 class="card-title"><?php echo $this->lang->line('notes_menu_notes'); ?></h2>
 | ||||||
| 	    <ul class="nav nav-tabs card-header-tabs"> | 	    <ul class="nav nav-tabs card-header-tabs"> | ||||||
| 	      <li class="nav-item"> | 	      <li class="nav-item"> | ||||||
| 	        <a class="nav-link active" href="<?php echo site_url('notes'); ?>">Notes</a> | 	        <a class="nav-link active" href="<?php echo site_url('notes'); ?>"><?php echo $this->lang->line('notes_menu_notes'); ?></a>
 | ||||||
| 	      </li> | 	      </li> | ||||||
| 	      <li class="nav-item"> | 	      <li class="nav-item"> | ||||||
| 	        <a class="nav-link" href="<?php echo site_url('notes/add'); ?>">Create Note</a> | 	        <a class="nav-link" href="<?php echo site_url('notes/add'); ?>"><?php echo $this->lang->line('notes_create_note'); ?></a>
 | ||||||
| 	      </li> | 	      </li> | ||||||
| 	    </ul> | 	    </ul> | ||||||
| 	  </div> | 	  </div> | ||||||
|  | @ -19,7 +19,7 @@ | ||||||
| 
 | 
 | ||||||
| 				if ($notes->num_rows() > 0) | 				if ($notes->num_rows() > 0) | ||||||
| 				{ | 				{ | ||||||
| 					echo "<h3>Your Notes</h3>"; | 					echo "<h3>".$this->lang->line('notes_your_notes')."</h3>"; | ||||||
| 					echo "<ul class=\"list-group\">"; | 					echo "<ul class=\"list-group\">"; | ||||||
| 					foreach ($notes->result() as $row) | 					foreach ($notes->result() as $row) | ||||||
| 					{ | 					{ | ||||||
|  | @ -29,7 +29,7 @@ | ||||||
| 					} | 					} | ||||||
| 					echo "</ul>"; | 					echo "</ul>"; | ||||||
| 				} else { | 				} else { | ||||||
| 					echo "<p>You don't currently have any notes, these are a fantastic way of storing data like ATU settings, beacons and general station notes and its better than paper as you can't lose them!</p>"; | 					echo "<p>".$this->lang->line('notes_welcome')."</p>"; | ||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
| 			?>
 | 			?>
 | ||||||
|  |  | ||||||
|  | @ -3,22 +3,22 @@ | ||||||
| 	<div class="card"> | 	<div class="card"> | ||||||
| 	<?php foreach ($note->result() as $row) { ?>
 | 	<?php foreach ($note->result() as $row) { ?>
 | ||||||
| 		<div class="card-header"> | 		<div class="card-header"> | ||||||
|     		<h2 class="card-title">Note - <?php echo $row->title; ?></h2>
 |     		<h2 class="card-title"><?php echo $this->lang->line('notes_menu_notes'); ?> - <?php echo $row->title; ?></h2>
 | ||||||
|     			<ul class="nav nav-tabs card-header-tabs"> |     			<ul class="nav nav-tabs card-header-tabs"> | ||||||
| 	    <li class="nav-item"> | 	    <li class="nav-item"> | ||||||
| 	    	<a class="nav-link" href="<?php echo site_url('notes'); ?>">Notes</a> | 	    	<a class="nav-link" href="<?php echo site_url('notes'); ?>"><?php echo $this->lang->line('notes_menu_notes'); ?></a>
 | ||||||
| 	    </li> | 	    </li> | ||||||
| 	    <li class="nav-item"> | 	    <li class="nav-item"> | ||||||
| 	    	<a class="nav-link" href="<?php echo site_url('notes/add'); ?>">Create Note</a> | 	    	<a class="nav-link" href="<?php echo site_url('notes/add'); ?>"><?php echo $this->lang->line('notes_create_note'); ?></a>
 | ||||||
| 	    </li> | 	    </li> | ||||||
| 	</ul> | 	</ul> | ||||||
| 		</div> | 		</div> | ||||||
| 	  <div class="card-body"> | 	  <div class="card-body"> | ||||||
| 	    <p class="card-text"><?php echo nl2br($row->note); ?></p>
 | 	    <p class="card-text"><?php echo nl2br($row->note); ?></p>
 | ||||||
| 
 | 
 | ||||||
| 	    <a href="<?php echo site_url('notes/edit'); ?>/<?php echo $row->id; ?>" class="btn btn-primary"><i class="fas fa-edit"></i> Edit Note</a> | 	    <a href="<?php echo site_url('notes/edit'); ?>/<?php echo $row->id; ?>" class="btn btn-primary"><i class="fas fa-edit"></i> <?php echo $this->lang->line('notes_input_btn_edit_note'); ?></a>
 | ||||||
| 
 | 
 | ||||||
| 	    <a href="<?php echo site_url('notes/delete'); ?>/<?php echo $row->id; ?>" class="btn btn-danger"><i class="fas fa-trash-alt"></i> Delete Note</a> | 	    <a href="<?php echo site_url('notes/delete'); ?>/<?php echo $row->id; ?>" class="btn btn-danger"><i class="fas fa-trash-alt"></i> <?php echo $this->lang->line('notes_input_btn_delete_note'); ?></a>
 | ||||||
| 	    <?php } ?>
 | 	    <?php } ?>
 | ||||||
| 	  </div | 	  </div | ||||||
| >	</div> | >	</div> | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用