diff --git a/packages/backend/package.json b/packages/backend/package.json index e21caca..d938730 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -25,7 +25,7 @@ "graphql": "^16.6.0", "graphql-middleware": "^6.1.33", "graphql-shield": "^7.6.3", - "i18next": "^20.3.1", + "i18next": "^25.3.2", "jsonwebtoken": "^8.5.1", "node-fetch": "^3.3.2", "object-hash": "^2.2.0", diff --git a/packages/backend/src/i18n/index.ts b/packages/backend/src/i18n/index.ts index 9e10945..10c5c00 100644 --- a/packages/backend/src/i18n/index.ts +++ b/packages/backend/src/i18n/index.ts @@ -1,4 +1,4 @@ -import i18next, { TFunctionResult, TOptions } from 'i18next' +import i18next, { TOptions } from 'i18next' import { EmailTranslations, PrintTranslations } from '@lara/api' import { GermanTranslations } from './de' @@ -46,17 +46,13 @@ i18next.init({ }, }) -export type TFunction = ( - key: string, - lng?: string, - params?: TOptions -) => TResult +export type TFunction = (key: string, lng?: string, params?: TOptions) => TResult -export const t: TFunction = (key, lng, params) => { - return i18next.t(key, { lng: lng ?? 'de', ...params }) +export const t = (key: string, lng?: string, params?: TOptions): TResult => { + return i18next.t(key, { lng: lng ?? 'de', ...params }) as unknown as TResult } -type SimpleTFuntion = (key: string, params?: TOptions) => TResult +type SimpleTFuntion = (key: string, params?: TOptions) => TResult export const createT = (lng?: string): SimpleTFuntion => { return (key, params) => t(key, lng, params) diff --git a/packages/backend/src/resolvers/trainee.resolver.ts b/packages/backend/src/resolvers/trainee.resolver.ts index 7b0eea0..ccd86b3 100644 --- a/packages/backend/src/resolvers/trainee.resolver.ts +++ b/packages/backend/src/resolvers/trainee.resolver.ts @@ -80,8 +80,8 @@ export const traineeTraineeResolver: GqlResolvers = { const reportsData = filteredReports.map((report) => createPrintReportData(report, currentUser)) const userData = await createPrintUserData(currentUser) - const printTranslations: PrintTranslations = t('print', currentUser.language) - const emailTranslations: EmailTranslations = t('email', currentUser.language) + const printTranslations = t('print', currentUser.language) + const emailTranslations = t('email', currentUser.language) const hash = await savePrintData({ reportsData, diff --git a/packages/frontend/webpack.config.js b/packages/frontend/webpack.config.js index d90d560..98e9eeb 100644 --- a/packages/frontend/webpack.config.js +++ b/packages/frontend/webpack.config.js @@ -1,12 +1,10 @@ // @ts-check - const webpack = require('webpack') const HtmlWebpackPlugin = require('html-webpack-plugin') const createStyledComponentsTransformer = require('typescript-plugin-styled-components').default const path = require('path') const dotenv = require('dotenv') - const { MICROSOFT_CLIENT_ID, @@ -120,7 +118,7 @@ const webpackConfig = () => { plugins: [ new webpack.DefinePlugin({ ENVIRONMENT: JSON.stringify(getEnvironmentConfig()), - + REVISION: JSON.stringify(require(__dirname + '/scripts/get-revision')()), TAG: JSON.stringify(process.env.LARA_VERSION), diff --git a/yarn.lock b/yarn.lock index df2a750..be4ea7a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1672,7 +1672,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.27.1" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.0", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.21.0", "@babel/runtime@^7.23.9": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.21.0", "@babel/runtime@^7.23.9", "@babel/runtime@^7.27.6": version "7.28.2" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.28.2.tgz#2ae5a9d51cc583bd1f5673b3bb70d6d819682473" integrity sha512-KHp2IflsnGywDjBWDkR9iEqiWSpc8GIi0lgTT3mOElT0PP1tG26P4tmFI2YvAdzgq9RGyoHZQEIEdZy6Ec5xCA== @@ -10561,12 +10561,12 @@ husky@^4.3.0: slash "^3.0.0" which-pm-runs "^1.0.0" -i18next@^20.3.1: - version "20.6.1" - resolved "https://registry.yarnpkg.com/i18next/-/i18next-20.6.1.tgz#535e5f6e5baeb685c7d25df70db63bf3cc0aa345" - integrity sha512-yCMYTMEJ9ihCwEQQ3phLo7I/Pwycf8uAx+sRHwwk5U9Aui/IZYgQRyMqXafQOw5QQ7DM1Z+WyEXWIqSuJHhG2A== +i18next@^25.3.2: + version "25.3.2" + resolved "https://registry.yarnpkg.com/i18next/-/i18next-25.3.2.tgz#3d6a7d1dc058caa1b9bdca47fd585483e2e7a637" + integrity sha512-JSnbZDxRVbphc5jiptxr3o2zocy5dEqpVm9qCGdJwRNO+9saUJS0/u4LnM/13C23fUEWxAylPqKU/NpMV/IjqA== dependencies: - "@babel/runtime" "^7.12.0" + "@babel/runtime" "^7.27.6" iconv-lite@0.4.24, iconv-lite@^0.4.24: version "0.4.24"