Beispiel #1
0
        void Import_CSV(string FileName, eSpreadsheetUpdateMode UpdateMode)
        {
            LanguageSource source    = (LanguageSource)target;
            string         CSVstring = LocalizationReader.ReadCSVfile(FileName);

            char   Separator = mProp_Spreadsheet_LocalCSVSeparator.stringValue.Length > 0 ? mProp_Spreadsheet_LocalCSVSeparator.stringValue[0] : ',';
            string sError    = source.Import_CSV(string.Empty, CSVstring, UpdateMode, Separator);

            if (!string.IsNullOrEmpty(sError))
            {
                ShowError(sError);
            }

            LocalizationEditor.mSelectedCategories = source.GetCategories();
            mShouldDetectStoreIntegration          = true;
        }
        void Import_CSV(string FileName, eSpreadsheetUpdateMode UpdateMode)
        {
            LanguageSource source   = (LanguageSource)target;
            var            encoding = System.Text.Encoding.GetEncoding(mProp_Spreadsheet_LocalCSVEncoding.stringValue);

            if (encoding == null)
            {
                encoding = System.Text.Encoding.UTF8;
            }
            string CSVstring = LocalizationReader.ReadCSVfile(FileName, encoding);

            char   Separator = mProp_Spreadsheet_LocalCSVSeparator.stringValue.Length > 0 ? mProp_Spreadsheet_LocalCSVSeparator.stringValue[0] : ',';
            string sError    = source.Import_CSV(string.Empty, CSVstring, UpdateMode, Separator);

            if (!string.IsNullOrEmpty(sError))
            {
                ShowError(sError);
            }

            mSelectedCategories = source.GetCategories();
        }