/// <summary>
 /// Sets translation state.
 /// </summary>
 /// <param name="translation">Translation.</param>
 public void SetIsTranslationChanged(Entity translation)
 {
     TranslationProvider.ReadChangedTranslationColumnsValues(translation,
                                                             (key, value, cultureIndex, modifiedOn) => {
         SetIsChanged(translation, cultureIndex);
     });
 }
        /// <summary>
        /// Actualizes localizable values.
        /// </summary>
        public void ActualizeLocalizableValues()
        {
            OnLocalizableValuesActualizationStart();
            List <ISysCultureInfo> sysCulturesInfo = SysCultureInfoProvider.Read();

            TranslationErrorHandler?.ResetErrors();
            TranslationProvider.ReadChangedTranslations(sysCulturesInfo, WriteLocalizableValue);
            TranslationErrorHandler?.SaveErrors(_erroneousRecords);
            TranslationProvider.ResetChangedTranslationsState(sysCulturesInfo);
            ResourceProvider.Actualize();
            OnLocalizableValuesActualizationEnd();
        }
 /// <summary>
 /// Actualizes translation.
 /// </summary>
 /// <param name="actualizeFrom">The date to start actualization from.</param>
 public void ActualizeTranslation(DateTime actualizeFrom)
 {
     if (CurrentActualizationStatus == ActualizationStatus.InProgress)
     {
         while (CurrentActualizationStatus == ActualizationStatus.InProgress)
         {
             Thread.Sleep(500);
         }
         TranslationLogger.Info(TranslationActualizationSkipMessage);
     }
     else
     {
         OnTranslationActualizationStart(actualizeFrom);
         try {
             TranslationProvider.Transaction(() => {
                 InternalActualizeTranslation(actualizeFrom);
             });
         } finally {
             OnTranslationActualizationEnd();
         }
     }
 }
        /// <summary>
        /// Saves translation.
        /// </summary>
        private void WriteTranslation(ILocalizableItem item)
        {
            ISysCultureInfo sysCultureInfo = SysCultureInfoProvider.Read(item.CultureId);

            TranslationProvider.WriteTranslation(item.Key, sysCultureInfo.TranslationColumnName, item.Value);
        }