i18n: wrap UI strings with __() (components/pages/modals)

This commit is contained in:
Youssef
2025-08-09 18:56:47 -04:00
parent 9a77b716a1
commit 718657f493
14 changed files with 53 additions and 53 deletions

View File

@@ -208,12 +208,12 @@ const canAddAssessments = () => {
const getAssessmentColumns = () => { const getAssessmentColumns = () => {
let columns = [ let columns = [
{ {
label: 'Assessment', label: __('Assessment'),
key: 'title', key: 'title',
width: '25rem', width: '25rem',
}, },
{ {
label: 'Type', label: __('Type'),
key: 'assessment_type', key: 'assessment_type',
width: '15rem', width: '15rem',
}, },
@@ -221,7 +221,7 @@ const getAssessmentColumns = () => {
if (!user.data?.is_moderator) { if (!user.data?.is_moderator) {
columns.push({ columns.push({
label: 'Status/Percentage', label: __('Status/Percentage'),
key: 'status', key: 'status',
align: 'left', align: 'left',
width: '10rem', width: '10rem',

View File

@@ -453,9 +453,9 @@ const canModifyAssignment = computed(() => {
const submissionStatusOptions = computed(() => { const submissionStatusOptions = computed(() => {
return [ return [
{ label: 'Not Graded', value: 'Not Graded' }, { label: __('Not Graded'), value: 'Not Graded' },
{ label: 'Pass', value: 'Pass' }, { label: __('Pass'), value: 'Pass' },
{ label: 'Fail', value: 'Fail' }, { label: __('Fail'), value: 'Fail' },
] ]
}) })

View File

@@ -116,17 +116,17 @@ const openCourseModal = () => {
const getCoursesColumns = () => { const getCoursesColumns = () => {
return [ return [
{ {
label: 'Title', label: __('Title'),
key: 'title', key: 'title',
width: 2, width: 2,
}, },
{ {
label: 'Lessons', label: __('Lessons'),
key: 'lessons', key: 'lessons',
align: 'right', align: 'right',
}, },
{ {
label: 'Enrollments', label: __('Enrollments'),
align: 'right', align: 'right',
key: 'enrollments', key: 'enrollments',
}, },

View File

@@ -231,19 +231,19 @@ const students = createResource({
const getStudentColumns = () => { const getStudentColumns = () => {
let columns = [ let columns = [
{ {
label: 'Full Name', label: __('Full Name'),
key: 'full_name', key: 'full_name',
width: '20rem', width: '20rem',
icon: 'user', icon: 'user',
}, },
{ {
label: 'Progress', label: __('Progress'),
key: 'progress', key: 'progress',
width: '15rem', width: '15rem',
icon: 'activity', icon: 'activity',
}, },
{ {
label: 'Last Active', label: __('Last Active'),
key: 'last_active', key: 'last_active',
width: '10rem', width: '10rem',
align: 'center', align: 'center',

View File

@@ -120,7 +120,7 @@
v-if="groups.length == 0" v-if="groups.length == 0"
class="mt-1.5 rounded-md px-2.5 py-1.5 text-base text-ink-gray-5" class="mt-1.5 rounded-md px-2.5 py-1.5 text-base text-ink-gray-5"
> >
No results found {{ __('No results found') }}
</li> </li>
</ComboboxOptions> </ComboboxOptions>
<div v-if="slots.footer" class="border-t p-1.5 pb-0.5"> <div v-if="slots.footer" class="border-t p-1.5 pb-0.5">

View File

@@ -32,13 +32,13 @@
" "
:options="[ :options="[
{ {
label: 'Edit', label: __('Edit'),
onClick() { onClick() {
reply.editable = true reply.editable = true
}, },
}, },
{ {
label: 'Delete', label: __('Delete'),
onClick() { onClick() {
deleteReply(reply) deleteReply(reply)
}, },

View File

@@ -97,9 +97,9 @@ const addAssessment = (close) => {
const assessmentTypes = computed(() => { const assessmentTypes = computed(() => {
return [ return [
{ label: 'Quiz', value: 'LMS Quiz' }, { label: __('Quiz'), value: 'LMS Quiz' },
{ label: 'Assignment', value: 'LMS Assignment' }, { label: __('Assignment'), value: 'LMS Assignment' },
{ label: 'Programming Exercise', value: 'LMS Programming Exercise' }, { label: __('Programming Exercise'), value: 'LMS Programming Exercise' },
] ]
}) })
</script> </script>

View File

@@ -144,11 +144,11 @@ const saveAssignment = () => {
const assignmentOptions = computed(() => { const assignmentOptions = computed(() => {
return [ return [
{ label: 'PDF', value: 'PDF' }, { label: __('PDF'), value: 'PDF' },
{ label: 'Image', value: 'Image' }, { label: __('Image'), value: 'Image' },
{ label: 'Document', value: 'Document' }, { label: __('Document'), value: 'Document' },
{ label: 'Text', value: 'Text' }, { label: __('Text'), value: 'Text' },
{ label: 'URL', value: 'URL' }, { label: __('URL'), value: 'URL' },
] ]
}) })
</script> </script>

View File

@@ -139,15 +139,15 @@ const getTimezoneOptions = () => {
const getRecordingOptions = () => { const getRecordingOptions = () => {
return [ return [
{ {
label: 'No Recording', label: __('No Recording'),
value: 'No Recording', value: 'No Recording',
}, },
{ {
label: 'Local', label: __('Local'),
value: 'Local', value: 'Local',
}, },
{ {
label: 'Cloud', label: __('Cloud'),
value: 'Cloud', value: 'Cloud',
}, },
] ]

View File

@@ -665,25 +665,25 @@ const markLessonProgress = () => {
const getSubmissionColumns = () => { const getSubmissionColumns = () => {
return [ return [
{ {
label: 'No.', label: __('No.'),
key: 'idx', key: 'idx',
}, },
{ {
label: 'Date', label: __('Date'),
key: 'creation', key: 'creation',
}, },
{ {
label: 'Score', label: __('Score'),
key: 'score', key: 'score',
align: 'center', align: 'center',
}, },
{ {
label: 'Score out of', label: __('Score out of'),
key: 'score_out_of', key: 'score_out_of',
align: 'center', align: 'center',
}, },
{ {
label: 'Percentage', label: __('Percentage'),
key: 'percentage', key: 'percentage',
align: 'center', align: 'center',
}, },

View File

@@ -33,7 +33,7 @@
> >
{{ branding.data?.app_name }} {{ branding.data?.app_name }}
</span> </span>
<span v-else> Learning </span> <span v-else> {{ __('Learning') }} </span>
</div> </div>
<div <div
v-if="userResource.data" v-if="userResource.data"
@@ -130,7 +130,7 @@ const userDropdownOptions = computed(() => {
items: [ items: [
{ {
icon: User, icon: User,
label: 'My Profile', label: __('My Profile'),
onClick: () => { onClick: () => {
router.push(`/user/${userResource.data?.username}`) router.push(`/user/${userResource.data?.username}`)
}, },
@@ -140,7 +140,7 @@ const userDropdownOptions = computed(() => {
}, },
{ {
icon: theme.value === 'light' ? Moon : Sun, icon: theme.value === 'light' ? Moon : Sun,
label: 'Toggle Theme', label: __('Toggle Theme'),
onClick: () => { onClick: () => {
toggleTheme() toggleTheme()
}, },
@@ -158,7 +158,7 @@ const userDropdownOptions = computed(() => {
}, },
{ {
icon: Settings, icon: Settings,
label: 'Settings', label: __('Settings'),
onClick: () => { onClick: () => {
settingsStore.isSettingsOpen = true settingsStore.isSettingsOpen = true
}, },
@@ -168,7 +168,7 @@ const userDropdownOptions = computed(() => {
}, },
{ {
icon: FrappeCloudIcon, icon: FrappeCloudIcon,
label: 'Login to Frappe Cloud', label: __('Login to Frappe Cloud'),
onClick: () => { onClick: () => {
$dialog({ $dialog({
title: __('Login to Frappe Cloud?'), title: __('Login to Frappe Cloud?'),
@@ -196,7 +196,7 @@ const userDropdownOptions = computed(() => {
}, },
{ {
icon: LogOut, icon: LogOut,
label: 'Log out', label: __('Log out'),
onClick: () => { onClick: () => {
logout.submit().then(() => { logout.submit().then(() => {
isLoggedIn = false isLoggedIn = false
@@ -208,7 +208,7 @@ const userDropdownOptions = computed(() => {
}, },
{ {
icon: LogIn, icon: LogIn,
label: 'Log in', label: __('Log in'),
onClick: () => { onClick: () => {
window.location.href = '/login' window.location.href = '/login'
}, },

View File

@@ -166,23 +166,23 @@ const reloadSubmissions = () => {
const submissionColumns = computed(() => { const submissionColumns = computed(() => {
return [ return [
{ {
label: 'Member', label: __('Member'),
key: 'member_name', key: 'member_name',
width: 1, width: 1,
}, },
{ {
label: 'Assignment', label: __('Assignment'),
key: 'assignment_title', key: 'assignment_title',
width: 2, width: 2,
}, },
{ {
label: 'Submitted', label: __('Submitted'),
key: 'creation', key: 'creation',
width: 1, width: 1,
align: 'left', align: 'left',
}, },
{ {
label: 'Status', label: __('Status'),
key: 'status', key: 'status',
width: 1, width: 1,
align: 'center', align: 'center',
@@ -193,9 +193,9 @@ const submissionColumns = computed(() => {
const statusOptions = computed(() => { const statusOptions = computed(() => {
return [ return [
{ label: '', value: '' }, { label: '', value: '' },
{ label: 'Pass', value: 'Pass' }, { label: __('Pass'), value: 'Pass' },
{ label: 'Fail', value: 'Fail' }, { label: __('Fail'), value: 'Fail' },
{ label: 'Not Graded', value: 'Not Graded' }, { label: __('Not Graded'), value: 'Not Graded' },
] ]
}) })
@@ -212,7 +212,7 @@ const getStatusTheme = (status) => {
const breadcrumbs = computed(() => { const breadcrumbs = computed(() => {
return [ return [
{ {
label: 'Assignment Submissions', label: __('Assignment Submissions'),
}, },
] ]
}) })

View File

@@ -256,34 +256,34 @@ const readOnlyMode = window.read_only_mode
const tabs = computed(() => { const tabs = computed(() => {
let batchTabs = [] let batchTabs = []
batchTabs.push({ batchTabs.push({
label: __('Dashboard'), label: 'Dashboard',
icon: LayoutDashboard, icon: LayoutDashboard,
}) })
batchTabs.push({ batchTabs.push({
label: __('Courses'), label: 'Courses',
icon: BookOpen, icon: BookOpen,
}) })
batchTabs.push({ batchTabs.push({
label: __('Classes'), label: 'Classes',
icon: Laptop, icon: Laptop,
}) })
if (user.data?.is_moderator) { if (user.data?.is_moderator) {
batchTabs.push({ batchTabs.push({
label: __('Assessments'), label: 'Assessments',
icon: BookOpenCheck, icon: BookOpenCheck,
}) })
} }
batchTabs.push({ batchTabs.push({
label: __('Announcements'), label: 'Announcements',
icon: Mail, icon: Mail,
}) })
batchTabs.push({ batchTabs.push({
label: __('Discussions'), label: 'Discussions',
icon: MessageCircle, icon: MessageCircle,
}) })
return batchTabs return batchTabs

View File

@@ -211,7 +211,7 @@ const getTabButtons = () => {
const breadcrumbs = computed(() => { const breadcrumbs = computed(() => {
let crumbs = [ let crumbs = [
{ {
label: 'People', label: __('People'),
}, },
{ {
label: profile.data?.full_name, label: profile.data?.full_name,