fix(i18n): enable translations in all templates and implement cookie-based language persistence
- Add _() translation function to add_tablet.html, add_user.html, loan_tablet.html - Add _() translation function to add_non_loanable_device.html, edit_non_loanable_device.html - Add _() translation function to history.html, non_loanable_devices.html, project_management.html - Update app.py to use cookie-based language persistence with 1-year expiry - Add /set_language endpoint to handle language switching with cookie + session - Update language switcher in base.html to use new endpoint - Set Spanish (es) as default language for internal app - Import make_response and session from Flask
This commit is contained in:
parent
8c1d12a5c4
commit
2248237c79
10 changed files with 133 additions and 107 deletions
|
|
@ -1,63 +1,63 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Add Non-Loanable Device</h2>
|
||||
<p>Add a device that will be tracked in inventory but cannot be loaned to users (e.g., projectors, monitors, etc.)</p>
|
||||
<h2>{{ _('Add Non-Loanable Device') }}</h2>
|
||||
<p>{{ _('Add a device that will be tracked in inventory but cannot be loaned to users (e.g., projectors, monitors, etc.)') }}</p>
|
||||
|
||||
<form method="POST" action="/add_non_loanable_device">
|
||||
<div class="form-group">
|
||||
<label for="device_type">Device Type:</label>
|
||||
<label for="device_type">{{ _('Device Type') }}:</label>
|
||||
<select id="device_type" name="device_type" required>
|
||||
<option value="">Select device type...</option>
|
||||
<option value="projector">Projector</option>
|
||||
<option value="monitor">Monitor</option>
|
||||
<option value="laptop">Laptop (non-loanable)</option>
|
||||
<option value="printer">Printer</option>
|
||||
<option value="camera">Camera</option>
|
||||
<option value="audio">Audio Equipment</option>
|
||||
<option value="network">Network Equipment</option>
|
||||
<option value="other">Other</option>
|
||||
<option value="">{{ _('Select device type...') }}</option>
|
||||
<option value="projector">{{ _('Projector') }}</option>
|
||||
<option value="monitor">{{ _('Monitor') }}</option>
|
||||
<option value="laptop">{{ _('Laptop (non-loanable)') }}</option>
|
||||
<option value="printer">{{ _('Printer') }}</option>
|
||||
<option value="camera">{{ _('Camera') }}</option>
|
||||
<option value="audio">{{ _('Audio Equipment') }}</option>
|
||||
<option value="network">{{ _('Network Equipment') }}</option>
|
||||
<option value="other">{{ _('Other') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="brand">Brand:</label>
|
||||
<label for="brand">{{ _('Brand') }}:</label>
|
||||
<input type="text" id="brand" name="brand" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="model">Model:</label>
|
||||
<label for="model">{{ _('Model') }}:</label>
|
||||
<input type="text" id="model" name="model" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="serial_number">Serial Number:</label>
|
||||
<label for="serial_number">{{ _('Serial Number') }}:</label>
|
||||
<input type="text" id="serial_number" name="serial_number" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="location">Location:</label>
|
||||
<label for="location">{{ _('Location') }}:</label>
|
||||
<input type="text" id="location" name="location">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="purchase_date">Purchase Date:</label>
|
||||
<label for="purchase_date">{{ _('Purchase Date') }}:</label>
|
||||
<input type="date" id="purchase_date" name="purchase_date">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="purchase_cost">Purchase Cost:</label>
|
||||
<label for="purchase_cost">{{ _('Purchase Cost') }}:</label>
|
||||
<input type="number" id="purchase_cost" name="purchase_cost" step="0.01">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="notes">Notes:</label>
|
||||
<label for="notes">{{ _('Notes') }}:</label>
|
||||
<textarea id="notes" name="notes"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn">Add Device</button>
|
||||
<a href="/non_loanable_devices" class="btn">Cancel</a>
|
||||
<button type="submit" class="btn">{{ _('Add Device') }}</button>
|
||||
<a href="/non_loanable_devices" class="btn">{{ _('Cancel') }}</a>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue