@@ -62,7 +62,7 @@ const props = defineProps({
pageTitle: {
type: String,
required: false,
- default: "Frappe HR",
+ default: "",
},
})
diff --git a/frontend/src/components/BottomTabs.vue b/frontend/src/components/BottomTabs.vue
index 804aa30468..416dd787f4 100644
--- a/frontend/src/components/BottomTabs.vue
+++ b/frontend/src/components/BottomTabs.vue
@@ -31,33 +31,36 @@ import LeaveIcon from "@/components/icons/LeaveIcon.vue"
import ExpenseIcon from "@/components/icons/ExpenseIcon.vue"
import SalaryIcon from "@/components/icons/SalaryIcon.vue"
import AttendanceIcon from "@/components/icons/AttendanceIcon.vue"
+import { inject } from "vue"
+
+const __ = inject("$translate")
const route = useRoute()
const tabItems = [
{
icon: HomeIcon,
- title: "Home",
+ title: __("Home"),
route: "/home",
},
{
icon: AttendanceIcon,
- title: "Attendance",
+ title: __("Attendance"),
route: "/dashboard/attendance",
},
{
icon: LeaveIcon,
- title: "Leaves",
+ title: __("Leaves"),
route: "/dashboard/leaves",
},
{
icon: ExpenseIcon,
- title: "Expenses",
+ title: __("Expenses"),
route: "/dashboard/expense-claims",
},
{
icon: SalaryIcon,
- title: "Salary",
+ title: __("Salary"),
route: "/dashboard/salary-slips",
},
]
diff --git a/frontend/src/components/CheckInPanel.vue b/frontend/src/components/CheckInPanel.vue
index db748ebfab..2282ae40a7 100644
--- a/frontend/src/components/CheckInPanel.vue
+++ b/frontend/src/components/CheckInPanel.vue
@@ -1,10 +1,12 @@
-
Hey, {{ employee?.data?.first_name }} 👋
+
+ {{ __("Hey, {0} 👋", [employee?.data?.first_name]) }}
+
- Last {{ lastLogType }} was at {{ formatTimestamp(lastLog.time) }}
+ {{ __("Last {0} was at {1}", [__(lastLogType), formatTimestamp(lastLog.time)]) }}
·
View List
@@ -68,7 +70,7 @@
- Confirm {{ nextAction.label }}
+ {{ __("Confirm {0}", [nextAction.label]) }}
@@ -86,6 +88,7 @@ const DOCTYPE = "Employee Checkin"
const socket = inject("$socket")
const employee = inject("$employee")
const dayjs = inject("$dayjs")
+const __ = inject("$translate")
const checkinTimestamp = ref(null)
const latitude = ref(0)
const longitude = ref(0)
@@ -117,18 +120,18 @@ const lastLogType = computed(() => {
const nextAction = computed(() => {
return lastLog?.value?.log_type === "IN"
- ? { action: "OUT", label: "Check Out" }
- : { action: "IN", label: "Check In" }
+ ? { action: "OUT", label: __("Check Out") }
+ : { action: "IN", label: __("Check In") }
})
function handleLocationSuccess(position) {
latitude.value = position.coords.latitude
longitude.value = position.coords.longitude
- locationStatus.value = `
- Latitude: ${Number(latitude.value).toFixed(5)}°,
- Longitude: ${Number(longitude.value).toFixed(5)}°
- `
+ locationStatus.value = [
+ __("Latitude: {0}°", [Number(latitude.value).toFixed(5)]),
+ __("Longitude: {0}°", [Number(longitude.value).toFixed(5)]),
+ ].join(", ")
}
function handleLocationError(error) {
@@ -138,9 +141,9 @@ function handleLocationError(error) {
const fetchLocation = () => {
if (!navigator.geolocation) {
- locationStatus.value = "Geolocation is not supported by your current browser"
+ locationStatus.value = __("Geolocation is not supported by your current browser")
} else {
- locationStatus.value = "Locating..."
+ locationStatus.value = __("Locating...")
navigator.geolocation.getCurrentPosition(handleLocationSuccess, handleLocationError)
}
}
@@ -154,7 +157,7 @@ const handleEmployeeCheckin = () => {
}
const submitLog = (logType) => {
- const action = logType === "IN" ? "Check-in" : "Check-out"
+ const actionLabel = logType === "IN" ? __("Check-in") : __("Check-out")
checkins.insert.submit(
{
@@ -168,8 +171,8 @@ const submitLog = (logType) => {
onSuccess() {
modalController.dismiss()
toast({
- title: "Success",
- text: `${action} successful!`,
+ title: __("Success"),
+ text: __("{0} successful!", [actionLabel]),
icon: "check-circle",
position: "bottom-center",
iconClasses: "text-green-500",
@@ -177,8 +180,8 @@ const submitLog = (logType) => {
},
onError() {
toast({
- title: "Error",
- text: `${action} failed!`,
+ title: __("Error"),
+ text: __("{0} failed!", [actionLabel]),
icon: "alert-circle",
position: "bottom-center",
iconClasses: "text-red-500",
diff --git a/frontend/src/components/EmployeeAdvanceBalance.vue b/frontend/src/components/EmployeeAdvanceBalance.vue
index 6a8a27098c..3b645be476 100644
--- a/frontend/src/components/EmployeeAdvanceBalance.vue
+++ b/frontend/src/components/EmployeeAdvanceBalance.vue
@@ -18,7 +18,7 @@
>
- Request an Advance
+ {{ __("Request an Advance") }}
diff --git a/frontend/src/components/EmployeeAdvanceItem.vue b/frontend/src/components/EmployeeAdvanceItem.vue
index 0cc3b529d9..309d0aeaea 100644
--- a/frontend/src/components/EmployeeAdvanceItem.vue
+++ b/frontend/src/components/EmployeeAdvanceItem.vue
@@ -8,17 +8,18 @@
- {{ `${currency} ${props.doc.balance_amount} /` }}
+ {{ formatCurrency(props.doc.balance_amount, props.doc.currency) }}
+ /
- {{ `${currency} ${props.doc.paid_amount}` }}
+ {{ formatCurrency(props.doc.paid_amount, props.doc.currency) }}
- {{ `${currency} ${props.doc.advance_amount}` }}
+ {{ formatCurrency(props.doc.advance_amount, props.doc.currency) }}
- {{ props.doc.purpose }}
+ {{ __(props.doc.purpose) }}
·
@@ -28,7 +29,7 @@
-
+
@@ -38,10 +39,9 @@
import { FeatherIcon, Badge } from "frappe-ui"
import { computed, inject } from "vue"
-import { getCurrencySymbol } from "@/data/currencies"
-
import ListItem from "@/components/ListItem.vue"
import EmployeeAdvanceIcon from "@/components/icons/EmployeeAdvanceIcon.vue"
+import { formatCurrency } from "@/utils/formatters";
const dayjs = inject("$dayjs")
const props = defineProps({
@@ -66,8 +66,6 @@ const colorMap = {
"Partly Claimed and Returned": "orange",
}
-const currency = computed(() => getCurrencySymbol(props.doc.currency))
-
const postingDate = computed(() => {
return dayjs(props.doc.posting_date).format("D MMM")
})
diff --git a/frontend/src/components/ExpenseAdvancesTable.vue b/frontend/src/components/ExpenseAdvancesTable.vue
index 06c17da7f7..5babbaba80 100644
--- a/frontend/src/components/ExpenseAdvancesTable.vue
+++ b/frontend/src/components/ExpenseAdvancesTable.vue
@@ -1,7 +1,7 @@
- Settle against Advances
+ {{ __("Settle against Advances") }}
@@ -32,8 +32,10 @@
- Unclaimed Amount:
- {{ formatCurrency(advance.unclaimed_amount, currency) }}
+ {{ __("{0}: {1}", [
+ __("Unclaimed Amount"),
+ formatCurrency(advance.unclaimed_amount, currency),
+ ]) }}
@@ -58,7 +60,7 @@