@magmamath/students-features 1.3.3-rc.2 → 1.3.3-rc.3

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 (170) hide show
  1. package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.js +2 -2
  2. package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.js.map +1 -1
  3. package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.js +2 -2
  4. package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.js.map +1 -1
  5. package/dist/commonjs/features/chatbot/helpers.js +3 -3
  6. package/dist/commonjs/features/chatbot/helpers.js.map +1 -1
  7. package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js +2 -2
  8. package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
  9. package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js +2 -2
  10. package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -1
  11. package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js +2 -2
  12. package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -1
  13. package/dist/commonjs/features/feedback/components/EmptyComment.js +2 -2
  14. package/dist/commonjs/features/feedback/components/EmptyComment.js.map +1 -1
  15. package/dist/commonjs/features/feedback/model/comments.js +2 -2
  16. package/dist/commonjs/features/feedback/model/comments.js.map +1 -1
  17. package/dist/commonjs/features/gifCelebrations/components/Gif.js +2 -2
  18. package/dist/commonjs/features/gifCelebrations/components/Gif.js.map +1 -1
  19. package/dist/commonjs/features/keyboard/components/Numpad/Numpad.js +2 -2
  20. package/dist/commonjs/features/keyboard/components/Numpad/Numpad.js.map +1 -1
  21. package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +2 -2
  22. package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
  23. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js +2 -2
  24. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +1 -1
  25. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +2 -2
  26. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +1 -1
  27. package/dist/commonjs/features/voice/recording/components/VoiceRecordButton.js +2 -2
  28. package/dist/commonjs/features/voice/recording/components/VoiceRecordButton.js.map +1 -1
  29. package/dist/commonjs/features/voice/recording/modal/ModalFooterButtons.js +2 -2
  30. package/dist/commonjs/features/voice/recording/modal/ModalFooterButtons.js.map +1 -1
  31. package/dist/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.js +2 -2
  32. package/dist/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.js.map +1 -1
  33. package/dist/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.js +2 -2
  34. package/dist/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.js.map +1 -1
  35. package/dist/commonjs/features/voice/recording/model/VoiceRecord.model.js +7 -7
  36. package/dist/commonjs/features/voice/recording/model/VoiceRecord.model.js.map +1 -1
  37. package/dist/commonjs/lib/helpers/helpers.js +12 -12
  38. package/dist/commonjs/lib/helpers/helpers.js.map +1 -1
  39. package/dist/commonjs/shared/translation/i18n.d.js +5 -0
  40. package/dist/commonjs/shared/translation/i18n.d.js.map +1 -0
  41. package/dist/commonjs/shared/translation/i18n.js +26 -0
  42. package/dist/commonjs/shared/translation/i18n.js.map +1 -0
  43. package/dist/module/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.js +1 -1
  44. package/dist/module/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.js.map +1 -1
  45. package/dist/module/features/chatbot/errorSpotting/ErrorSpottingButton.js +1 -1
  46. package/dist/module/features/chatbot/errorSpotting/ErrorSpottingButton.js.map +1 -1
  47. package/dist/module/features/chatbot/helpers.js +1 -1
  48. package/dist/module/features/chatbot/helpers.js.map +1 -1
  49. package/dist/module/features/chatbot/model/ChatBoxTextManager.js +1 -1
  50. package/dist/module/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
  51. package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js +1 -1
  52. package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -1
  53. package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js +1 -1
  54. package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -1
  55. package/dist/module/features/feedback/components/EmptyComment.js +1 -1
  56. package/dist/module/features/feedback/components/EmptyComment.js.map +1 -1
  57. package/dist/module/features/feedback/model/comments.js +1 -1
  58. package/dist/module/features/feedback/model/comments.js.map +1 -1
  59. package/dist/module/features/gifCelebrations/components/Gif.js +1 -1
  60. package/dist/module/features/gifCelebrations/components/Gif.js.map +1 -1
  61. package/dist/module/features/keyboard/components/Numpad/Numpad.js +1 -1
  62. package/dist/module/features/keyboard/components/Numpad/Numpad.js.map +1 -1
  63. package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +1 -1
  64. package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
  65. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js +1 -1
  66. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +1 -1
  67. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +1 -1
  68. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +1 -1
  69. package/dist/module/features/voice/recording/components/VoiceRecordButton.js +1 -1
  70. package/dist/module/features/voice/recording/components/VoiceRecordButton.js.map +1 -1
  71. package/dist/module/features/voice/recording/modal/ModalFooterButtons.js +1 -1
  72. package/dist/module/features/voice/recording/modal/ModalFooterButtons.js.map +1 -1
  73. package/dist/module/features/voice/recording/modal/VoiceRecordDeleteModal.js +1 -1
  74. package/dist/module/features/voice/recording/modal/VoiceRecordDeleteModal.js.map +1 -1
  75. package/dist/module/features/voice/recording/modal/VoiceRecordUndoModal.js +1 -1
  76. package/dist/module/features/voice/recording/modal/VoiceRecordUndoModal.js.map +1 -1
  77. package/dist/module/features/voice/recording/model/VoiceRecord.model.js +1 -1
  78. package/dist/module/features/voice/recording/model/VoiceRecord.model.js.map +1 -1
  79. package/dist/module/lib/helpers/helpers.js +1 -1
  80. package/dist/module/lib/helpers/helpers.js.map +1 -1
  81. package/dist/module/shared/translation/i18n.d.js +5 -0
  82. package/dist/module/shared/translation/i18n.d.js.map +1 -0
  83. package/dist/module/shared/translation/{hooks.js → i18n.js} +10 -3
  84. package/dist/module/shared/translation/i18n.js.map +1 -0
  85. package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts +1 -1
  86. package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
  87. package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -1
  88. package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts +1 -1
  89. package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts.map +1 -1
  90. package/dist/typescript/commonjs/features/voice/recording/modal/ModalFooterButtons.d.ts +1 -1
  91. package/dist/typescript/commonjs/features/voice/recording/modal/ModalFooterButtons.d.ts.map +1 -1
  92. package/dist/typescript/commonjs/shared/translation/{types.d.ts → i18n.d.ts} +5 -3
  93. package/dist/typescript/commonjs/shared/translation/i18n.d.ts.map +1 -0
  94. package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts +1 -1
  95. package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
  96. package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -1
  97. package/dist/typescript/module/features/gifCelebrations/helpers.d.ts +1 -1
  98. package/dist/typescript/module/features/gifCelebrations/helpers.d.ts.map +1 -1
  99. package/dist/typescript/module/features/voice/recording/modal/ModalFooterButtons.d.ts +1 -1
  100. package/dist/typescript/module/features/voice/recording/modal/ModalFooterButtons.d.ts.map +1 -1
  101. package/dist/typescript/module/shared/translation/{types.d.ts → i18n.d.ts} +5 -3
  102. package/dist/typescript/module/shared/translation/i18n.d.ts.map +1 -0
  103. package/package.json +1 -1
  104. package/src/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.tsx +1 -1
  105. package/src/features/chatbot/errorSpotting/ErrorSpottingButton.tsx +1 -1
  106. package/src/features/chatbot/helpers.ts +1 -1
  107. package/src/features/chatbot/model/ChatBoxTextManager.ts +1 -2
  108. package/src/features/exampleSolution/components/ExampleSolutionModalContent.tsx +1 -1
  109. package/src/features/exampleSolution/model/ExampleSolutionApi.ts +1 -1
  110. package/src/features/feedback/components/EmptyComment.tsx +1 -1
  111. package/src/features/feedback/model/comments.ts +1 -1
  112. package/src/features/gifCelebrations/components/Gif.tsx +1 -1
  113. package/src/features/gifCelebrations/helpers.ts +1 -1
  114. package/src/features/keyboard/components/Numpad/Numpad.tsx +1 -1
  115. package/src/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.ts +1 -1
  116. package/src/features/voice/playing/components/VoiceTranscriptionsDropdown.tsx +1 -1
  117. package/src/features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx +1 -1
  118. package/src/features/voice/recording/components/VoiceRecordButton.tsx +1 -1
  119. package/src/features/voice/recording/modal/ModalFooterButtons.tsx +2 -2
  120. package/src/features/voice/recording/modal/VoiceRecordDeleteModal.tsx +1 -1
  121. package/src/features/voice/recording/modal/VoiceRecordUndoModal.tsx +1 -1
  122. package/src/features/voice/recording/model/VoiceRecord.model.ts +1 -1
  123. package/src/lib/helpers/helpers.ts +1 -1
  124. package/src/shared/translation/i18n.d.ts +21 -0
  125. package/src/shared/translation/i18n.ts +17 -0
  126. package/dist/commonjs/shared/translation/constants.js +0 -8
  127. package/dist/commonjs/shared/translation/constants.js.map +0 -1
  128. package/dist/commonjs/shared/translation/helpers.js +0 -17
  129. package/dist/commonjs/shared/translation/helpers.js.map +0 -1
  130. package/dist/commonjs/shared/translation/hooks.js +0 -17
  131. package/dist/commonjs/shared/translation/hooks.js.map +0 -1
  132. package/dist/commonjs/shared/translation/index.js +0 -20
  133. package/dist/commonjs/shared/translation/index.js.map +0 -1
  134. package/dist/commonjs/shared/translation/schema.json +0 -66
  135. package/dist/commonjs/shared/translation/types.js +0 -6
  136. package/dist/commonjs/shared/translation/types.js.map +0 -1
  137. package/dist/module/shared/translation/constants.js +0 -4
  138. package/dist/module/shared/translation/constants.js.map +0 -1
  139. package/dist/module/shared/translation/helpers.js +0 -11
  140. package/dist/module/shared/translation/helpers.js.map +0 -1
  141. package/dist/module/shared/translation/hooks.js.map +0 -1
  142. package/dist/module/shared/translation/index.js +0 -5
  143. package/dist/module/shared/translation/index.js.map +0 -1
  144. package/dist/module/shared/translation/schema.json +0 -66
  145. package/dist/module/shared/translation/types.js +0 -4
  146. package/dist/module/shared/translation/types.js.map +0 -1
  147. package/dist/typescript/commonjs/shared/translation/constants.d.ts +0 -2
  148. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +0 -1
  149. package/dist/typescript/commonjs/shared/translation/helpers.d.ts +0 -3
  150. package/dist/typescript/commonjs/shared/translation/helpers.d.ts.map +0 -1
  151. package/dist/typescript/commonjs/shared/translation/hooks.d.ts +0 -3
  152. package/dist/typescript/commonjs/shared/translation/hooks.d.ts.map +0 -1
  153. package/dist/typescript/commonjs/shared/translation/index.d.ts +0 -4
  154. package/dist/typescript/commonjs/shared/translation/index.d.ts.map +0 -1
  155. package/dist/typescript/commonjs/shared/translation/types.d.ts.map +0 -1
  156. package/dist/typescript/module/shared/translation/constants.d.ts +0 -2
  157. package/dist/typescript/module/shared/translation/constants.d.ts.map +0 -1
  158. package/dist/typescript/module/shared/translation/helpers.d.ts +0 -3
  159. package/dist/typescript/module/shared/translation/helpers.d.ts.map +0 -1
  160. package/dist/typescript/module/shared/translation/hooks.d.ts +0 -3
  161. package/dist/typescript/module/shared/translation/hooks.d.ts.map +0 -1
  162. package/dist/typescript/module/shared/translation/index.d.ts +0 -4
  163. package/dist/typescript/module/shared/translation/index.d.ts.map +0 -1
  164. package/dist/typescript/module/shared/translation/types.d.ts.map +0 -1
  165. package/src/shared/translation/constants.ts +0 -1
  166. package/src/shared/translation/helpers.ts +0 -7
  167. package/src/shared/translation/hooks.ts +0 -9
  168. package/src/shared/translation/index.ts +0 -3
  169. package/src/shared/translation/schema.json +0 -66
  170. package/src/shared/translation/types.ts +0 -5
