GithubHelp home page GithubHelp logo

Comments (13)

hishamco avatar hishamco commented on July 20, 2024

I think you mean SharedResource? If YES I'm not sure if I wrote a sample or unit tests for that, but I think it's doable

from my.extensions.localization.json.

vovanb avatar vovanb commented on July 20, 2024

the idea is to put all translations in one single json file and use it from all pages

from my.extensions.localization.json.

hishamco avatar hishamco commented on July 20, 2024

Yah!! that's what I meant before, hope to create a sample for that if it's not exist

from my.extensions.localization.json.

hishamco avatar hishamco commented on July 20, 2024

If you wanna to try it, it's my pleasure to accept your PR

from my.extensions.localization.json.

vovanb avatar vovanb commented on July 20, 2024

I would be happy to make changes, but can you please point where from to start?

from my.extensions.localization.json.

hishamco avatar hishamco commented on July 20, 2024

@vovanb after revising the code, what you asking for is already implemented, please have a look to LocalizationSample, there's a fr-FR.json which contains a shared resources that can be accessible through IStringLocalizer

from my.extensions.localization.json.

vovanb avatar vovanb commented on July 20, 2024

not sure I fallow you. I see exist two resources fr-FR.json and Startup.fr-FR.json. I want to use in all MVC pages ( Layout,Index) singe file. So what step I need to perform?

from my.extensions.localization.json.

hishamco avatar hishamco commented on July 20, 2024
  1. Create a json file per culture

  2. Add all of your localization resources

  3. Access them using IStringLocalizer

That is it!!

from my.extensions.localization.json.

vovanb avatar vovanb commented on July 20, 2024

I tried in index.cshtml to use
@Inject IStringLocalizer Localizer instead of
@Inject IViewLocalizer Localizer
but got not found exception ... and once I added reference to @using Microsoft.Extensions.Localization; I got can not load exception

from my.extensions.localization.json.

hishamco avatar hishamco commented on July 20, 2024

No no .. you can replace IViewLocalizer with IStringLocalizer, instead use it in your controller or page model

Let me have a look ...

from my.extensions.localization.json.

hishamco avatar hishamco commented on July 20, 2024

@vovanb it was a regression bug, could you please try the single-resource-file before I merge?

from my.extensions.localization.json.

hishamco avatar hishamco commented on July 20, 2024

@vovanb any updates?

from my.extensions.localization.json.

hishamco avatar hishamco commented on July 20, 2024

I will close this one while there's no update from the author

from my.extensions.localization.json.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.