Base solution for your next web application
Open Closed

Rename "Current user did not login to the application" #5981


User avatar
0
xmarwin created

Hello. Is there any way how I can update the "Current user did not login to the application" error message from ABP? I couldn't find this option anywhere in the code. Thanks.

Best regards, Martin


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

    Hello ismcagdas. I followed mentioned document but unfortunately I was not able to make it work.

    This is - I guess - the essential part: Configuration.Localization.Sources.Extensions.Add( new LocalizationSourceExtensionInfo("AbpWeb", new XmlEmbeddedFileLocalizationDictionaryProvider( Assembly.GetExecutingAssembly(), "MyCompany.MyProject.Localization.Sources" ) ) );

    • I want to override this error message: "You have been logged out. Click ok to log in again". I can find it in the Abp.dll so I assume the AbpWeb should be replaced by Abp
    • I store the new translation in the same file as any other translations, so I replaced "MyCompany.MyProject.Localization.Sources" by "Adel.Portal.Localization.Portal"
    • Since this exception is raised by the Application module I put this code into the PortalApplicationModule PreInitialize method

    I tried a few more things but the above mentiones seems to me the most logical :o).

    What am I missing?

    Thanks, Martin.

  • User Avatar
    0
    ismcagdas created
    Support Team

    @xmarwin

    Could you share the code you have added to overide it ?

  • User Avatar
    0
    xmarwin created

    I have added this:

    Configuration.Localization.Sources.Extensions.Add(
    	new LocalizationSourceExtensionInfo("Abp",
    		new XmlEmbeddedFileLocalizationDictionaryProvider(
    			Assembly.GetExecutingAssembly(),
    			"Adel.Portal.Localization.Portal"
    		)
    	)
    );
    

    to the PortalApplicationModule.PreInitialize() and added new row to the Portal.xml in Adel.Portal.Core project.

    Best regards, Martin

  • User Avatar
    0
    ismcagdas created
    Support Team

    @xmarwin

    You should add a new file named Abp.xml and mark it as embedded resource.

  • User Avatar
    0
    xmarwin created

    @ismcagdas. Thanks, that did the trick. It's actually the other way round then I thought.

    The code has to be indeed added to Core, not the Application project.

    Thanks again for your help.

    Best regards, Martin.