I have a good number of translation classes in a project. Some of them has UseResource attributes, like the following:
[LocalizedResource]
[TsInterface]
public class AResourceClass
{
public string LabelOne { get; set; } = "An English text";
[UseResource(typeof(GlobalResources), nameof(GlobalResources.ASharedLabel))]
public string LabelTwo { get; set; }
}
If I call _localizationProvider.Translate<AResourceClass>(), then LabelOne will have a value, while LabelTwo will be null.
But explicitly requesting only the LabelTwo property, like the following, returns the expected string:
_localizationProvider.GetString(_resourceKeyBuilder.BuildResourceKey(typeof(AResourceClass), nameof(AResourceClass.LabelTwo)))
I have a good number of translation classes in a project. Some of them has UseResource attributes, like the following:
If I call
_localizationProvider.Translate<AResourceClass>()
, then LabelOne will have a value, while LabelTwo will benull
.But explicitly requesting only the LabelTwo property, like the following, returns the expected string:
_localizationProvider.GetString(_resourceKeyBuilder.BuildResourceKey(typeof(AResourceClass), nameof(AResourceClass.LabelTwo)))
Package version: