Translation of NGUI Popup List

More
9 years 10 months ago #124 by exiin
Hello,
I've made a small script that link the popup list of NGUI and I2 Localization, But I have an Issue get the data back.
I was wondering if you have a function that do the inverse of ScriptLocalization. Get (); ?

Or maybe there is already a script that handles translation of popup list ?
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using I2.Loc;

public class NGUIPopupListI2Localize : MonoBehaviour {
	UIPopupList mList;
	// Use this for initialization
	void Start ()
	{
		Init();
	}
	// ADD Init in the 'onchange' of the Language dropDown
	public void Init() {
		mList = GetComponent<UIPopupList> ();

		string currentValue = mList.value;
		List<string> currentItems =  mList.items.GetRange(0, mList.items.Count);
		
		mList.items.Clear (); 

		currentItems.ForEach (
			delegate(string Key) { 			 
			mList.items.Add(ScriptLocalization.Get(Key));			
			}
		); 

		mList.value =  ScriptLocalization.Get(currentValue);

	} 
}

Please Log in or Create an account to join the conversation.

Time to create page: 0.136 seconds
Template by JoomlaShine