Skip to content

How to update only one language #5

@elincognito

Description

@elincognito

Hi great work however i am facing a difficulty using OrangeJetpack.Localization i am sending to my frontend the localized object, and the frontend will send an PUT/POST request meaning i will only update some localized properties for a specific language i tried to do it like this:

           var state = db.States.FirstOrDefault(s => s.Id == st.Id);


            LocalizedContent[] name = {
                new LocalizedContent(lang, st.Name), 
            };


            state.Set(p => p.Name, name);


            AddOrUpdate(db, state);

            db.SaveChanges();

however this approach will remove any other languages from the Name attribute json

maybe add a version of set like
Set(property, value, lang)that would replace only that value on the json dictionary would be enough

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions