/// <summary> /// Deletes a locale string resource /// </summary> /// <param name="localeStringResource">Locale string resource</param> public virtual void DeleteLocaleStringResource(LocaleStringResource localeStringResource) { Guard.IsNotNull(localeStringResource, "localeStringResource"); this.lsrRepository.Delete(localeStringResource); //cache this.cacheManager.RemoveByPattern(LOCALSTRINGRESOURCES_PATTERN_KEY); //event notification this.eventPublisher.EntityDeleted(localeStringResource); }
/// <summary> /// Adds a new translatable string resource to this JsonCulture. /// </summary> /// <param name="scriptKey">The key used to retrieve this value from clientside script.</param> /// <param name="resourceLabelKey">The key used to retrieve the translated value from global resource labels.</param> /// <returns>The translated string.</returns> private void AddResource(LocaleStringResource resource) { var resourceKeyName = resource.ResourceName; var resourceKeyValue = resourceKeyName; if (!string.IsNullOrEmpty(resource.ResourceValue)) resourceKeyValue = resource.ResourceValue; resourceKeyName = resourceKeyName.Replace(".", "_"); // hack to support javascript this.translationDict.Add(resourceKeyName, resourceKeyValue); }