Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/src/components/CheckInPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<span>{{ __("Last {0} was at {1}", [__(lastLogType), formatTimestamp(lastLog.time)]) }}</span>
<span class="whitespace-pre"> &middot; </span>
<router-link :to="{ name: 'EmployeeCheckinListView' }" v-slot="{ navigate }">
<span @click="navigate" class="underline">View List</span>
<span @click="navigate" class="underline">{{ __("View List") }}</span>
</router-link>
</div>
<Button
Expand Down Expand Up @@ -132,7 +132,7 @@ function handleLocationSuccess(position) {
}

function handleLocationError(error) {
locationStatus.value = "Unable to retrieve your location"
locationStatus.value = __("Unable to retrieve your location")
if (error) locationStatus.value += `: ERROR(${error.code}): ${error.message}`
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/EmployeeCheckinItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<template #left>
<FeatherIcon name="clock" class="h-5 w-5 text-gray-500" />
<div class="flex flex-col items-start gap-1.5">
<div class="text-base font-normal text-gray-800">Log Type: {{ props.doc.log_type }}</div>
<div class="text-base font-normal text-gray-800">{{ __("Log Type: {0}", [props.doc.log_type]) }}</div>
<div class="text-xs font-normal text-gray-500">
<span>{{ formatTimestamp(props.doc.time) }}</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/FormView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ function validateMandatoryFields() {

if (errorFields.length) {
formErrorMessage.value = `${errorFields.join(", ")} ${
errorFields.length > 1 ? "fields are mandatory" : "field is mandatory"
errorFields.length > 1 ? __("fields are mandatory") : __("field is mandatory")
}`
return false
} else {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/InstallPrompt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
{{ __("Get the app on your iPhone for easy access & a better experience") }}
</span>
<span class="inline-flex items-start whitespace-nowrap">
<span>Tap&nbsp;</span>
<span>{{ __("Tap") }}&nbsp;</span>
<FeatherIcon name="share" class="h-4 w-4 text-blue-600" />
<span>&nbsp;and then "Add to Home Screen"</span>
<span>&nbsp;{{ __('and then "Add to Home Screen"') }}</span>
</span>
</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/SalaryDetailTable.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<!-- Header -->
<div class="flex flex-row justify-between items-center">
<h2 class="text-base font-semibold text-gray-800">{{ type }}</h2>
<h2 class="text-base font-semibold text-gray-800">{{ __(type) }}</h2>
<span class="text-base font-semibold text-gray-800">
{{ total }}
</span>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/ShiftAssignmentItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<span v-if="props.doc.shift_timing" class="text-gray-700 font-normal rounded text-base">
{{ props.doc.shift_timing }}
</span>
<Badge v-else variant="outline" :theme="colorMap[status]" :label="status" size="md" />
<Badge v-else variant="outline" :theme="colorMap[status]" :label="__(status)" size="md" />
<FeatherIcon name="chevron-right" class="h-5 w-5 text-gray-500" />
</template>
</ListItem>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/ShiftRequestItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</div>
</template>
<template #right>
<Badge variant="outline" :theme="colorMap[status]" :label="status" size="md" />
<Badge variant="outline" :theme="colorMap[status]" :label="__(status)" size="md" />
<FeatherIcon name="chevron-right" class="h-5 w-5 text-gray-500" />
</template>
</ListItem>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/plugins/translationsPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function makeTranslationFunction() {
}

const { translate, load } = makeTranslationFunction();
export const __ = translate;

export const translationsPlugin = {
async isReady() {
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/utils/commonUtils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { toast } from "frappe-ui"
import { __ } from "@/plugins/translationsPlugin"

export function useDownloadPDF() {
async function downloadPDF({ doctype, docname, filename = null }) {
Expand All @@ -20,8 +21,8 @@ export function useDownloadPDF() {
return response.blob()
} else {
toast({
title: "Download Failed",
text: `Error downloading PDF`,
title: __("Download Failed"),
text: __("Error downloading PDF"),
type: "error",
icon: "alert-circle",
position: "bottom-center",
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/utils/dialogs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { __ } from "@/plugins/translationsPlugin"
export const showErrorAlert = async (message) => {
const alert = await alertController.create({
header: "Error",
header: __("Error"),
message,
buttons: ["OK"],
})
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/utils/pushNotifications.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { __ } from "@/plugins/translationsPlugin"
export const isChrome = () =>
navigator.userAgent.toLowerCase().includes("chrome")

Expand All @@ -21,7 +22,7 @@ export const showNotification = (payload) => {
notificationOptions["actions"] = [
{
action: payload.data.click_action,
title: "View Details",
title: __("View Details"),
},
]
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/Profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ const logout = async () => {
try {
await session.logout.submit()
} catch (e) {
const msg = "An error occurred while attempting to log out!"
const msg = __("An error occurred while attempting to log out!")
console.error(msg, e)
showErrorAlert(msg)
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/attendance/Dashboard.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<BaseLayout pageTitle="Attendance">
<BaseLayout :pageTitle="__('Attendance')">
<template #body>
<div class="flex flex-col mt-7 mb-7 p-4 gap-7">
<AttendanceCalendar />
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/attendance/ShiftRequestList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ion-page>
<ListView
doctype="Shift Request"
pageTitle="Shift Request History"
:pageTitle="__('Shift Request History')"
:tabButtons="TAB_BUTTONS"
:fields="SHIFT_REQUEST_FIELDS"
:filterConfig="FILTER_CONFIG"
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/views/expense_claim/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ion-page>
<ListView
doctype="Expense Claim"
:pageTitle="('Claim History')"
:pageTitle="__('Claim History')"
:tabButtons="TAB_BUTTONS"
:fields="EXPENSE_CLAIM_FIELDS"
groupBy="`tabExpense Claim`.name"
Expand Down Expand Up @@ -36,27 +36,27 @@ const FILTER_CONFIG = [
{
fieldname: "approval_status",
fieldtype: "Select",
label: "Approval Status",
label: __("Approval Status"),
options: ["Draft", "Approved", "Rejected"],
},
{
fieldname: "status",
fieldtype: "Select",
label: "Status",
label: __("Status"),
options: ["Draft", "Paid", "Unpaid", "Rejected", "Submitted", "Cancelled"],
},
{
fieldname: "employee",
fieldtype: "Link",
label: "Employee",
label: __("Employee"),
options: "Employee",
},
{
fieldname: "department",
fieldtype: "Link",
label: "Department",
label: __("Department"),
options: "Department",
},
{ fieldname: "posting_date", fieldtype: "Date", label: "Posting Date" },
{ fieldname: "posting_date", fieldtype: "Date", label: __("Posting Date") },
]
</script>
2 changes: 1 addition & 1 deletion frontend/src/views/salary_slip/Detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function downloadPDF() {
if (response.ok) {
return response.blob()
} else {
downloadError.value = "Failed to download PDF"
downloadError.value = __("Failed to download PDF")
}
})
.then((blob) => {
Expand Down
1 change: 1 addition & 0 deletions hrms/payroll/doctype/salary_structure/salary_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ def get_employees(salary_structure: str) -> list[str]:


@frappe.whitelist()
@frappe.validate_and_sanitize_search_inputs
def get_salary_component(
doctype: str, txt: str, searchfield: str, start: int, page_len: int, filters: dict
) -> list:
Expand Down
Loading