@@ -1,11 +1,11 @@
1
1
  import { StyleSheet, View } from 'react-native'
2
2
  import React from 'react'
3
3
  import { COLORS, HeadingVariants, IS_WEB, SPACING, Typography } from '@magmamath/react-native-ui'
4
- import { useText } from '../../../shared/translation'
5
4
  import { ExampleSolutionModalParams } from '../types'
6
5
  import { QuestionSection } from './QuestionSection'
7
6
  import { SolutionSection } from './SolutionSection'
8
7
  import { useExampleSolution } from '../hooks/useExampleSolution'
8
+ import { useText } from '../../../shared/translation/i18n'
9
9
 
10
10
  type ExampleSolutionModalContentProps = {
11
11
  params: ExampleSolutionModalParams
@@ -1,7 +1,7 @@
1
1
  import { createControllerEffect } from './../../../lib/effector/createControllerEffect'
2
2
  import { ExampleSolutionApiRequests, ExampleSolutionErrorHandler } from '../types'
3
- import { getText } from '../../../shared/translation/helpers'
4
3
  import { createEffect, sample } from 'effector'
4
+ import { getText } from '../../../shared/translation/i18n'
5
5
 
6
6
  type ExampleSolutionApiProps = {
7
7
  api: ExampleSolutionApiRequests
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import { StyleSheet, Text, View } from 'react-native'
3
3
  import { COLORS } from '@magmamath/react-native-ui'
4
4
  import { BUENOS_AIRES_FONT } from '../constants'
5
- import { useText } from '../../../shared/translation'
5
+ import { useText } from '../../../shared/translation/i18n'
6
6
 
7
7
  export const EmptyComment = () => {
8
8
  const t = useText()
@@ -2,7 +2,7 @@ import { createEvent, restore, sample, Store } from 'effector'
2
2
  import { AddCommentProps, CommentsMap, Credits, DeleteCommentProps, TeacherComment } from '../types'
3
3
  import { TeacherFeedbackAPI } from './api'
4
4
  import { updateCommentsState } from '../helpers'
5
- import { getText } from '../../../shared/translation/helpers'
5
+ import { getText } from '../../../shared/translation/i18n'
6
6
  import { EMPTY_COMMENT } from '@magmamath/students-features'
7
7
 
8
8
  type TeacherCommentsModelProps = {
@@ -3,7 +3,7 @@ import React, { useLayoutEffect, useState } from 'react'
3
3
  import { BORDER_RADIUS, COLORS, IS_WEB, SPACING } from '@magmamath/react-native-ui'
4
4
  import { CustomGetCachePathMethod, GifObject, TextComponentType } from '../types/model.types'
5
5
  import { MAX_GIF_SIZE, MIN_GIF_SIZE } from '../constants'
6
- import { useText } from '../../../shared/translation'
6
+ import { useText } from '../../../shared/translation/i18n'
7
7
  import { constrainDimension, getGifLabel, getImagePath } from '../helpers'
8
8
  import gifFallback from '../assets/gifFallback.gif'
9
9
  import { Size } from '../../../types/common.types'
@@ -1,4 +1,4 @@
1
- import { TranslationKeys } from 'src/shared/translation/types'
1
+ import { TranslationKeys } from 'src/shared/translation/i18n'
2
2
  import {
3
3
  CustomGetCachePathMethod,
4
4
  GifsGroups,
@@ -3,7 +3,7 @@ import { KeysList } from '../KeysList/KeysList'
3
3
  import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'
4
4
  import { SPACING } from '@magmamath/react-native-ui'
5
5
  import { KeyboardLayoutProps, KeyboardType } from '../../types/types'
6
- import { useText } from '../../../../shared/translation'
6
+ import { useText } from '../../../../shared/translation/i18n'
7
7
  import { getMainKeyboardGroup } from '../../helpers'
8
8
 
9
9
  type NumpadProps = {
@@ -1,4 +1,4 @@
1
- import { useText } from '../../../../../shared/translation'
1
+ import { useText } from '../../../../../shared/translation/i18n'
2
2
  import { useMemo, useState } from 'react'
3
3
  import { KeyboardUnitsGroupType, UnitTab } from '../types'
4
4
  import { useWindowDimensions } from 'react-native'
@@ -24,7 +24,7 @@ import { useVoiceTranscriptionsDropdown } from '../hooks/useVoiceTranscriptionsD
24
24
  import { VoicePlayerModel, PlayerState } from '../model'
25
25
  import { VoiceTranscriptionsDropdownItem } from './VoiceTranscriptionsDropdownItem'
26
26
  import { DROPDOWN_MAX_CONTENT_HEIGHT, NO_AUDIO_BE_MESSAGE } from '../../constants'
27
- import { useText } from '../../../../shared/translation'
27
+ import { useText } from '../../../../shared/translation/i18n'
28
28
  import { PlayButton } from '../../../../shared/components/PlayButton'
29
29
  import { getActiveAttempt, getAudioStatus } from '../../helpers'
30
30
 
@@ -12,7 +12,7 @@ import {
12
12
  } from '@magmamath/react-native-ui'
13
13
  import Animated, { runOnJS, useAnimatedReaction } from 'react-native-reanimated'
14
14
  import { useVoiceTranscriptionsDropdownItemAnimation } from '../hooks/useVoiceTranscriptionsDropdownItemAnimation'
15
- import { useText } from '../../../../shared/translation'
15
+ import { useText } from '../../../../shared/translation/i18n'
16
16
 
17
17
  type VoiceTranscriptionsDropdownItemProps = {
18
18
  attempt: number
@@ -12,7 +12,7 @@ import { MicrophoneIcon, CheckIcon } from '@magmamath/react-native-ui'
12
12
  import { VoiceRecordModel } from '../model/VoiceRecord.model'
13
13
  import { useUnit } from 'effector-react'
14
14
  import { VoiceRecorderState } from '../../constants'
15
- import { useText } from '../../../../shared/translation'
15
+ import { useText } from '../../../../shared/translation/i18n'
16
16
 
17
17
  type VoiceRecordButtonProps = {
18
18
  style?: ButtonStyle
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
  import { Button, ButtonColor, ButtonSize, ButtonVariant, SPACING } from '@magmamath/react-native-ui'
3
3
  import { StyleSheet, View } from 'react-native'
4
- import { useText } from '../../../../shared/translation'
5
- import { TranslationKeys } from '../../../../shared/translation/types'
4
+ import { useText } from '../../../../shared/translation/i18n'
5
+ import { TranslationKeys } from '../../../../shared/translation/i18n'
6
6
 
7
7
  type ModalFooterButtonsProps = {
8
8
  onCancel: () => void
@@ -3,7 +3,7 @@ import { BaseModal, ButtonColor } from '@magmamath/react-native-ui'
3
3
  import { StyleSheet } from 'react-native'
4
4
  import { useUnit } from 'effector-react'
5
5
  import { VoiceRecorderState } from '../../constants'
6
- import { useText } from '../../../../shared/translation'
6
+ import { useText } from '../../../../shared/translation/i18n'
7
7
  import { ModalFooterButtons } from './ModalFooterButtons'
8
8
  import { VoiceRecordModalParams } from '../../types'
9
9
 
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import { BaseModal } from '@magmamath/react-native-ui'
3
3
  import { StyleSheet } from 'react-native'
4
- import { useText } from '../../../../shared/translation'
4
+ import { useText } from '../../../../shared/translation/i18n'
5
5
  import { ModalFooterButtons } from './ModalFooterButtons'
6
6
  import { VoiceRecordModalParams } from '../../types'
7
7
 
@@ -10,7 +10,7 @@ import {
10
10
  } from '../../types'
11
11
  import { ensureRecordingPermissions, getAvailableInputs } from '../../helpers'
12
12
  import { VOICE_RECORDER_MIN_DURATION_MS } from '../../constants'
13
- import { t } from '../../../../shared/translation'
13
+ import { getText as t } from '../../../../shared/translation/i18n'
14
14
 
15
15
  type VoiceRecordModelParams = {
16
16
  api: VoiceRecorderApi
@@ -1,4 +1,4 @@
1
- import { getText } from '../../shared/translation/helpers'
1
+ import { getText } from '../../shared/translation/i18n'
2
2
 
3
3
  export const noop = () => {}
4
4
 
@@ -0,0 +1,21 @@
1
+ import 'i18next'
2
+ import 'react-i18next'
3
+ import schema from './schema.json'
4
+
5
+ declare module 'i18next' {
6
+ interface CustomTypeOptions {
7
+ defaultNS: 'students-features'
8
+ resources: {
9
+ ['students-features']: typeof schema
10
+ }
11
+ }
12
+ }
13
+
14
+ declare module 'react-i18next' {
15
+ interface CustomTypeOptions {
16
+ defaultNS: 'students-features'
17
+ resources: {
18
+ ['students-features']: typeof schema
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,17 @@
1
+ import i18next, { TFuncKey } from 'i18next'
2
+ import { useTranslation } from 'react-i18next'
3
+ import { useCallback } from 'react'
4
+
5
+ export const NAMESPACE = 'students-features'
6
+
7
+ export type GetText = (key: TranslationKeys, args?: Record<string, string> | null) => string
8
+ export type TranslationKeys = TFuncKey<typeof NAMESPACE>
9
+
10
+ export const getText: GetText = (key, args = null) => {
11
+ return i18next.t(key, { ns: NAMESPACE, ...(args || {}) }) as string
12
+ }
13
+
14
+ export const useText = (): GetText => {
15
+ const { t } = useTranslation(NAMESPACE)
16
+ return useCallback<GetText>((key, args = null) => t(key, args ?? undefined) as string, [t])
17
+ }
@@ -1,8 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.NAMESPACE = void 0;
7
- const NAMESPACE = exports.NAMESPACE = 'students-features';
8
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["NAMESPACE","exports"],"sourceRoot":"../../../../src","sources":["shared/translation/constants.ts"],"mappings":";;;;;;AAAO,MAAMA,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,mBAAmB","ignoreList":[]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getText = void 0;
7
- var _i18next = _interopRequireDefault(require("i18next"));
8
- var _constants = require("./constants.js");
9
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
- const getText = (key, args = null) => {
11
- return _i18next.default.t(key, {
12
- ns: _constants.NAMESPACE,
13
- ...(args || {})
14
- });
15
- };
16
- exports.getText = getText;
17
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_i18next","_interopRequireDefault","require","_constants","e","__esModule","default","getText","key","args","i18next","t","ns","NAMESPACE","exports"],"sourceRoot":"../../../../src","sources":["shared/translation/helpers.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAAuC,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGhC,MAAMG,OAAgB,GAAGA,CAACC,GAAG,EAAEC,IAAI,GAAG,IAAI,KAAK;EACpD,OAAOC,gBAAO,CAACC,CAAC,CAACH,GAAG,EAAE;IAAEI,EAAE,EAAEC,oBAAS;IAAE,IAAIJ,IAAI,IAAI,CAAC,CAAC;EAAE,CAAC,CAAC;AAC3D,CAAC;AAAAK,OAAA,CAAAP,OAAA,GAAAA,OAAA","ignoreList":[]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useText = void 0;
7
- var _react = require("react");
8
- var _reactI18next = require("react-i18next");
9
- var _constants = require("./constants.js");
10
- const useText = () => {
11
- const {
12
- t
13
- } = (0, _reactI18next.useTranslation)(_constants.NAMESPACE);
14
- return (0, _react.useCallback)((key, args = null) => t(key, args ?? undefined), [t]);
15
- };
16
- exports.useText = useText;
17
- //# sourceMappingURL=hooks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","_reactI18next","_constants","useText","t","useTranslation","NAMESPACE","useCallback","key","args","undefined","exports"],"sourceRoot":"../../../../src","sources":["shared/translation/hooks.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAGO,MAAMG,OAAO,GAAGA,CAAA,KAAe;EACpC,MAAM;IAAEC;EAAE,CAAC,GAAG,IAAAC,4BAAc,EAACC,oBAAS,CAAC;EACvC,OAAO,IAAAC,kBAAW,EAAU,CAACC,GAAG,EAAEC,IAAI,GAAG,IAAI,KAAKL,CAAC,CAACI,GAAG,EAAEC,IAAI,IAAIC,SAAS,CAAW,EAAE,CAACN,CAAC,CAAC,CAAC;AAC7F,CAAC;AAAAO,OAAA,CAAAR,OAAA,GAAAA,OAAA","ignoreList":[]}
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "t", {
7
- enumerable: true,
8
- get: function () {
9
- return _helpers.getText;
10
- }
11
- });
12
- Object.defineProperty(exports, "useText", {
13
- enumerable: true,
14
- get: function () {
15
- return _hooks.useText;
16
- }
17
- });
18
- var _hooks = require("./hooks.js");
19
- var _helpers = require("./helpers.js");
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_hooks","require","_helpers"],"sourceRoot":"../../../../src","sources":["shared/translation/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA","ignoreList":[]}
@@ -1,66 +0,0 @@
1
- {
2
- "chat": {
3
- "anotherHint": "Give me another hint",
4
- "answerAgain": "Answer again to get another hint!",
5
- "errorMessage": "Something went wrong! Try again",
6
- "getHint": "Get a hint",
7
- "giveHint": "I need a hint",
8
- "giveHintOpenChat": "I need a hint",
9
- "howCanIHelp": "Hi! Do you want help?",
10
- "inputPlaceholder": "Type...",
11
- "needHint": "I need a hint",
12
- "showError": "Show error"
13
- },
14
- "exampleSolution": {
15
- "aha": "Aha!",
16
- "errorMessage": "Something went wrong with generating an example solution",
17
- "exampleSolution": "Example solution",
18
- "letMeThink": "Let me think..."
19
- },
20
- "gifCelebrations": {
21
- "almostThere": "Almost there",
22
- "greatStart": "Great start!",
23
- "onTheWay": "On the way!"
24
- },
25
- "keyboard": {
26
- "area": "Area",
27
- "length": "Length",
28
- "time": "Time",
29
- "volume": "Volume",
30
- "weight": "Weight"
31
- },
32
- "locale": "en-SE",
33
- "teacherFeedback": {
34
- "noComments": "No comments yet"
35
- },
36
- "time": {
37
- "dayAgo": "day ago",
38
- "daysAgo": "{{count}} days ago",
39
- "hourAgo": "hour ago",
40
- "hoursAgo": "{{count}} hours ago",
41
- "justNow": "just now",
42
- "minuteAgo": "minute ago",
43
- "minutesAgo": "{{count}} minutes ago",
44
- "monthAgo": "month ago",
45
- "monthsAgo": "{{count}} months ago",
46
- "yearAgo": "year ago",
47
- "yearsAgo": "{{count}} years ago"
48
- },
49
- "voice": {
50
- "attempt": "Attempt '{{'number'}}'",
51
- "cancel": "Cancel",
52
- "delete": "Delete",
53
- "deleteRecording": "Delete recording?",
54
- "noMicrophoneAccess": "No microphone access.",
55
- "noMicrophoneAccessBySystem": "Microphone access denied by system settings.",
56
- "noMicrophoneFound": "No microphone found.",
57
- "recordingDeleted": "Recording successfully deleted.",
58
- "redo": "Redo",
59
- "redoRecording": "Redo recording?",
60
- "thisWillRemoveRecording": "This will remove your previous recording.",
61
- "transcriptions": "Transcriptions",
62
- "transcriptNotAvailable": "Transcript not available",
63
- "uploadFailed": "Upload failed. Please try again.",
64
- "youWontBeAbleToRecover": "You won't be able to recover this file once it's gone."
65
- }
66
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["shared/translation/types.ts"],"mappings":"","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- "use strict";
2
-
3
- export const NAMESPACE = 'students-features';
4
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["NAMESPACE"],"sourceRoot":"../../../../src","sources":["shared/translation/constants.ts"],"mappings":";;AAAA,OAAO,MAAMA,SAAS,GAAG,mBAAmB","ignoreList":[]}
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- import i18next from 'i18next';
4
- import { NAMESPACE } from "./constants.js";
5
- export const getText = (key, args = null) => {
6
- return i18next.t(key, {
7
- ns: NAMESPACE,
8
- ...(args || {})
9
- });
10
- };
11
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["i18next","NAMESPACE","getText","key","args","t","ns"],"sourceRoot":"../../../../src","sources":["shared/translation/helpers.ts"],"mappings":";;AAAA,OAAOA,OAAO,MAAM,SAAS;AAC7B,SAASC,SAAS,QAAQ,gBAAa;AAGvC,OAAO,MAAMC,OAAgB,GAAGA,CAACC,GAAG,EAAEC,IAAI,GAAG,IAAI,KAAK;EACpD,OAAOJ,OAAO,CAACK,CAAC,CAACF,GAAG,EAAE;IAAEG,EAAE,EAAEL,SAAS;IAAE,IAAIG,IAAI,IAAI,CAAC,CAAC;EAAE,CAAC,CAAC;AAC3D,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["useCallback","useTranslation","NAMESPACE","useText","t","key","args","undefined"],"sourceRoot":"../../../../src","sources":["shared/translation/hooks.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,SAAS,QAAQ,gBAAa;AAGvC,OAAO,MAAMC,OAAO,GAAGA,CAAA,KAAe;EACpC,MAAM;IAAEC;EAAE,CAAC,GAAGH,cAAc,CAACC,SAAS,CAAC;EACvC,OAAOF,WAAW,CAAU,CAACK,GAAG,EAAEC,IAAI,GAAG,IAAI,KAAKF,CAAC,CAACC,GAAG,EAAEC,IAAI,IAAIC,SAAS,CAAW,EAAE,CAACH,CAAC,CAAC,CAAC;AAC7F,CAAC","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- export { useText } from "./hooks.js";
4
- export { getText as t } from "./helpers.js";
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useText","getText","t"],"sourceRoot":"../../../../src","sources":["shared/translation/index.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,YAAS;AACjC,SAASC,OAAO,IAAIC,CAAC,QAAQ,cAAW","ignoreList":[]}
@@ -1,66 +0,0 @@
1
- {
2
- "chat": {
3
- "anotherHint": "Give me another hint",
4
- "answerAgain": "Answer again to get another hint!",
5
- "errorMessage": "Something went wrong! Try again",
6
- "getHint": "Get a hint",
7
- "giveHint": "I need a hint",
8
- "giveHintOpenChat": "I need a hint",
9
- "howCanIHelp": "Hi! Do you want help?",
10
- "inputPlaceholder": "Type...",
11
- "needHint": "I need a hint",
12
- "showError": "Show error"
13
- },
14
- "exampleSolution": {
15
- "aha": "Aha!",
16
- "errorMessage": "Something went wrong with generating an example solution",
17
- "exampleSolution": "Example solution",
18
- "letMeThink": "Let me think..."
19
- },
20
- "gifCelebrations": {
21
- "almostThere": "Almost there",
22
- "greatStart": "Great start!",
23
- "onTheWay": "On the way!"
24
- },
25
- "keyboard": {
26
- "area": "Area",
27
- "length": "Length",
28
- "time": "Time",
29
- "volume": "Volume",
30
- "weight": "Weight"
31
- },
32
- "locale": "en-SE",
33
- "teacherFeedback": {
34
- "noComments": "No comments yet"
35
- },
36
- "time": {
37
- "dayAgo": "day ago",
38
- "daysAgo": "{{count}} days ago",
39
- "hourAgo": "hour ago",
40
- "hoursAgo": "{{count}} hours ago",
41
- "justNow": "just now",
42
- "minuteAgo": "minute ago",
43
- "minutesAgo": "{{count}} minutes ago",
44
- "monthAgo": "month ago",
45
- "monthsAgo": "{{count}} months ago",
46
- "yearAgo": "year ago",
47
- "yearsAgo": "{{count}} years ago"
48
- },
49
- "voice": {
50
- "attempt": "Attempt '{{'number'}}'",
51
- "cancel": "Cancel",
52
- "delete": "Delete",
53
- "deleteRecording": "Delete recording?",
54
- "noMicrophoneAccess": "No microphone access.",
55
- "noMicrophoneAccessBySystem": "Microphone access denied by system settings.",
56
- "noMicrophoneFound": "No microphone found.",
57
- "recordingDeleted": "Recording successfully deleted.",
58
- "redo": "Redo",
59
- "redoRecording": "Redo recording?",
60
- "thisWillRemoveRecording": "This will remove your previous recording.",
61
- "transcriptions": "Transcriptions",
62
- "transcriptNotAvailable": "Transcript not available",
63
- "uploadFailed": "Upload failed. Please try again.",
64
- "youWontBeAbleToRecover": "You won't be able to recover this file once it's gone."
65
- }
66
- }
@@ -1,4 +0,0 @@
1
- "use strict";
2
-
3
- export {};
4
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["shared/translation/types.ts"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- export declare const NAMESPACE = "students-features";
2
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,sBAAsB,CAAA"}
@@ -1,3 +0,0 @@
1
- import { GetText } from './types';
2
- export declare const getText: GetText;
3
- //# sourceMappingURL=helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC,eAAO,MAAM,OAAO,EAAE,OAErB,CAAA"}
@@ -1,3 +0,0 @@
1
- import { GetText } from './types';
2
- export declare const useText: () => GetText;
3
- //# sourceMappingURL=hooks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/hooks.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC,eAAO,MAAM,OAAO,QAAO,OAG1B,CAAA"}
@@ -1,4 +0,0 @@
1
- export { useText } from './hooks';
2
- export { getText as t } from './helpers';
3
- export type { TranslationKeys, GetText } from './types';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,OAAO,IAAI,CAAC,EAAE,MAAM,WAAW,CAAA;AACxC,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAA;AACxD,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,KAAK,MAAM,CAAA"}
@@ -1,2 +0,0 @@
1
- export declare const NAMESPACE = "students-features";
2
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,sBAAsB,CAAA"}
@@ -1,3 +0,0 @@
1
- import { GetText } from './types';
2
- export declare const getText: GetText;
3
- //# sourceMappingURL=helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC,eAAO,MAAM,OAAO,EAAE,OAErB,CAAA"}
@@ -1,3 +0,0 @@
1
- import { GetText } from './types';
2
- export declare const useText: () => GetText;
3
- //# sourceMappingURL=hooks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/hooks.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC,eAAO,MAAM,OAAO,QAAO,OAG1B,CAAA"}
@@ -1,4 +0,0 @@
1
- export { useText } from './hooks';
2
- export { getText as t } from './helpers';
3
- export type { TranslationKeys, GetText } from './types';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,OAAO,IAAI,CAAC,EAAE,MAAM,WAAW,CAAA;AACxC,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAA;AACxD,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,KAAK,MAAM,CAAA"}
@@ -1 +0,0 @@
1
- export const NAMESPACE = 'students-features'
@@ -1,7 +0,0 @@
1
- import i18next from 'i18next'
2
- import { NAMESPACE } from './constants'
3
- import { GetText } from './types'
4
-
5
- export const getText: GetText = (key, args = null) => {
6
- return i18next.t(key, { ns: NAMESPACE, ...(args || {}) }) as string
7
- }
@@ -1,9 +0,0 @@
1
- import { useCallback } from 'react'
2
- import { useTranslation } from 'react-i18next'
3
- import { NAMESPACE } from './constants'
4
- import { GetText } from './types'
5
-
6
- export const useText = (): GetText => {
7
- const { t } = useTranslation(NAMESPACE)
8
- return useCallback<GetText>((key, args = null) => t(key, args ?? undefined) as string, [t])
9
- }
@@ -1,3 +0,0 @@
1
- export { useText } from './hooks'
2
- export { getText as t } from './helpers'
3
- export type { TranslationKeys, GetText } from './types'