psytools 0.3.2 → 0.5.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.
Files changed (227) hide show
  1. package/README.md +54 -17
  2. package/SOURCES.md +5 -1
  3. package/dist/cjs/assessment.d.ts +6 -4
  4. package/dist/cjs/assessment.js +10 -6
  5. package/dist/cjs/errors.d.ts +4 -2
  6. package/dist/cjs/evaluation.d.ts +10 -5
  7. package/dist/cjs/evaluation.js +68 -31
  8. package/dist/cjs/i18n.d.ts +22 -2
  9. package/dist/cjs/i18n.js +138 -2
  10. package/dist/cjs/index.d.ts +6 -2
  11. package/dist/cjs/index.js +20 -15
  12. package/dist/cjs/inventories/aq10.js +5 -35
  13. package/dist/cjs/inventories/asrs6.js +6 -28
  14. package/dist/cjs/inventories/audit.js +39 -56
  15. package/dist/cjs/inventories/common.js +0 -10
  16. package/dist/cjs/inventories/dass21.js +19 -75
  17. package/dist/cjs/inventories/gad7.js +5 -23
  18. package/dist/cjs/inventories/index.d.ts +11 -2
  19. package/dist/cjs/inventories/index.js +22 -3
  20. package/dist/cjs/inventories/mini-ipip.js +25 -59
  21. package/dist/cjs/inventories/phq9.js +6 -30
  22. package/dist/cjs/inventories/who5.js +5 -31
  23. package/dist/cjs/locales/de/aq10.d.ts +4 -0
  24. package/dist/cjs/locales/de/aq10.js +53 -0
  25. package/dist/cjs/locales/de/asrs6.d.ts +4 -0
  26. package/dist/cjs/locales/de/asrs6.js +42 -0
  27. package/dist/cjs/locales/de/audit.d.ts +4 -0
  28. package/dist/cjs/locales/de/audit.js +80 -0
  29. package/dist/cjs/locales/de/dass21.d.ts +4 -0
  30. package/dist/cjs/locales/de/dass21.js +114 -0
  31. package/dist/cjs/locales/de/gad7.d.ts +4 -0
  32. package/dist/cjs/locales/de/gad7.js +46 -0
  33. package/dist/cjs/locales/de/mini-ipip.d.ts +4 -0
  34. package/dist/cjs/locales/de/mini-ipip.js +97 -0
  35. package/dist/cjs/locales/de/phq9.d.ts +4 -0
  36. package/dist/cjs/locales/de/phq9.js +56 -0
  37. package/dist/cjs/locales/de/who5.d.ts +4 -0
  38. package/dist/cjs/locales/de/who5.js +41 -0
  39. package/dist/cjs/locales/es/aq10.d.ts +4 -0
  40. package/dist/cjs/locales/es/aq10.js +53 -0
  41. package/dist/cjs/locales/es/asrs6.d.ts +4 -0
  42. package/dist/cjs/locales/es/asrs6.js +42 -0
  43. package/dist/cjs/locales/es/audit.d.ts +4 -0
  44. package/dist/cjs/locales/es/audit.js +80 -0
  45. package/dist/cjs/locales/es/dass21.d.ts +4 -0
  46. package/dist/cjs/locales/es/dass21.js +114 -0
  47. package/dist/cjs/locales/es/gad7.d.ts +4 -0
  48. package/dist/cjs/locales/es/gad7.js +46 -0
  49. package/dist/cjs/locales/es/mini-ipip.d.ts +4 -0
  50. package/dist/cjs/locales/es/mini-ipip.js +97 -0
  51. package/dist/cjs/locales/es/phq9.d.ts +4 -0
  52. package/dist/cjs/locales/es/phq9.js +56 -0
  53. package/dist/cjs/locales/es/who5.d.ts +4 -0
  54. package/dist/cjs/locales/es/who5.js +41 -0
  55. package/dist/cjs/locales/index.d.ts +12 -0
  56. package/dist/cjs/locales/index.js +63 -0
  57. package/dist/cjs/locales/tr/aq10.d.ts +4 -0
  58. package/dist/cjs/locales/tr/aq10.js +53 -0
  59. package/dist/cjs/locales/tr/asrs6.d.ts +4 -0
  60. package/dist/cjs/locales/tr/asrs6.js +42 -0
  61. package/dist/cjs/locales/tr/audit.d.ts +4 -0
  62. package/dist/cjs/locales/tr/audit.js +80 -0
  63. package/dist/cjs/locales/tr/dass21.d.ts +4 -0
  64. package/dist/cjs/locales/tr/dass21.js +114 -0
  65. package/dist/cjs/locales/tr/gad7.d.ts +4 -0
  66. package/dist/cjs/locales/tr/gad7.js +46 -0
  67. package/dist/cjs/locales/tr/mini-ipip.d.ts +4 -0
  68. package/dist/cjs/locales/tr/mini-ipip.js +97 -0
  69. package/dist/cjs/locales/tr/phq9.d.ts +4 -0
  70. package/dist/cjs/locales/tr/phq9.js +56 -0
  71. package/dist/cjs/locales/tr/who5.d.ts +4 -0
  72. package/dist/cjs/locales/tr/who5.js +41 -0
  73. package/dist/cjs/locales/zh/aq10.d.ts +4 -0
  74. package/dist/cjs/locales/zh/aq10.js +53 -0
  75. package/dist/cjs/locales/zh/asrs6.d.ts +4 -0
  76. package/dist/cjs/locales/zh/asrs6.js +42 -0
  77. package/dist/cjs/locales/zh/audit.d.ts +4 -0
  78. package/dist/cjs/locales/zh/audit.js +80 -0
  79. package/dist/cjs/locales/zh/dass21.d.ts +4 -0
  80. package/dist/cjs/locales/zh/dass21.js +114 -0
  81. package/dist/cjs/locales/zh/gad7.d.ts +4 -0
  82. package/dist/cjs/locales/zh/gad7.js +46 -0
  83. package/dist/cjs/locales/zh/mini-ipip.d.ts +4 -0
  84. package/dist/cjs/locales/zh/mini-ipip.js +97 -0
  85. package/dist/cjs/locales/zh/phq9.d.ts +4 -0
  86. package/dist/cjs/locales/zh/phq9.js +56 -0
  87. package/dist/cjs/locales/zh/who5.d.ts +4 -0
  88. package/dist/cjs/locales/zh/who5.js +41 -0
  89. package/dist/cjs/types.d.ts +60 -1
  90. package/dist/esm/assessment.d.ts +6 -4
  91. package/dist/esm/assessment.js +11 -7
  92. package/dist/esm/errors.d.ts +4 -2
  93. package/dist/esm/evaluation.d.ts +10 -5
  94. package/dist/esm/evaluation.js +68 -31
  95. package/dist/esm/i18n.d.ts +22 -2
  96. package/dist/esm/i18n.js +135 -1
  97. package/dist/esm/index.d.ts +6 -2
  98. package/dist/esm/index.js +2 -1
  99. package/dist/esm/inventories/aq10.js +5 -35
  100. package/dist/esm/inventories/asrs6.js +6 -28
  101. package/dist/esm/inventories/audit.js +39 -56
  102. package/dist/esm/inventories/common.js +0 -10
  103. package/dist/esm/inventories/dass21.js +19 -75
  104. package/dist/esm/inventories/gad7.js +5 -23
  105. package/dist/esm/inventories/index.d.ts +11 -2
  106. package/dist/esm/inventories/index.js +22 -3
  107. package/dist/esm/inventories/mini-ipip.js +25 -59
  108. package/dist/esm/inventories/phq9.js +6 -30
  109. package/dist/esm/inventories/who5.js +5 -31
  110. package/dist/esm/locales/de/aq10.d.ts +4 -0
  111. package/dist/esm/locales/de/aq10.js +51 -0
  112. package/dist/esm/locales/de/asrs6.d.ts +4 -0
  113. package/dist/esm/locales/de/asrs6.js +40 -0
  114. package/dist/esm/locales/de/audit.d.ts +4 -0
  115. package/dist/esm/locales/de/audit.js +78 -0
  116. package/dist/esm/locales/de/dass21.d.ts +4 -0
  117. package/dist/esm/locales/de/dass21.js +112 -0
  118. package/dist/esm/locales/de/gad7.d.ts +4 -0
  119. package/dist/esm/locales/de/gad7.js +44 -0
  120. package/dist/esm/locales/de/mini-ipip.d.ts +4 -0
  121. package/dist/esm/locales/de/mini-ipip.js +95 -0
  122. package/dist/esm/locales/de/phq9.d.ts +4 -0
  123. package/dist/esm/locales/de/phq9.js +54 -0
  124. package/dist/esm/locales/de/who5.d.ts +4 -0
  125. package/dist/esm/locales/de/who5.js +39 -0
  126. package/dist/esm/locales/es/aq10.d.ts +4 -0
  127. package/dist/esm/locales/es/aq10.js +51 -0
  128. package/dist/esm/locales/es/asrs6.d.ts +4 -0
  129. package/dist/esm/locales/es/asrs6.js +40 -0
  130. package/dist/esm/locales/es/audit.d.ts +4 -0
  131. package/dist/esm/locales/es/audit.js +78 -0
  132. package/dist/esm/locales/es/dass21.d.ts +4 -0
  133. package/dist/esm/locales/es/dass21.js +112 -0
  134. package/dist/esm/locales/es/gad7.d.ts +4 -0
  135. package/dist/esm/locales/es/gad7.js +44 -0
  136. package/dist/esm/locales/es/mini-ipip.d.ts +4 -0
  137. package/dist/esm/locales/es/mini-ipip.js +95 -0
  138. package/dist/esm/locales/es/phq9.d.ts +4 -0
  139. package/dist/esm/locales/es/phq9.js +54 -0
  140. package/dist/esm/locales/es/who5.d.ts +4 -0
  141. package/dist/esm/locales/es/who5.js +39 -0
  142. package/dist/esm/locales/index.d.ts +12 -0
  143. package/dist/esm/locales/index.js +59 -0
  144. package/dist/esm/locales/tr/aq10.d.ts +4 -0
  145. package/dist/esm/locales/tr/aq10.js +51 -0
  146. package/dist/esm/locales/tr/asrs6.d.ts +4 -0
  147. package/dist/esm/locales/tr/asrs6.js +40 -0
  148. package/dist/esm/locales/tr/audit.d.ts +4 -0
  149. package/dist/esm/locales/tr/audit.js +78 -0
  150. package/dist/esm/locales/tr/dass21.d.ts +4 -0
  151. package/dist/esm/locales/tr/dass21.js +112 -0
  152. package/dist/esm/locales/tr/gad7.d.ts +4 -0
  153. package/dist/esm/locales/tr/gad7.js +44 -0
  154. package/dist/esm/locales/tr/mini-ipip.d.ts +4 -0
  155. package/dist/esm/locales/tr/mini-ipip.js +95 -0
  156. package/dist/esm/locales/tr/phq9.d.ts +4 -0
  157. package/dist/esm/locales/tr/phq9.js +54 -0
  158. package/dist/esm/locales/tr/who5.d.ts +4 -0
  159. package/dist/esm/locales/tr/who5.js +39 -0
  160. package/dist/esm/locales/zh/aq10.d.ts +4 -0
  161. package/dist/esm/locales/zh/aq10.js +51 -0
  162. package/dist/esm/locales/zh/asrs6.d.ts +4 -0
  163. package/dist/esm/locales/zh/asrs6.js +40 -0
  164. package/dist/esm/locales/zh/audit.d.ts +4 -0
  165. package/dist/esm/locales/zh/audit.js +78 -0
  166. package/dist/esm/locales/zh/dass21.d.ts +4 -0
  167. package/dist/esm/locales/zh/dass21.js +112 -0
  168. package/dist/esm/locales/zh/gad7.d.ts +4 -0
  169. package/dist/esm/locales/zh/gad7.js +44 -0
  170. package/dist/esm/locales/zh/mini-ipip.d.ts +4 -0
  171. package/dist/esm/locales/zh/mini-ipip.js +95 -0
  172. package/dist/esm/locales/zh/phq9.d.ts +4 -0
  173. package/dist/esm/locales/zh/phq9.js +54 -0
  174. package/dist/esm/locales/zh/who5.d.ts +4 -0
  175. package/dist/esm/locales/zh/who5.js +39 -0
  176. package/dist/esm/types.d.ts +60 -1
  177. package/package.json +21 -1
  178. package/schema/assessment-definition.schema.json +15 -3
  179. package/src/assessment.ts +15 -9
  180. package/src/errors.ts +26 -2
  181. package/src/evaluation.ts +103 -30
  182. package/src/i18n.ts +177 -2
  183. package/src/index.ts +9 -1
  184. package/src/inventories/aq10.ts +5 -35
  185. package/src/inventories/asrs6.ts +6 -28
  186. package/src/inventories/audit.ts +39 -56
  187. package/src/inventories/common.ts +0 -10
  188. package/src/inventories/dass21.ts +19 -75
  189. package/src/inventories/gad7.ts +5 -23
  190. package/src/inventories/index.ts +27 -3
  191. package/src/inventories/mini-ipip.ts +25 -59
  192. package/src/inventories/phq9.ts +6 -30
  193. package/src/inventories/who5.ts +5 -31
  194. package/src/locales/de/aq10.ts +54 -0
  195. package/src/locales/de/asrs6.ts +43 -0
  196. package/src/locales/de/audit.ts +81 -0
  197. package/src/locales/de/dass21.ts +115 -0
  198. package/src/locales/de/gad7.ts +47 -0
  199. package/src/locales/de/mini-ipip.ts +98 -0
  200. package/src/locales/de/phq9.ts +57 -0
  201. package/src/locales/de/who5.ts +42 -0
  202. package/src/locales/es/aq10.ts +54 -0
  203. package/src/locales/es/asrs6.ts +43 -0
  204. package/src/locales/es/audit.ts +81 -0
  205. package/src/locales/es/dass21.ts +115 -0
  206. package/src/locales/es/gad7.ts +47 -0
  207. package/src/locales/es/mini-ipip.ts +98 -0
  208. package/src/locales/es/phq9.ts +57 -0
  209. package/src/locales/es/who5.ts +42 -0
  210. package/src/locales/index.ts +64 -0
  211. package/src/locales/tr/aq10.ts +54 -0
  212. package/src/locales/tr/asrs6.ts +43 -0
  213. package/src/locales/tr/audit.ts +81 -0
  214. package/src/locales/tr/dass21.ts +115 -0
  215. package/src/locales/tr/gad7.ts +47 -0
  216. package/src/locales/tr/mini-ipip.ts +98 -0
  217. package/src/locales/tr/phq9.ts +57 -0
  218. package/src/locales/tr/who5.ts +42 -0
  219. package/src/locales/zh/aq10.ts +54 -0
  220. package/src/locales/zh/asrs6.ts +43 -0
  221. package/src/locales/zh/audit.ts +81 -0
  222. package/src/locales/zh/dass21.ts +115 -0
  223. package/src/locales/zh/gad7.ts +47 -0
  224. package/src/locales/zh/mini-ipip.ts +98 -0
  225. package/src/locales/zh/phq9.ts +57 -0
  226. package/src/locales/zh/who5.ts +42 -0
  227. package/src/types.ts +63 -6
