Open Closed

Localization on WPF Application #5066


User avatar
0
jim created

Hello everyone, I have question regarding on application of Localization on my Wpf client. I have microservices, which my wpf client connected through client proxy. I wanted to reuse my localization on my shared domain on one of my service to put it out on my wpf application. Do you have any article explaining oh how can we utilized it? Thanks in advance.

  • ABP Framework version: v7.0.2
  • UI type: WPF
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace: An exception was thrown while activating Microsoft.Extensions.Localization.StringLocalizer1 [[CmvPoint.ContactService.Localization.ContactServiceResource, CmvPoint.ContactService.Domain.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] -> Volo.Abp.Localization.AbpStringLocalizerFactory -> Volo.Abp.AspNetCore.Mvc.Client.RemoteExternalLocalizationStore.

Inner Exception

Autofac.Core.DependencyResolutionException: None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Volo.Abp.AspNetCore.Mvc.Client.RemoteExternalLocalizationStore' can be invoked with the available services and parameters: Cannot resolve parameter 'Volo.Abp.AspNetCore.Mvc.Client.ICachedApplicationConfigurationClient configurationClient' of constructor 'Void .ctor(Volo.Abp.AspNetCore.Mvc.Client.ICachedApplicationConfigurationClient, Microsoft.Extensions.Options.IOptions1[Volo.Abp.Localization.AbpLocalizationOptions])'. at Autofac.Core.Activators.Reflection.ReflectionActivator.<>c__DisplayClass12_0.<UseSingleConstructorActivation>b__0(ResolveRequestContext ctxt, Action1 next) at Autofac.Core.Resolving.Middleware.DelegateMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt) at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt) at Autofac.Builder.RegistrationBuilder3.<>c__DisplayClass41_0.<PropertiesAutowired>b__0(ResolveRequestContext ctxt, Action1 next) at Autofac.Core.Resolving.Middleware.DelegateMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt) at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next)

  • Steps to reproduce the issue:"

The steps I've taken:

  1. Referenced my Service Domain Shared to my WPF Application
  2. Added typeof(AbpLocalizationModule) on my WPF Module
  3. Configure AbpLocalization Option on my ConfigureServices function: Configure<AbpLocalizationOptions>(options => { options.Resources .Add<ContactServiceResource>("en"); });

*** Note that the ContactServiceResource Referenced to my Contact Service on my Abp.

  1. Then initialized a IStringLocalizer on my view Model

private IStringLocalizer<ContactServiceResource> _localizer => GetService<IStringLocalizer<ContactServiceResource>>();

  1. Then use like var test = _localizer["HelloWorld"];

5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please share this WPF project, Thanks

    liming.ma@volosoft.com

  • User Avatar
    0
    jim created

    Hello maliming, Can we have a remote instead?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Your steps is simple so please share the project. Thanks

    liming.ma@volosoft.com

  • User Avatar
    0
    jim created

    Hi

    Thank you for your prompt response to my previous inquiry regarding the issue I encountered with Localization. I appreciate your willingness to assist.

    Despite the fact that I recognize how crucial it is to make the source code available for debugging, I want to inform you that my project's source code is restricted.

    If so, Are you able to have a short time meeting for remote session instead? or can you provide an example implementation on it with WPF, and send me through jimwellbuot@gmail.com email? Thank you!

    Have a great day!

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Your use case is not standard. So it's hard to find the reason in a short time. That's why I request the source code.

    You can create a new app-pro template, add your WPF code to reproduce the problem, and then share it. : )

    liming.ma@volosoft.com

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11