public JsonLocalizationDictionary( Stream resourceStream, string filePath, IParentScopeResolver parentScopeResolver, ILogger logger = null ) : this(resourceStream, logger) { m_parentScopeName = m_parentScopeName ?? parentScopeResolver?.ResolveParentScope(filePath); var filePathWithoutExtension = Path.ChangeExtension(filePath, ""); var pluralizedFilePath = string.Concat(filePathWithoutExtension, PluralJPath, ".", JsonExtension); if (!File.Exists(pluralizedFilePath)) { return; } using (var fileStream = new FileStream(pluralizedFilePath, FileMode.Open, FileAccess.Read)) { m_jsonPluralizedDictionary = LoadDictionaryJObject(fileStream, pluralizedFilePath); } var cultureString = (string)m_jsonPluralizedDictionary[CultureJPath]; if (!m_cultureInfo.Equals(new CultureInfo(cultureString))) { var message = string.Format( @"Culture in pluralized version of dictionary ""{0}"" does not match expected value. Expected value is ""{1}""", filePath, m_cultureInfo.Name); if (m_logger != null && m_logger.IsErrorEnabled()) { m_logger.LogError(message); } throw new DictionaryLoadException(message); } }
public JsonLocalizationDictionary( Stream resourceStream, string filePath, IParentScopeResolver parentScopeResolver, ILogger logger = null ) : this(resourceStream, logger) { m_parentScopeName = m_parentScopeName ?? parentScopeResolver?.ResolveParentScope(filePath); }