@@ -1,27 +1,27 @@
1
1
  import type { AssessmentDefinition, ScoreBand } from "../types.ts";
2
2
 
3
3
  const depressionBands: ScoreBand[] = [
4
- { id: "normal", min: 0, max: 9, label: { en: "Normal", tr: "Normal", de: "Normal" } },
5
- { id: "mild", min: 10, max: 13, label: { en: "Mild", tr: "Hafif", de: "Leicht" } },
6
- { id: "moderate", min: 14, max: 20, label: { en: "Moderate", tr: "Orta", de: "Moderat" } },
7
- { id: "severe", min: 21, max: 27, label: { en: "Severe", tr: "Şiddetli", de: "Schwer" } },
8
- { id: "extremely-severe", min: 28, max: 42, label: { en: "Extremely severe", tr: "Çok şiddetli", de: "Sehr schwer" } },
4
+ { id: "normal", min: 0, max: 9, label: { en: "Normal" } },
5
+ { id: "mild", min: 10, max: 13, label: { en: "Mild" } },
6
+ { id: "moderate", min: 14, max: 20, label: { en: "Moderate" } },
7
+ { id: "severe", min: 21, max: 27, label: { en: "Severe" } },
8
+ { id: "extremely-severe", min: 28, max: 42, label: { en: "Extremely severe" } },
9
9
  ];
10
10
 
11
11
  const anxietyBands: ScoreBand[] = [
12
- { id: "normal", min: 0, max: 7, label: { en: "Normal", tr: "Normal", de: "Normal" } },
13
- { id: "mild", min: 8, max: 9, label: { en: "Mild", tr: "Hafif", de: "Leicht" } },
14
- { id: "moderate", min: 10, max: 14, label: { en: "Moderate", tr: "Orta", de: "Moderat" } },
15
- { id: "severe", min: 15, max: 19, label: { en: "Severe", tr: "Şiddetli", de: "Schwer" } },
16
- { id: "extremely-severe", min: 20, max: 42, label: { en: "Extremely severe", tr: "Çok şiddetli", de: "Sehr schwer" } },
12
+ { id: "normal", min: 0, max: 7, label: { en: "Normal" } },
13
+ { id: "mild", min: 8, max: 9, label: { en: "Mild" } },
14
+ { id: "moderate", min: 10, max: 14, label: { en: "Moderate" } },
15
+ { id: "severe", min: 15, max: 19, label: { en: "Severe" } },
16
+ { id: "extremely-severe", min: 20, max: 42, label: { en: "Extremely severe" } },
17
17
  ];
18
18
 
19
19
  const stressBands: ScoreBand[] = [
20
- { id: "normal", min: 0, max: 14, label: { en: "Normal", tr: "Normal", de: "Normal" } },
21
- { id: "mild", min: 15, max: 18, label: { en: "Mild", tr: "Hafif", de: "Leicht" } },
22
- { id: "moderate", min: 19, max: 25, label: { en: "Moderate", tr: "Orta", de: "Moderat" } },
23
- { id: "severe", min: 26, max: 33, label: { en: "Severe", tr: "Şiddetli", de: "Schwer" } },
24
- { id: "extremely-severe", min: 34, max: 42, label: { en: "Extremely severe", tr: "Çok şiddetli", de: "Sehr schwer" } },
20
+ { id: "normal", min: 0, max: 14, label: { en: "Normal" } },
21
+ { id: "mild", min: 15, max: 18, label: { en: "Mild" } },
22
+ { id: "moderate", min: 19, max: 25, label: { en: "Moderate" } },
23
+ { id: "severe", min: 26, max: 33, label: { en: "Severe" } },
24
+ { id: "extremely-severe", min: 34, max: 42, label: { en: "Extremely severe" } },
25
25
  ];
26
26
 
27
27
  /**
@@ -38,18 +38,12 @@ export const dass21: AssessmentDefinition = {
38
38
  version: "1.0.0",
39
39
  title: {
40
40
  en: "Depression Anxiety Stress Scales (DASS-21)",
41
- tr: "Depresyon Anksiyete Stres Ölçeği (DASS-21)",
42
- de: "Depressions-Angst-Stress-Skalen (DASS-21)",
43
41
  },
44
42
  description: {
45
43
  en: "A 21-item self-report questionnaire measuring depression, anxiety, and stress over the past week.",
46
- tr: "Geçtiğimiz hafta boyunca depresyon, anksiyete ve stresi ölçen 21 maddelik bir öz bildirim ölçeği.",
47
- de: "Ein Selbstbeurteilungsfragebogen mit 21 Items zur Messung von Depression, Angst und Stress in der vergangenen Woche.",
48
44
  },
49
45
  instructions: {
50
46
  en: "Please read each statement and select the option which indicates how much the statement applied to you over the past week. There are no right or wrong answers. Do not spend too much time on any statement.",
51
- tr: "Lütfen her ifadeyi okuyun ve geçtiğimiz hafta boyunca ifadenin size ne kadar uyduğunu gösteren seçeneği işaretleyin. Doğru ya da yanlış cevap yoktur. Herhangi bir ifade üzerinde çok fazla zaman harcamayın.",
52
- de: "Bitte lesen Sie jede Aussage und wählen Sie die Option, die angibt, wie sehr die Aussage in der vergangenen Woche auf Sie zutraf. Es gibt keine richtigen oder falschen Antworten. Verbringen Sie nicht zu viel Zeit mit einer Aussage.",
53
47
  },
54
48
  defaultLocale: "en",
55
49
  options: [
@@ -57,32 +51,24 @@ export const dass21: AssessmentDefinition = {
57
51
  value: 0,
58
52
  label: {
59
53
  en: "Did not apply to me at all",
60
- tr: "Bana hiç uymadı",
61
- de: "Traf gar nicht auf mich zu",
62
54
  },
63
55
  },
64
56
  {
65
57
  value: 1,
66
58
  label: {
67
59
  en: "Applied to me to some degree, or some of the time",
68
- tr: "Bana biraz uydu ya da zaman zaman uydu",
69
- de: "Traf bis zu einem gewissen Grad oder manchmal auf mich zu",
70
60
  },
71
61
  },
72
62
  {
73
63
  value: 2,
74
64
  label: {
75
65
  en: "Applied to me to a considerable degree, or a good part of the time",
76
- tr: "Bana oldukça uydu ya da zamanın büyük bölümünde uydu",
77
- de: "Traf in beträchtlichem Maße oder einen guten Teil der Zeit auf mich zu",
78
66
  },
79
67
  },
80
68
  {
81
69
  value: 3,
82
70
  label: {
83
71
  en: "Applied to me very much, or most of the time",
84
- tr: "Bana çok uydu ya da hemen hemen her zaman uydu",
85
- de: "Traf sehr stark oder die meiste Zeit auf mich zu",
86
72
  },
87
73
  },
88
74
  ],
@@ -91,168 +77,126 @@ export const dass21: AssessmentDefinition = {
91
77
  id: "dass21-1",
92
78
  text: {
93
79
  en: "I found it hard to wind down",
94
- tr: "Sakinleşip yatışmakta zorlandım",
95
- de: "Ich fand es schwer, mich zu beruhigen",
96
80
  },
97
81
  },
98
82
  {
99
83
  id: "dass21-2",
100
84
  text: {
101
85
  en: "I was aware of dryness of my mouth",
102
- tr: "Ağzımın kuruduğunu fark ettim",
103
- de: "Ich bemerkte, dass mein Mund trocken war",
104
86
  },
105
87
  },
106
88
  {
107
89
  id: "dass21-3",
108
90
  text: {
109
91
  en: "I couldn't seem to experience any positive feeling at all",
110
- tr: "Hiç olumlu duygu yaşayamadığımı fark ettim",
111
- de: "Ich konnte überhaupt keine positiven Gefühle mehr erleben",
112
92
  },
113
93
  },
114
94
  {
115
95
  id: "dass21-4",
116
96
  text: {
117
97
  en: "I experienced breathing difficulty (e.g. excessively rapid breathing, breathlessness in the absence of physical exertion)",
118
- tr: "Nefes almada zorluk yaşadım (örneğin, fiziksel çaba göstermediğim hâlde aşırı hızlı nefes alma, nefessiz kalma)",
119
- de: "Ich hatte Atemprobleme (z. B. übermäßig schnelle Atmung, Atemlosigkeit ohne körperliche Anstrengung)",
120
98
  },
121
99
  },
122
100
  {
123
101
  id: "dass21-5",
124
102
  text: {
125
103
  en: "I found it difficult to work up the initiative to do things",
126
- tr: "Bir işe başlamak için gereken isteği kendimde bulmakta zorlandım",
127
- de: "Es fiel mir schwer, die Initiative zu ergreifen, um Dinge zu erledigen",
128
104
  },
129
105
  },
130
106
  {
131
107
  id: "dass21-6",
132
108
  text: {
133
109
  en: "I tended to over-react to situations",
134
- tr: "Olaylara aşırı tepki verme eğiliminde oldum",
135
- de: "Ich neigte dazu, auf Situationen überzureagieren",
136
110
  },
137
111
  },
138
112
  {
139
113
  id: "dass21-7",
140
114
  text: {
141
115
  en: "I experienced trembling (e.g. in the hands)",
142
- tr: "Titreme yaşadım (örneğin ellerde)",
143
- de: "Ich hatte Zittern (z. B. in den Händen)",
144
116
  },
145
117
  },
146
118
  {
147
119
  id: "dass21-8",
148
120
  text: {
149
121
  en: "I felt that I was using a lot of nervous energy",
150
- tr: "Sinirsel enerjimin çok fazla olduğunu hissettim",
151
- de: "Ich fühlte, dass ich viel nervöse Energie verbrauchte",
152
122
  },
153
123
  },
154
124
  {
155
125
  id: "dass21-9",
156
126
  text: {
157
127
  en: "I was worried about situations in which I might panic and make a fool of myself",
158
- tr: "Panikleyip kendimi gülünç duruma düşürebileceğim durumlar nedeniyle endişelendim",
159
- de: "Ich machte mir Sorgen über Situationen, in denen ich in Panik geraten und mich blamieren könnte",
160
128
  },
161
129
  },
162
130
  {
163
131
  id: "dass21-10",
164
132
  text: {
165
133
  en: "I felt that I had nothing to look forward to",
166
- tr: "Dört gözle beklediğim hiçbir şey olmadığını hissettim",
167
- de: "Ich hatte das Gefühl, mich auf nichts mehr freuen zu können",
168
134
  },
169
135
  },
170
136
  {
171
137
  id: "dass21-11",
172
138
  text: {
173
139
  en: "I found myself getting agitated",
174
- tr: "Giderek huzursuzlandığımı fark ettim",
175
- de: "Ich merkte, dass ich unruhig wurde",
176
140
  },
177
141
  },
178
142
  {
179
143
  id: "dass21-12",
180
144
  text: {
181
145
  en: "I found it difficult to relax",
182
- tr: "Gevşeyip rahatlamakta zorlandım",
183
- de: "Es fiel mir schwer, mich zu entspannen",
184
146
  },
185
147
  },
186
148
  {
187
149
  id: "dass21-13",
188
150
  text: {
189
151
  en: "I felt down-hearted and blue",
190
- tr: "Kendimi üzgün ve karamsar hissettim",
191
- de: "Ich fühlte mich niedergeschlagen und traurig",
192
152
  },
193
153
  },
194
154
  {
195
155
  id: "dass21-14",
196
156
  text: {
197
157
  en: "I was intolerant of anything that kept me from getting on with what I was doing",
198
- tr: "Yaptığım işi sürdürmeme engel olan şeylere tahammül edemedim",
199
- de: "Ich konnte es nicht ertragen, von dem, was ich gerade tat, abgehalten zu werden",
200
158
  },
201
159
  },
202
160
  {
203
161
  id: "dass21-15",
204
162
  text: {
205
163
  en: "I felt I was close to panic",
206
- tr: "Panik olmaya yakın olduğumu hissettim",
207
- de: "Ich fühlte mich einer Panik nahe",
208
164
  },
209
165
  },
210
166
  {
211
167
  id: "dass21-16",
212
168
  text: {
213
169
  en: "I was unable to become enthusiastic about anything",
214
- tr: "Hiçbir şeye karşı heves duyamadım",
215
- de: "Ich konnte mich für nichts mehr begeistern",
216
170
  },
217
171
  },
218
172
  {
219
173
  id: "dass21-17",
220
174
  text: {
221
175
  en: "I felt I wasn't worth much as a person",
222
- tr: "Kişi olarak fazla bir değerimin olmadığını hissettim",
223
- de: "Ich hatte das Gefühl, als Person nicht viel wert zu sein",
224
176
  },
225
177
  },
226
178
  {
227
179
  id: "dass21-18",
228
180
  text: {
229
181
  en: "I felt that I was rather touchy",
230
- tr: "Oldukça alıngan olduğumu hissettim",
231
- de: "Ich fühlte, dass ich ziemlich empfindlich war",
232
182
  },
233
183
  },
234
184
  {
235
185
  id: "dass21-19",
236
186
  text: {
237
187
  en: "I was aware of the action of my heart in the absence of physical exertion (e.g. sense of heart rate increase, heart missing a beat)",
238
- tr: "Fiziksel çaba göstermediğim hâlde kalbimin hareketlerini fark ettim (örneğin, kalp atışının hızlanması, kalbin bir atışı atlaması)",
239
- de: "Ich nahm meinen Herzschlag wahr, ohne mich körperlich angestrengt zu haben (z. B. Gefühl von Herzrasen oder Herzstolpern)",
240
188
  },
241
189
  },
242
190
  {
243
191
  id: "dass21-20",
244
192
  text: {
245
193
  en: "I felt scared without any good reason",
246
- tr: "Geçerli bir neden olmadığı hâlde korktuğumu hissettim",
247
- de: "Ich fühlte mich ohne triftigen Grund ängstlich",
248
194
  },
249
195
  },
250
196
  {
251
197
  id: "dass21-21",
252
198
  text: {
253
199
  en: "I felt that life was meaningless",
254
- tr: "Yaşamın anlamsız olduğunu hissettim",
255
- de: "Ich hatte das Gefühl, dass das Leben sinnlos ist",
256
200
  },
257
201
  },
258
202
  ],
@@ -261,21 +205,21 @@ export const dass21: AssessmentDefinition = {
261
205
  subscales: [
262
206
  {
263
207
  id: "depression",
264
- label: { en: "Depression", tr: "Depresyon", de: "Depression" },
208
+ label: { en: "Depression" },
265
209
  questionIds: ["dass21-3", "dass21-5", "dass21-10", "dass21-13", "dass21-16", "dass21-17", "dass21-21"],
266
210
  multiplier: 2,
267
211
  bands: depressionBands,
268
212
  },
269
213
  {
270
214
  id: "anxiety",
271
- label: { en: "Anxiety", tr: "Anksiyete", de: "Angst" },
215
+ label: { en: "Anxiety" },
272
216
  questionIds: ["dass21-2", "dass21-4", "dass21-7", "dass21-9", "dass21-15", "dass21-19", "dass21-20"],
273
217
  multiplier: 2,
274
218
  bands: anxietyBands,
275
219
  },
276
220
  {
277
221
  id: "stress",
278
- label: { en: "Stress", tr: "Stres", de: "Stress" },
222
+ label: { en: "Stress" },
279
223
  questionIds: ["dass21-1", "dass21-6", "dass21-8", "dass21-11", "dass21-12", "dass21-14", "dass21-18"],
280
224
  multiplier: 2,
281
225
  bands: stressBands,
@@ -288,7 +232,7 @@ export const dass21: AssessmentDefinition = {
288
232
  license: "Free — public domain per the official DASS site, including translations",
289
233
  licenseFlag: "free",
290
234
  translationProvenance:
291
- "en: reproduced from the original. tr/de: AI translation (Anthropic Claude, claude-fable-5) from the original English; official translations were not consulted and the texts are unverified. See SOURCES.md.",
235
+ "en: reproduced from the original. Other locales (tr, de, zh, es): AI translation (Anthropic Claude, claude-fable-5) from the original English; official translations were not consulted and the texts are unverified. See SOURCES.md.",
292
236
  timeframe: "past week",
293
237
  },
294
238
  };
@@ -14,13 +14,9 @@ export const gad7: AssessmentDefinition = {
14
14
  version: "1.0.0",
15
15
  title: {
16
16
  en: "Generalized Anxiety Disorder Scale (GAD-7)",
17
- tr: "Yaygın Anksiyete Bozukluğu Ölçeği (GAD-7)",
18
- de: "Generalisierte Angststörung Skala (GAD-7)",
19
17
  },
20
18
  description: {
21
19
  en: "A 7-item self-report questionnaire for screening and measuring the severity of generalized anxiety.",
22
- tr: "Yaygın anksiyeteyi taramak ve şiddetini ölçmek için kullanılan 7 maddelik bir öz bildirim ölçeği.",
23
- de: "Ein Selbstbeurteilungsfragebogen mit 7 Items zum Screening und zur Schweregradmessung generalisierter Angst.",
24
20
  },
25
21
  instructions: twoWeekInstructions,
26
22
  defaultLocale: "en",
@@ -30,56 +26,42 @@ export const gad7: AssessmentDefinition = {
30
26
  id: "gad7-1",
31
27
  text: {
32
28
  en: "Feeling nervous, anxious, or on edge",
33
- tr: "Sinirli, kaygılı ya da çok gergin hissetme",
34
- de: "Nervosität, Ängstlichkeit oder Anspannung",
35
29
  },
36
30
  },
37
31
  {
38
32
  id: "gad7-2",
39
33
  text: {
40
34
  en: "Not being able to stop or control worrying",
41
- tr: "Endişelenmeyi durduramama ya da kontrol edememe",
42
- de: "Nicht in der Lage sein, Sorgen zu stoppen oder zu kontrollieren",
43
35
  },
44
36
  },
45
37
  {
46
38
  id: "gad7-3",
47
39
  text: {
48
40
  en: "Worrying too much about different things",
49
- tr: "Farklı konular hakkında çok fazla endişelenme",
50
- de: "Übermäßige Sorgen bezüglich verschiedener Angelegenheiten",
51
41
  },
52
42
  },
53
43
  {
54
44
  id: "gad7-4",
55
45
  text: {
56
46
  en: "Trouble relaxing",
57
- tr: "Gevşeyip rahatlamada güçlük",
58
- de: "Schwierigkeiten, sich zu entspannen",
59
47
  },
60
48
  },
61
49
  {
62
50
  id: "gad7-5",
63
51
  text: {
64
52
  en: "Being so restless that it is hard to sit still",
65
- tr: "Yerinde duramayacak kadar huzursuz olma",
66
- de: "Rastlosigkeit, sodass das Stillsitzen schwerfällt",
67
53
  },
68
54
  },
69
55
  {
70
56
  id: "gad7-6",
71
57
  text: {
72
58
  en: "Becoming easily annoyed or irritable",
73
- tr: "Çabuk kızma ya da kolayca sinirlenir olma",
74
- de: "Schnelle Verärgerung oder Gereiztheit",
75
59
  },
76
60
  },
77
61
  {
78
62
  id: "gad7-7",
79
63
  text: {
80
64
  en: "Feeling afraid, as if something awful might happen",
81
- tr: "Sanki çok kötü bir şey olacakmış gibi korkuya kapılma",
82
- de: "Angstgefühl, als könnte etwas Schlimmes passieren",
83
65
  },
84
66
  },
85
67
  ],
@@ -90,25 +72,25 @@ export const gad7: AssessmentDefinition = {
90
72
  id: "minimal",
91
73
  min: 0,
92
74
  max: 4,
93
- label: { en: "Minimal anxiety", tr: "Minimal anksiyete", de: "Minimale Angst" },
75
+ label: { en: "Minimal anxiety" },
94
76
  },
95
77
  {
96
78
  id: "mild",
97
79
  min: 5,
98
80
  max: 9,
99
- label: { en: "Mild anxiety", tr: "Hafif anksiyete", de: "Leichte Angst" },
81
+ label: { en: "Mild anxiety" },
100
82
  },
101
83
  {
102
84
  id: "moderate",
103
85
  min: 10,
104
86
  max: 14,
105
- label: { en: "Moderate anxiety", tr: "Orta düzeyde anksiyete", de: "Mittelgradige Angst" },
87
+ label: { en: "Moderate anxiety" },
106
88
  },
107
89
  {
108
90
  id: "severe",
109
91
  min: 15,
110
92
  max: 21,
111
- label: { en: "Severe anxiety", tr: "Şiddetli anksiyete", de: "Schwere Angst" },
93
+ label: { en: "Severe anxiety" },
112
94
  },
113
95
  ],
114
96
  },
@@ -118,7 +100,7 @@ export const gad7: AssessmentDefinition = {
118
100
  license: "Free — no permission required to reproduce, translate, display or distribute (Pfizer educational grant)",
119
101
  licenseFlag: "free",
120
102
  translationProvenance:
121
- "en: reproduced from the original. tr/de: AI translation (Anthropic Claude, claude-fable-5) from the original English; official translations were not consulted and the texts are unverified. See SOURCES.md.",
103
+ "en: reproduced from the original. Other locales (tr, de, zh, es): AI translation (Anthropic Claude, claude-fable-5) from the original English; official translations were not consulted and the texts are unverified. See SOURCES.md.",
122
104
  timeframe: "past 2 weeks",
123
105
  },
124
106
  };
@@ -1,6 +1,8 @@
1
1
  import type { AssessmentDefinition } from "../types.ts";
2
2
  import { Assessment } from "../assessment.ts";
3
3
  import { PsytoolsError } from "../errors.ts";
4
+ import { applyLocale } from "../i18n.ts";
5
+ import { availableLocales, localePacks } from "../locales/index.ts";
4
6
  import { phq9 } from "./phq9.ts";
5
7
  import { gad7 } from "./gad7.ts";
6
8
  import { dass21 } from "./dass21.ts";
@@ -37,13 +39,35 @@ export type InventoryId =
37
39
 
38
40
  /**
39
41
  * Instantiates a predefined inventory as an `Assessment`.
40
- * @throws PsytoolsError `unknown_inventory`
42
+ *
43
+ * Base definitions carry English only; other languages live in separate
44
+ * locale-pack modules that are dynamically imported — and only then held
45
+ * in memory — when listed in `options.locales` (data minimization by
46
+ * default). The returned assessment's definition is still one complete,
47
+ * serializable JSON object containing exactly the requested locales.
48
+ *
49
+ * @throws PsytoolsError `unknown_inventory` | `unknown_locale`
41
50
  */
42
- export function loadInventory(id: InventoryId | string): Assessment {
51
+ export async function loadInventory(
52
+ id: InventoryId | string,
53
+ options?: { locales?: string[] },
54
+ ): Promise<Assessment> {
43
55
  const definition = inventories[id];
44
56
  if (!definition) {
45
57
  const known = Object.keys(inventories).join(", ");
46
58
  throw new PsytoolsError("unknown_inventory", `Unknown inventory "${id}" (available: ${known})`);
47
59
  }
48
- return new Assessment(definition);
60
+ let merged = definition;
61
+ for (const locale of options?.locales ?? []) {
62
+ if (locale === definition.defaultLocale) continue;
63
+ const loader = localePacks[id]?.[locale];
64
+ if (!loader) {
65
+ throw new PsytoolsError(
66
+ "unknown_locale",
67
+ `No "${locale}" locale pack for inventory "${id}" (available: ${availableLocales(id).join(", ")})`,
68
+ );
69
+ }
70
+ merged = applyLocale(merged, (await loader()).default);
71
+ }
72
+ return new Assessment(merged);
49
73
  }