LazZiya / XLocalizer

Localizer package for Asp.Net Core web applications, powered by online translation and auto resource creating.
https://docs.ziyad.info
129 stars 14 forks source link

? Only data annotations translation #16

Closed hrvojej closed 3 years ago

hrvojej commented 3 years ago

Hi, how can I have only data annotations translated? I want to disable culture routing but I'm unable to do it. Data annotations translation is working perfectly however. Also is there way to add custom AccessDeniedpage?

I see entry in

  <data name="Access denied" xml:space="preserve">
    <value>Pristup zabranjen</value>
    <comment>Areas/Identity/Pages/Account/AccessDenied.cshtml</comment>
  </data>

I've added custom page in Areas/Identity/Pages/Account/AccessDenied.cshtml but it's not being loaded.

LazZiya commented 3 years ago

Hi @hrvojej,

I tried to answer all your question, please let me know if you still need any more details.

how can I have only data annotations translated

Enabling/disabling translation applies for the whole app, it is not possible to enable it for specific part.

I want to disable culture routing but I'm unable to do it.

If I understand correctly, you don't want the {culture} in the url, isn't it? Actually, Asp.Net Core do ont use route based localization by default, and you can use any of the default Localization Culture Providers and everything should work fine. Additionaly, if you have followed the docs you can skip adding below route template conventions as well:

Also is there way to add custom AccessDenied page?

This is not related to XLocalizer, but I hope this post will help :)

hrvojej commented 3 years ago

Thank you for your answer! I was following this tutorial. It's bit different than your documentation.

LazZiya commented 3 years ago

You are welcome, that was for my previous project LazZiya.ExpressLocalization, it dosen't support online translation or auto resource creating. So, it is better to go with XLocalizer, and here you can find its tutorial.