title: In JHipster 7.1.0 + React, How to update the i18n with the current user's lanKey when the user logs in?
body: <p>I created a new application with JHipster 7.1.0 and React with two languages: English and French. The default language is English. When the user logs in, I want to update the system language with the current user langKey (for example 'fr'). In <code>app.tsx</code>, I have tried the following:</p>
  <pre><code>import { setLocale } from 'app/shared/reducers/locale';
  .
  .
  .
  
  
  const currentLocale = useAppSelector(state =&gt; state.locale.currentLocale);
  const isAuthenticated = useAppSelector(state =&gt; state.authentication.isAuthenticated);
  const currentUser = useAppSelector(state =&gt; state.authentication.account);
  
  useEffect(() =&gt; {
      if (isAuthenticated){
        setLocale(currentUser.langKey);
        // or
        currentLocale = currentUser.langKey;
      }
    }, [isAuthenticated]);
  </code></pre>
  <p>Unfortunately, it does not work. Please can you help me?</p>