Skip to content

Commit

Permalink
Fixed language bug on Profile edit form
Browse files Browse the repository at this point in the history
  • Loading branch information
antogno committed Jan 23, 2022
1 parent 554dd77 commit 5b745cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions application/controllers/Profiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,7 @@ public function edit()

$data['profile_email'] = $profile->email;
$data['profile_phone'] = $profile->phone;

if ($profile->language === 'en') {
$data['profile_language'] = $this->lang->line('english');
} else {
$data['profile_language'] = $this->lang->line('italian');
}
$data['profile_language'] = $profile->language;

$data['title'] = $this->lang->line('edit_profile');
$data['meta_title'] = $this->lang->line('edit_profile_meta_title');
Expand Down
4 changes: 2 additions & 2 deletions application/views/profiles/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@
<label class="form-label"><strong><?= $language; ?></strong>*:
<div class="form-check">
<label for="language" class="form-check-label">
<input type="radio" class="form-check-input" id="language_en" name="language" value="en" checked>
<input type="radio" class="form-check-input" id="language_en" name="language" value="en" <?php if ($profile_language == 'en') { echo 'checked'; }?>>
<?= $this->lang->line('english'); ?>
</label>
</div>
<div class="form-check">
<label for="language" class="form-check-label">
<input type="radio" class="form-check-input" id="language_it" name="language" value="it">
<input type="radio" class="form-check-input" id="language_it" name="language" value="it" <?php if ($profile_language == 'it') { echo 'checked'; }?>>
<?= $this->lang->line('italian'); ?>
</label>
</div>
Expand Down

0 comments on commit 5b745cd

Please sign in to comment.