Welcome, Guest
Username: Password: Remember me

TOPIC: Translation of NGUI Popup List

Translation of NGUI Popup List 4 years 10 months ago #124

  • exiin
  • exiin's Avatar
  • Offline
  • New Member
  • Posts: 1
  • Karma: 0
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);

	} 
}
The administrator has disabled public write access.
Time to create page: 0.111 seconds
Template by JoomlaShine