Quiero hacer lo mismo para actualizar el texto de los lenguajes conmo lo que hice con las resoluciones


using System;
using I2.Loc;
using TMPro;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.UI;

namespace Game.Systems
{
    public class SettingsMenu : MonoBehaviour
    {
        [SerializeField] private GameObject container;
        [SerializeField] private GameObject videoPanel;
        [SerializeField] private GameObject audioPanel;
        [SerializeField] private GameObject gameplayPanel;
        [SerializeField] private GameObject videoPanelButton;
        [SerializeField] private GameObject audioPanelButton;
        [SerializeField] private GameObject gameplayPanelButton;

        [SerializeField] private Toggle fullscreenToggle;
        [SerializeField] private Toggle postProcessToggle;
        [SerializeField] private Toggle vSyncToggle;
        [SerializeField] private Toggle antiAliasingToggle;
        [SerializeField] private Volume postProcessVolume;
        [SerializeField] private TextMeshProUGUI resolutionText; // Componente de texto para mostrar la resolución
        [SerializeField] private TextMeshProUGUI languajeText; // Componente de texto para mostrar la resolución
        
        [SerializeField] private Slider musicVolumeSlider;
        [SerializeField] private Slider soundEffectsVolumeSlider;
        [SerializeField] private Slider panningSlider;

        [SerializeField] private Color activeColor;
        [SerializeField] private Color inactiveColor;

        private Resolution[] resolutions;
        private string[] languajes;
        private int currentResolutionIndex;
        
        private bool isFullscreen;
        private bool isVSyncEnabled;
        private bool isPostProcessEnabled;
        private bool isAntiAliasingEnabled;
        private int width;
        private int height;
        private uint refreshRateNumerator;
        private uint refreshRateDenominator;
        private float panningSpeed;

        public void Init()
        {
            resolutions = Screen.resolutions;
            
            OpenVideoPanel();

            LoadGraphicSettings();
        }

        private void LoadGraphicSettings()
        {

            isFullscreen = ES3.Load<bool>("Fullscreen", "Settings", true);
            isVSyncEnabled = ES3.Load<bool>("VSync", "Settings", true);
            isPostProcessEnabled = ES3.Load<bool>("PostEffects", "Settings", true);
            isAntiAliasingEnabled = ES3.Load<bool>("AntiAliasing", "Settings", false);

            fullscreenToggle.isOn = isFullscreen;
            vSyncToggle.isOn = isVSyncEnabled;
            postProcessToggle.isOn = isPostProcessEnabled;
            antiAliasingToggle.isOn = isAntiAliasingEnabled;

            width = ES3.Load<int>("Width", "Settings", Screen.currentResolution.width);
            height = ES3.Load<int>("Height", "Settings", Screen.currentResolution.height);
            refreshRateNumerator = ES3.Load<uint>("RefreshRateNumerator", "Settings", Screen.currentResolution.refreshRateRatio.numerator);
            refreshRateNumerator = ES3.Load<uint>("RefreshRateNumerator", "Settings", Screen.currentResolution.refreshRateRatio.denominator);
            
            
            musicVolumeSlider.value = ES3.Load<float>("MusicVolume", "Settings", 1f);
            soundEffectsVolumeSlider.value = ES3.Load<float>("SFXVolume", "Settings", 1f);
            panningSlider.value = ES3.Load<float>("PanningSpeed", "Settings", 0.5f);

            resolutionText.text = $"{width} x {height} @ {Screen.currentResolution.refreshRate}Hz";
        }
        

        public void OpenVideoPanel()
        {
            videoPanel.SetActive(true);
            audioPanel.SetActive(false);
            gameplayPanel.SetActive(false);
            videoPanelButton.GetComponent<Image>().color = activeColor;
            audioPanelButton.GetComponent<Image>().color = inactiveColor;
            gameplayPanelButton.GetComponent<Image>().color = inactiveColor;
        }

        public void OpenAudioPanel()
        {
            videoPanel.SetActive(false);
            audioPanel.SetActive(true);
            gameplayPanel.SetActive(false);
            videoPanelButton.GetComponent<Image>().color = inactiveColor;
            audioPanelButton.GetComponent<Image>().color = activeColor;
            gameplayPanelButton.GetComponent<Image>().color = inactiveColor;
        }

        public void OpenGameplayPanel()
        {
            videoPanel.SetActive(false);
            audioPanel.SetActive(false);
            gameplayPanel.SetActive(true);
            videoPanelButton.GetComponent<Image>().color = inactiveColor;
            audioPanelButton.GetComponent<Image>().color = inactiveColor;
            gameplayPanelButton.GetComponent<Image>().color = activeColor;
        }

        public void ClosePanel()
        {
            videoPanel.SetActive(false);
            audioPanel.SetActive(false);
            gameplayPanel.SetActive(false);
            container.SetActive(false);
        }

        public void NextResolution()
        {
            currentResolutionIndex = (currentResolutionIndex + 1) % resolutions.Length;
            UpdateResolutionText();
        }

        public void PreviousResolution()
        {
            currentResolutionIndex = (currentResolutionIndex - 1 + resolutions.Length) % resolutions.Length;
            UpdateResolutionText();
        }

        private void UpdateResolutionText()
        {
            Resolution resolution = resolutions[currentResolutionIndex];
            resolutionText.text = $"{resolution.width} x {resolution.height} @ {resolution.refreshRate}Hz";
        }

        public void Save()
        {
            Resolution resolution = resolutions[currentResolutionIndex];

            ES3.Save("Width", resolution.width, "Settings");
            ES3.Save("Height", resolution.height, "Settings");
            ES3.Save("RefreshRateNumerator", resolution.refreshRateRatio.numerator, "Settings");
            ES3.Save("RefreshRateDenominator", resolution.refreshRateRatio.denominator, "Settings");
            ES3.Save("Fullscreen", isFullscreen, "Settings");
            ES3.Save("VSync", isVSyncEnabled, "Settings");
            ES3.Save("PostEffects", isPostProcessEnabled, "Settings");
            ES3.Save("AntiAliasing", isAntiAliasingEnabled, "Settings");
            
            ES3.Save("MusicVolume", musicVolumeSlider.value, "Settings");
            ES3.Save("SFXVolume", soundEffectsVolumeSlider.value, "Settings");

            GlobalSettings.Instance.panningSpeed = panningSlider.value;
            ES3.Save("PanningSpeed", panningSlider.value, "Settings");
            
            GlobalSettings.Instance.LoadSettings();
        }
        
        public void SetFullscreen(bool fullscreen)
        {
            isFullscreen = fullscreen;
        }
        
        public void SetPostEffects(bool isEnabled)
        {
            isPostProcessEnabled = isEnabled;
        }
        
        public void SetVSync(bool vsync)
        {
            isVSyncEnabled = vsync;
        }
        
        public void SetAntiAliasing(bool isEnabled)
        {
            isAntiAliasingEnabled = isEnabled;
        }
        
        public void SetPanningSpeed(float value)
        {
            panningSpeed = value;
        }

        public void FillLanguages()
        {
            languageDropdown.options = LocalizationManager.GetAllLanguages();
        }
    }
}