cocina_display 1.11.0 → 1.12.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.
- checksums.yaml +4 -4
- data/config/locales/en.yml +3 -9
- data/lib/cocina_display/concerns/titles.rb +3 -2
- data/lib/cocina_display/identifier.rb +7 -1
- data/lib/cocina_display/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 225982c5b9748bc337ec552e64becdb2ad78c1e6c2bb8ac8e9c77064140bf69b
|
|
4
|
+
data.tar.gz: 64e7a2349e5b7e3cd0deca4675423ab135cf270d228ff067b7872637a2b79f48
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6ebdbca3032b4b8f54dd63d7f62ee9fea98a8380de0981d5acaa335bec5093cb0f170c1237fee7388461ca2d6786da35b58f90dfdf9017ae5d3eb96f33c11cf3
|
|
7
|
+
data.tar.gz: 736d1e098f29f20a4a480c99d91642f664d62e4c25aa449505e5421047d7d84d2f9ba56741d8a8c33755832718d9c092fb77b867cd64b3b483a6d359d2022fcb
|
data/config/locales/en.yml
CHANGED
|
@@ -26,26 +26,20 @@ en:
|
|
|
26
26
|
note: Note
|
|
27
27
|
resource_type: Resource Type
|
|
28
28
|
identifier:
|
|
29
|
-
doi: DOI
|
|
30
|
-
handle: Handle
|
|
31
29
|
identifier: Identifier
|
|
30
|
+
local: Local identifier
|
|
31
|
+
other: Other identifier
|
|
32
|
+
doi: DOI
|
|
32
33
|
isbn: ISBN
|
|
33
34
|
ismn: ISMN
|
|
34
35
|
isrc: ISRC
|
|
35
36
|
issn: ISSN
|
|
36
37
|
issn_l: ISSN
|
|
37
|
-
issue_number: Issue number
|
|
38
|
-
language: Language
|
|
39
38
|
lccn: LCCN
|
|
40
|
-
matrix_number: Matrix number
|
|
41
|
-
music_plate: Music plate
|
|
42
|
-
music_publisher: Music publisher
|
|
43
39
|
oclc: OCLC
|
|
44
40
|
orcid: ORCID
|
|
45
41
|
sici: SICI
|
|
46
|
-
stock_number: Stock number
|
|
47
42
|
upc: UPC
|
|
48
|
-
videorecording_identifier: Videorecording identifier
|
|
49
43
|
language: Language
|
|
50
44
|
license: License
|
|
51
45
|
note:
|
|
@@ -44,8 +44,9 @@ module CocinaDisplay
|
|
|
44
44
|
# All {Title} objects, grouped by their label for display.
|
|
45
45
|
# @note All primary titles are included under "Title", not just the first.
|
|
46
46
|
# @return [Array<DisplayData>]
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
# @param exclude_primary [Boolean] Exclude primary titles. Defaults to false.
|
|
48
|
+
def title_display_data(exclude_primary: false)
|
|
49
|
+
DisplayData.from_objects(exclude_primary ? secondary_titles : all_titles)
|
|
49
50
|
end
|
|
50
51
|
|
|
51
52
|
# The first title marked primary, or the first without a type.
|
|
@@ -80,7 +80,7 @@ module CocinaDisplay
|
|
|
80
80
|
# @return [String]
|
|
81
81
|
def label
|
|
82
82
|
cocina["displayLabel"].presence ||
|
|
83
|
-
I18n.t(label_key, default:
|
|
83
|
+
I18n.t(label_key, default: default_label, scope: "cocina_display.field_label.identifier")
|
|
84
84
|
end
|
|
85
85
|
|
|
86
86
|
# Check if the identifier is a DOI.
|
|
@@ -92,6 +92,12 @@ module CocinaDisplay
|
|
|
92
92
|
|
|
93
93
|
private
|
|
94
94
|
|
|
95
|
+
# Default label for an identifier, based on its type.
|
|
96
|
+
# @return [String]
|
|
97
|
+
def default_label
|
|
98
|
+
type&.capitalize || :identifier
|
|
99
|
+
end
|
|
100
|
+
|
|
95
101
|
# Key used for i18n lookup of the label, based on the type.
|
|
96
102
|
# @return [String, nil]
|
|
97
103
|
def label_key
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cocina_display
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.12.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nick Budak
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-03-
|
|
10
|
+
date: 2026-03-04 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: janeway-jsonpath
|