diff --git a/asset/static/src/asset_category/assetCategoryView.js b/asset/static/src/asset_category/assetCategoryView.js index 5d08dcf41..3abd44e09 100644 --- a/asset/static/src/asset_category/assetCategoryView.js +++ b/asset/static/src/asset_category/assetCategoryView.js @@ -1,3 +1,38 @@ +var downloadMessages = { + ar: "هل ترغب في تنزيل القالب؟", + de: "Möchten Sie die Vorlage herunterladen?", + es: "¿Quieres descargar la plantilla?", + en: "Do you want to download the template?", + fr: "Voulez-vous télécharger le modèle ?", +}; + +function getCookie(name) { + let cookieValue = null; + if (document.cookie && document.cookie !== '') { + const cookies = document.cookie.split(';'); + for (let i = 0; i < cookies.length; i++) { + const cookie = cookies[i].trim(); + // Does this cookie string begin with the name we want? + if (cookie.substring(0, name.length + 1) === (name + '=')) { + cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); + break; + } + } + } + return cookieValue; +} + +function getCurrentLanguageCode(callback) { + $.ajax({ + type: "GET", + url: "/employee/get-language-code/", + success: function (response) { + var languageCode = response.language_code; + callback(languageCode); // Pass the language code to the callback + }, + }); +} + $(document).ready(function () { $("#import-dropdown").hide(); // asset category accordion @@ -53,9 +88,14 @@ $(document).ready(function () { $("#asset-info-import").click(function (e) { - e.preventDefault(); - Swal.fire({ - text: "Do you want to download template ?", + e.preventDefault(); + var languageCode = null; + getCurrentLanguageCode(function (code) { + languageCode = code; + var confirmMessage = downloadMessages[languageCode]; + // Use SweetAlert for the confirmation dialog + Swal.fire({ + text: confirmMessage, icon: 'question', showCancelButton: true, confirmButtonColor: '#008000', @@ -87,4 +127,5 @@ $("#asset-info-import").click(function (e) { }); } }); - }); \ No newline at end of file + }); + }); diff --git a/attendance/templates/attendance/attendance_account/overtime_list.html b/attendance/templates/attendance/attendance_account/overtime_list.html index fe093e6b3..0f7d01517 100644 --- a/attendance/templates/attendance/attendance_account/overtime_list.html +++ b/attendance/templates/attendance/attendance_account/overtime_list.html @@ -30,7 +30,7 @@ > -
{{ot.month|capfirst}}
+
{% with month=ot.month|capfirst %}{% trans month %}{% endwith %}
{{ot.year}}
{{ot.hour_account}}
{{ot.overtime}}
diff --git a/attendance/templates/requests/attendance/request_lines.html b/attendance/templates/requests/attendance/request_lines.html index bb88d5c24..af55cde4c 100644 --- a/attendance/templates/requests/attendance/request_lines.html +++ b/attendance/templates/requests/attendance/request_lines.html @@ -241,7 +241,7 @@ hx-get="{% url 'attendance-change' attendance.id %}" hx-target="#updateAttendanceRequestModalBody" class="oh-btn oh-btn--light-bkg w-100" - title="Edit Request" + title="{% trans 'Edit Request' %}" > diff --git a/base/templates/base/auth/password_change_form.html b/base/templates/base/auth/password_change_form.html index 369259c4f..498a32070 100644 --- a/base/templates/base/auth/password_change_form.html +++ b/base/templates/base/auth/password_change_form.html @@ -29,12 +29,12 @@ @@ -50,12 +50,12 @@ @@ -71,12 +71,12 @@ diff --git a/employee/templates/employee/profile/profile_view.html b/employee/templates/employee/profile/profile_view.html index 2c798b800..3615afd23 100644 --- a/employee/templates/employee/profile/profile_view.html +++ b/employee/templates/employee/profile/profile_view.html @@ -6,7 +6,7 @@
- +
diff --git a/leave/templates/leave/company_leave/company-leave.html b/leave/templates/leave/company_leave/company-leave.html index 14c3ba163..d28fa9ba2 100644 --- a/leave/templates/leave/company_leave/company-leave.html +++ b/leave/templates/leave/company_leave/company-leave.html @@ -33,13 +33,13 @@
- + title="{% trans 'Delete' %}">
diff --git a/leave/templates/leave/holiday/holiday.html b/leave/templates/leave/holiday/holiday.html index d444ad041..da1209c74 100644 --- a/leave/templates/leave/holiday/holiday.html +++ b/leave/templates/leave/holiday/holiday.html @@ -17,7 +17,11 @@
{{holiday.name}}
{{holiday.start_date}}
{{holiday.end_date}}
-
{{holiday.recurring}}
+
{% if holiday.recurring %} + {% trans "Yes" %} + {% else %} + {% trans "No" %} + {% endif %}
@@ -162,7 +162,7 @@ hx-get="{% url 'task-creation' rec.id %}" hx-target = "#taskModalBody" - title="Add task"> + title="{% trans 'Add task' %}"> @@ -189,7 +189,7 @@ Delete {% endcomment %}
  • - Send Mail + {% trans "Send Mail" %}
  • @@ -200,7 +200,7 @@ {{candidate.candidate_id.job_position_id}}
    {{candidate.candidate_id.email}} - +
    {% for task in candidate.candidate_id.candidate_task.all %} @@ -211,7 +211,7 @@
    {% endfor %} @@ -224,7 +224,7 @@ @@ -251,7 +251,7 @@