зеркало из https://github.com/aspnet/Localization.git
* Default ResourcePath behavior is to look next to .cs file
This commit is contained in:
Родитель
0b013ae769
Коммит
5074bf0c57
|
@ -67,7 +67,9 @@ namespace Microsoft.Extensions.Localization
|
|||
var typeInfo = resourceSource.GetTypeInfo();
|
||||
var assembly = typeInfo.Assembly;
|
||||
|
||||
var baseName = _applicationEnvironment.ApplicationName + "." + _resourcesRelativePath + typeInfo.FullName;
|
||||
var baseName = string.IsNullOrEmpty(_resourcesRelativePath)
|
||||
? typeInfo.FullName
|
||||
: _applicationEnvironment.ApplicationName + "." + _resourcesRelativePath + typeInfo.FullName;
|
||||
|
||||
return _localizerCache.GetOrAdd(baseName, _ =>
|
||||
new ResourceManagerStringLocalizer(
|
||||
|
|
|
@ -118,6 +118,6 @@
|
|||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Hello" xml:space="preserve">
|
||||
<value>Bonjour from Customer in root folder</value>
|
||||
<value>Bonjour from Customer in Models folder</value>
|
||||
</data>
|
||||
</root>
|
|
@ -77,7 +77,7 @@ namespace Microsoft.AspNet.Localization.FunctionalTests
|
|||
applicationBaseUrl,
|
||||
"ResourcesAtRootFolder",
|
||||
"fr-FR",
|
||||
"Bonjour from StartupResourcesAtRootFolder Bonjour from Test in root folder Bonjour from Customer in root folder");
|
||||
"Bonjour from StartupResourcesAtRootFolder Bonjour from Test in root folder Bonjour from Customer in Models folder");
|
||||
}
|
||||
|
||||
[ConditionalFact]
|
||||
|
@ -92,7 +92,7 @@ namespace Microsoft.AspNet.Localization.FunctionalTests
|
|||
"http://localhost:5076",
|
||||
"ResourcesAtRootFolder",
|
||||
"fr-FR",
|
||||
"Bonjour from StartupResourcesAtRootFolder Bonjour from Test in root folder Bonjour from Customer in root folder");
|
||||
"Bonjour from StartupResourcesAtRootFolder Bonjour from Test in root folder Bonjour from Customer in Models folder");
|
||||
}
|
||||
|
||||
[ConditionalFact]
|
||||
|
@ -107,7 +107,7 @@ namespace Microsoft.AspNet.Localization.FunctionalTests
|
|||
"http://localhost:5077/",
|
||||
"ResourcesAtRootFolder",
|
||||
"fr-FR",
|
||||
"Bonjour from StartupResourcesAtRootFolder Bonjour from Test in root folder Bonjour from Customer in root folder");
|
||||
"Bonjour from StartupResourcesAtRootFolder Bonjour from Test in root folder Bonjour from Customer in Models folder");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче