@asd20/ui-next 2.31.8 → 2.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ # [2.32.0](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.31.8...ui-next-v2.32.0) (2026-10-12)
4
+
5
+
6
+ ### Features
7
+
8
+ * share handbook translations with multilingual PDF downloads ([a034f23](https://github.com/academydistrict20/asd20-ui-next/commit/a034f237a2021e92376a0ff511f1380286221266))
9
+
3
10
  ## [2.31.8](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.31.7...ui-next-v2.31.8) (2026-10-12)
4
11
 
5
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asd20/ui-next",
3
- "version": "2.31.8",
3
+ "version": "2.32.0",
4
4
  "private": false,
5
5
  "description": "ASD20 UI component library for Vue 3.",
6
6
  "license": "MIT",
@@ -2,6 +2,8 @@
2
2
  <div
3
3
  class="asd20-handbook-document"
4
4
  :data-asd20-document-root="documentId"
5
+ :lang="languageCode"
6
+ :dir="languageDirection"
5
7
  >
6
8
  <header class="asd20-handbook-document__cover">
7
9
  <div class="asd20-handbook-document__cover-heading">
@@ -13,10 +15,17 @@
13
15
  v-if="organization.logoImageUrl"
14
16
  class="asd20-handbook-document__logo"
15
17
  :src="organization.logoImageUrl"
16
- :alt="`${coverTitle.organizationTitle} logo`"
18
+ :alt="`${coverTitle.organizationTitle} ${documentLabels.logo || 'logo'}`"
17
19
  />
18
20
  </div>
19
21
  <div class="asd20-handbook-document__cover-body">
22
+ <p
23
+ v-if="languageCode !== 'en'"
24
+ class="asd20-handbook-document__translation-notice"
25
+ >
26
+ {{ documentLabels.automatedTranslation }}
27
+ {{ documentLabels.onlineAuthority }}
28
+ </p>
20
29
  <asd20-messaging
21
30
  :body-content="messages[0]?.bodyContent || ''"
22
31
  :body-json="messages[0]?.bodyJson || ''"
@@ -24,7 +33,10 @@
24
33
  />
25
34
  </div>
26
35
  </header>
27
- <asd20-print-contents :headings="document.headings" />
36
+ <asd20-print-contents
37
+ :headings="document.headings"
38
+ :label="documentLabels.contents || 'Contents'"
39
+ />
28
40
  <main>
29
41
  <article
30
42
  v-for="entry in document.entries"
@@ -75,11 +87,14 @@ export default {
75
87
  printMetadata: { type: Object, default: () => ({}) },
76
88
  includeIntroductionBody: { type: Boolean, default: true },
77
89
  schoolYear: { type: String, default: '' },
90
+ languageCode: { type: String, default: 'en' },
91
+ languageDirection: { type: String, default: 'ltr' },
92
+ documentLabels: { type: Object, default: () => ({}) },
78
93
  },
79
94
  computed: {
80
95
  document() { return buildHandbookDocument(this.$props) },
81
96
  coverTitle() {
82
- return handbookCoverTitle(this.organization, this.document.introduction.heading || this.title, this.printMetadata.generatedAt || new Date().toISOString())
97
+ return handbookCoverTitle(this.organization, this.document.introduction.heading || this.title, this.printMetadata.generatedAt || new Date().toISOString(), this.documentLabels)
83
98
  },
84
99
  },
85
100
  }
@@ -34,6 +34,8 @@
34
34
  :organization-options="organizationOptions"
35
35
  :breadcrumb-links="breadcrumbLinks"
36
36
  :language-code="languageCode"
37
+ :lang="contentLanguageCode || languageCode || 'en'"
38
+ :dir="contentDirection"
37
39
  @update:languageCode="$emit('update:languageCode', $event)"
38
40
  >
39
41
  <template #calls-to-action="{ size }">
@@ -95,7 +97,10 @@
95
97
  <p>
96
98
  Our handbooks are presented in English. You can use the translate button at the top of the page to view the handbook in your preferred language.
97
99
  </p>
98
- <p>
100
+ <p v-if="translatedPdfAvailable">
101
+ When the handbook has finished translating, Download PDF provides a version in that language.
102
+ </p>
103
+ <p v-else>
99
104
  <strong>Coming Soon:</strong> if you are viewing the handbook in a language other than English, and click Download PDF, you'll get a handbook version in that selected language.
100
105
  </p>
101
106
  <p>
@@ -123,6 +128,8 @@
123
128
 
124
129
  <main
125
130
  id="handbook-content"
131
+ :lang="contentLanguageCode || languageCode || 'en'"
132
+ :dir="contentDirection"
126
133
  class="asd20-template-handbook__layout"
127
134
  tabindex="-1"
128
135
  >
@@ -299,6 +306,9 @@ export default {
299
306
  },
300
307
  props: {
301
308
  documentPrint: { type: Boolean, default: false },
309
+ contentLanguageCode: { type: String, default: '' },
310
+ contentDirection: { type: String, default: 'ltr' },
311
+ translatedPdfAvailable: { type: Boolean, default: false },
302
312
  printMetadata: { type: Object, default: () => ({}) },
303
313
  publicationDocumentId: { type: String, default: 'handbook' },
304
314
  publicationDocumentUrl: { type: String, default: '' },
@@ -30,35 +30,38 @@ export function isDistrictHandbook(organization = {}) {
30
30
  )
31
31
  }
32
32
 
33
- function handbookTitles(organization, firstMessageTitle) {
33
+ function handbookTitles(organization, firstMessageTitle, labels = {}) {
34
34
  const organizationTitle = isDistrictHandbook(organization)
35
35
  ? 'Academy District 20'
36
36
  : organization.title || organization.name || 'School'
37
37
  const handbookTitle = isDistrictHandbook(organization)
38
- ? firstMessageTitle || 'School Handbook'
39
- : 'School Handbook'
38
+ ? firstMessageTitle || labels.schoolHandbook || 'School Handbook'
39
+ : labels.schoolHandbook || 'School Handbook'
40
40
  return { organizationTitle, handbookTitle }
41
41
  }
42
42
 
43
43
  export function handbookCoverTitle(
44
44
  organization = {},
45
45
  firstMessageTitle = '',
46
- generatedAt
46
+ generatedAt,
47
+ labels = {}
47
48
  ) {
48
- const { organizationTitle, handbookTitle } = handbookTitles(organization, firstMessageTitle)
49
+ const { organizationTitle, handbookTitle } = handbookTitles(organization, firstMessageTitle, labels)
49
50
  return { organizationTitle, handbookTitle: `${handbookSchoolYear(generatedAt)} ${handbookTitle}` }
50
51
  }
51
52
 
52
- export function handbookFooterTitle(organization = {}, firstMessageTitle = '') {
53
- const { organizationTitle, handbookTitle } = handbookTitles(organization, firstMessageTitle)
53
+ export function handbookFooterTitle(organization = {}, firstMessageTitle = '', labels = {}) {
54
+ const { organizationTitle, handbookTitle } = handbookTitles(organization, firstMessageTitle, labels)
54
55
  return `${organizationTitle} ${handbookTitle}`
55
56
  }
56
57
 
57
58
  export function handbookDownloadFilename(
58
59
  organization = {},
59
60
  generatedAt,
60
- firstMessageTitle = ''
61
+ firstMessageTitle = '',
62
+ language = 'en'
61
63
  ) {
64
+ if (!/^[a-z]{2,3}(?:-[A-Za-z]{2,8})?$/.test(language)) throw new Error('Invalid handbook language.')
62
65
  const safe = (value) =>
63
66
  String(value || '')
64
67
  .replace(/[^a-zA-Z0-9_. ()-]/g, '')
@@ -69,5 +72,5 @@ export function handbookDownloadFilename(
69
72
  const title = isDistrictHandbook(organization)
70
73
  ? `ASD20 ${safe(firstMessageTitle) || 'School Handbook'}`
71
74
  : `${abbreviation ? abbreviation + ' ' : ''}School Handbook`
72
- return `${title} - ${year}-${month}-${day}.pdf`
75
+ return `${title}${language === 'en' ? '' : ` (${language})`} - ${year}-${month}-${day}.pdf`
73
76
  }