public void InitializeCultureCollections(bool reloadAllCultures = false)
        {
            if (reloadAllCultures)
            {
                allCultures = SmartCultureInfoEx.Deserialize(LocalizationWorkspace.CultureInfoCollectionFilePath());
            }

            availableCultures    = LanguageHandlerEditor.CheckAndSaveAvailableLanguages(allCultures);
            nonAvailableCultures = LanguageHandlerEditor.GetNonAvailableLanguages(allCultures);

            availableCultures.cultureInfos.Sort((a, b) =>
            {
                return(a.englishName.CompareTo(b.englishName));
            });
            nonAvailableCultures.cultureInfos.Sort((a, b) =>
            {
                return(a.englishName.CompareTo(b.englishName));
            });

            availableCultures.cultureInfos.Insert(0, new SmartCultureInfo(string.Empty, "ROOT", "ROOT", false));

            languageListAdaptor     = new SmartCultureInfoListAdaptor(availableCultures.cultureInfos, DrawAvailableLanguageItem, 28);
            languageListContextMenu = new SmartCultureInfoMenuControl();

            createListAdaptor     = new CreateLanguageListAdaptor(nonAvailableCultures.cultureInfos, DrawCreateLanguageItem, 15);
            createListContextMenu = new CreateLanguageMenuControl();

            settingsAdaptor     = new SettingsListAdaptor(settingsList, DrawSettingsItem, 110);
            settingsContextMenu = new SettingsMenuControl();
        }
        protected override bool HandleCommand(string commandName, int itemIndex, IReorderableListAdaptor adaptor)
        {
            SmartCultureInfoListAdaptor smartAdaptor = adaptor as SmartCultureInfoListAdaptor;

            if (smartAdaptor == null)
            {
                return(false);
            }

            switch (commandName)
            {
            case "Translate":
                OnTranslateClick(smartAdaptor.GetCultureInfo(itemIndex));
                return(true);

            case "Update":
                OnUpdateClick(smartAdaptor.GetCultureInfo(itemIndex));
                return(true);

            case "Export":
                OnExportClick(smartAdaptor.GetCultureInfo(itemIndex));
                return(true);
            }

            return(false);
        }
        protected override void OnItemRemoving(ItemRemovingEventArgs args)
        {
            SmartCultureInfoListAdaptor smartAdaptor = args.adaptor as SmartCultureInfoListAdaptor;

            if (smartAdaptor == null)
            {
                return;
            }

            SmartCultureInfo info = smartAdaptor.GetCultureInfo(args.itemIndex);

            if (EditorUtility.DisplayDialog("Delete " + info.englishName + "?",
                                            "Are you sure you want to delete " + info.englishName + " and all of its content from the project? You cannot undo this action.",
                                            "Yes, delete it.", "Cancel"))
            {
                LanguageHandlerEditor.DeleteLanguage(info);
                base.OnItemRemoving(args);
            }
            else
            {
                args.Cancel = true;
            }
        }