From f507acde672997fdfdec37e1c359624541afbfae Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Mon, 11 Jan 2021 15:22:48 +0000 Subject: [PATCH] [Notes][Translate] Added Code to support translating UI to other langs --- application/controllers/Notes.php | 3 +++ application/language/english/notes_lang.php | 23 +++++++++++++++++++++ application/views/notes/add.php | 20 +++++++++--------- application/views/notes/edit.php | 20 +++++++++--------- application/views/notes/main.php | 10 ++++----- application/views/notes/view.php | 10 ++++----- 6 files changed, 56 insertions(+), 30 deletions(-) create mode 100644 application/language/english/notes_lang.php diff --git a/application/controllers/Notes.php b/application/controllers/Notes.php index a8de4a47..3101da88 100644 --- a/application/controllers/Notes.php +++ b/application/controllers/Notes.php @@ -8,6 +8,9 @@ class Notes extends CI_Controller { $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'); } + + // Load language files + $this->lang->load('notes'); } diff --git a/application/language/english/notes_lang.php b/application/language/english/notes_lang.php new file mode 100644 index 00000000..74043b8b --- /dev/null +++ b/application/language/english/notes_lang.php @@ -0,0 +1,23 @@ +
-

Create Note

+

lang->line('notes_create_note'); ?>

@@ -26,26 +26,26 @@
- +
- +
- +
- +
diff --git a/application/views/notes/edit.php b/application/views/notes/edit.php index 62b2be80..5a1e23f9 100644 --- a/application/views/notes/edit.php +++ b/application/views/notes/edit.php @@ -4,13 +4,13 @@ result() as $row) { ?>
-

Edit Note

+

lang->line('notes_edit_note'); ?>

@@ -27,27 +27,27 @@
- +
- +
- +
note; ?>
- +
diff --git a/application/views/notes/main.php b/application/views/notes/main.php index db8934c2..84374a12 100644 --- a/application/views/notes/main.php +++ b/application/views/notes/main.php @@ -2,13 +2,13 @@
-

Notes

+

lang->line('notes_menu_notes'); ?>

@@ -19,7 +19,7 @@ if ($notes->num_rows() > 0) { - echo "

Your Notes

"; + echo "

".$this->lang->line('notes_your_notes')."

"; echo ""; } else { - echo "

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!

"; + echo "

".$this->lang->line('notes_welcome')."

"; } ?> diff --git a/application/views/notes/view.php b/application/views/notes/view.php index 899946c5..ded9057b 100644 --- a/application/views/notes/view.php +++ b/application/views/notes/view.php @@ -3,22 +3,22 @@