Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

missing translation for exception message #6635


User avatar
0
alexanderpilhar created

It seems there is no translation for exception-messages thrown because of missing features (I can't find it in localization files):


6 Answer(s)
  • User Avatar
    0
    ryancyq created
    Support Team

    Hi, is the feature provided by ANZ? This was done at https://github.com/aspnetzero/aspnet-zero-core/blob/f72d4bf9ced778e06265f1c415a8553b10cbaf3d/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Core/Features/AppFeatureProvider.cs#L16-L17

    If you were to create your own feature, you need to define the corresponding translation yourselves.

  • User Avatar
    0
    alexanderpilhar created

    H @ryancyq! No, it's none of the features provided by ANZ but one of my custom features coming from a custom feature provider. I used RequiresFeature attribute as described here: Using RequiresFeature Attribute

    When I call a service method that requires a certain feature using a user lacking of certain feature, I get above message - it works correct, it's just not translated properly. Not just the feature name (which is not translated at all but showing the translation-key), but the whole message is in English but should be in German.

    I think, permission checker might work quite similar - there are no issues with permission checker. Also, I can find according translations in localization files for permssion checker. But not for feature checker.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @alexanderpilhar

    The Feature is not important here. This exception message is coming from ABP Framework, see https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp/Application/Features/FeatureCheckerExtensions.cs#L229

  • User Avatar
    0
    alexanderpilhar created

    Hi @ismcagdas! So, it is not translated, right?

  • User Avatar
    1
    ismcagdas created
    Support Team

    @alexanderpilhar, yes you are right. You can create an issue on ABP repository for that if you want to.

  • User Avatar
    0
    alexanderpilhar created

    Thank you @ismcagdas!

    Created Issue: [FeatureChecker should make use of Localization when throwing AbpAuthorizationException #4365](https://github.com/aspnetboilerplate/aspnetboilerplate/issues/4365)