public async Task<ArgumentHandleResult> ProcessGoogleSpreadsheetsLocale(string id, [CanBeNull] string locale, bool around) {
if (string.IsNullOrWhiteSpace(id)) {
throw new InformativeException("ID is missing");
}
var url = around ? $@"http://acstuff.ru/u/around?id={id}" : $@"https://docs.google.com/spreadsheets/d/{id}/export?format=xlsx&authuser=0";
var path = await LoadRemoveFileTo(url, LocaleHelper.GetGoogleSheetsFilename());
if (string.IsNullOrWhiteSpace(path)) {
throw new InformativeException("Can’t load file");
}
SettingsHolder.Locale.LoadUnpacked = true;
if (locale != null) {
SettingsHolder.Locale.LocaleName = locale;
}
if (ModernDialog.ShowMessage("Custom locales updated. Would you like to restart app now?", "Locales Updated", MessageBoxButton.YesNo) ==
MessageBoxResult.Yes) {
WindowsHelper.RestartCurrentApplication();
}
return ArgumentHandleResult.Successful;
}