Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

246
Views
internationalization not working in reactJs app

I have created a globe icon and when clicked it shows a dropdown to the different Language options, But clicking on that language dosen't change the language...It does literally nothing. So If any one has any idea..please help

import React from 'react';
import {LanguageImage , Wrapper, Languages,LanguageElement } from './DropdownElements';
import globe from '../../images/globe.svg';
import OutsideClickHandler from 'react-outside-click-handler';
import i18n from 'i18next';

const SUPPORTED_LANGUAGES = ['en', 'es', 'ru', 'zh-CN', 'zh-TW'];

const codeToLang = code => {
    switch (code) {
        case 'en':
            return 'English';
        case 'fr':
            return 'French';
        case 'es':
            return 'Spanish';
        case 'ru':
            return 'Russian';
        case 'zh-CN':
            return 'Chinese (Simplified)';
        case 'zh-TW':
            return 'Chinese (Traditional)';
        default :
            return 'English';
    }
};

const LanguageDropdown  = ({ setIsVisible, isVisible, position }) => {
    if (!isVisible) return null;
    return (
        <OutsideClickHandler onOutsideClick={() => setIsVisible(false)}>
            
                <img src= {globe} alt="" />
               
            <Wrapper style={{ ...position }}>
                <Languages>
                    {SUPPORTED_LANGUAGES.map(language => {
                        return (
                            <LanguageElement key={language} onClick={() => i18n.changeLanguage(language)}>
                                <LanguageImage  src={`../../images/languages/${language}.svg`}></LanguageImage>
                                <h4 m={0}>{codeToLang(language)}</h4>
                            </LanguageElement>
                        );
                    })}
                </Languages>
            </Wrapper>
        </OutsideClickHandler>
    )
}


export default LanguageDropdown ;

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!