static void RegisterAppLanguages() { var CFBundleLocalizations = new ISD_PlistKey(); CFBundleLocalizations.Name = "CFBundleLocalizations"; CFBundleLocalizations.Type = ISD_PlistKeyType.Array; foreach (var lang in ISD_Settings.Instance.Languages) { var langItem = new ISD_PlistKey(); langItem.Type = ISD_PlistKeyType.String; langItem.StringValue = lang.Name; CFBundleLocalizations.AddChild(langItem); } ISD_API.SetInfoPlistKey(CFBundleLocalizations); }
public override void OnGUI() { SA_EditorGUILayout.Header("PLIST VALUES"); foreach (ISD_PlistKey plistKey in ISD_Settings.Instance.PlistVariables) { EditorGUILayout.BeginVertical(GUI.skin.box); DrawPlistVariable(plistKey, (object)plistKey, ISD_Settings.Instance.PlistVariables); EditorGUILayout.EndVertical(); if (!ISD_Settings.Instance.PlistVariables.Contains(plistKey)) { return; } } EditorGUILayout.Space(); EditorGUILayout.BeginVertical(GUI.skin.box); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("New Variable Name"); NewPlistValueName = EditorGUILayout.TextField(NewPlistValueName); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); if (GUILayout.Button("Add", GUILayout.Width(100))) { if (NewPlistValueName.Length > 0) { ISD_PlistKey v = new ISD_PlistKey(); v.Name = NewPlistValueName; ISD_API.SetInfoPlistKey(v); } NewPlistValueName = string.Empty; } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); EditorGUILayout.EndVertical(); }
static void RegisterAppLanguages() { //We have nothing to register, no point to add en empty CFBundleLocalizations key. if (ISD_Settings.Instance.Languages.Count == 0) { return; } var CFBundleLocalizations = new ISD_PlistKey(); CFBundleLocalizations.Name = ISD_Settings.CF_LOCLIZATIONS_PLIST_KEY; CFBundleLocalizations.Type = ISD_PlistKeyType.Array; foreach (var lang in ISD_Settings.Instance.Languages) { var langItem = new ISD_PlistKey(); langItem.Type = ISD_PlistKeyType.String; langItem.StringValue = lang.Name; CFBundleLocalizations.AddChild(langItem); } ISD_API.SetInfoPlistKey(CFBundleLocalizations); }