Yuki Takei 1 год назад
Родитель
Сommit
4ff54a2c5d

+ 2 - 2
apps/app/src/server/routes/apiv3/app-settings.js

@@ -4,8 +4,8 @@ import { body } from 'express-validator';
 import { i18n } from '^/config/next-i18next.config';
 import { i18n } from '^/config/next-i18next.config';
 
 
 import { SupportedAction } from '~/interfaces/activity';
 import { SupportedAction } from '~/interfaces/activity';
-import { getTranslation } from '~/server/service/i18next';
 import { accessTokenParser } from '~/server/middlewares/access-token-parser';
 import { accessTokenParser } from '~/server/middlewares/access-token-parser';
+import { getTranslation } from '~/server/service/i18next';
 import loggerFactory from '~/utils/logger';
 import loggerFactory from '~/utils/logger';
 
 
 import { generateAddActivityMiddleware } from '../../middlewares/add-activity';
 import { generateAddActivityMiddleware } from '../../middlewares/add-activity';
@@ -569,7 +569,7 @@ module.exports = (crowi) => {
    *            description: Succeeded to send test mail for smtp
    *            description: Succeeded to send test mail for smtp
    */
    */
   router.post('/smtp-test', loginRequiredStrictly, adminRequired, addActivity, async(req, res) => {
   router.post('/smtp-test', loginRequiredStrictly, adminRequired, addActivity, async(req, res) => {
-    const { t } = await getTranslation();
+    const { t } = await getTranslation(req.user.lang);
 
 
     try {
     try {
       await sendTestEmail(req.user.email);
       await sendTestEmail(req.user.email);

+ 1 - 1
apps/app/src/server/routes/apiv3/security-settings/index.js

@@ -932,7 +932,7 @@ module.exports = (crowi) => {
    *                  $ref: '#/components/schemas/SamlAuthSetting'
    *                  $ref: '#/components/schemas/SamlAuthSetting'
    */
    */
   router.put('/saml', loginRequiredStrictly, adminRequired, addActivity, validator.samlAuth, apiV3FormValidator, async(req, res) => {
   router.put('/saml', loginRequiredStrictly, adminRequired, addActivity, validator.samlAuth, apiV3FormValidator, async(req, res) => {
-    const { t } = await getTranslation();
+    const { t } = await getTranslation(req.user.lang);
 
 
     //  For the value of each mandatory items,
     //  For the value of each mandatory items,
     //  check whether it from the environment variables is empty and form value to update it is empty
     //  check whether it from the environment variables is empty and form value to update it is empty

+ 1 - 1
apps/app/src/server/routes/login-passport.js

@@ -241,7 +241,7 @@ module.exports = function(crowi, app) {
    * @param {*} res
    * @param {*} res
    */
    */
   const testLdapCredentials = async(req, res) => {
   const testLdapCredentials = async(req, res) => {
-    const { t } = await getTranslation();
+    const { t } = await getTranslation(req.user.lang);
 
 
     if (!passportService.isLdapStrategySetup) {
     if (!passportService.isLdapStrategySetup) {
       logger.debug('LdapStrategy has not been set up');
       logger.debug('LdapStrategy has not been set up');