Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended example #1

Closed
span opened this issue Mar 14, 2018 · 5 comments
Closed

Extended example #1

span opened this issue Mar 14, 2018 · 5 comments

Comments

@span
Copy link

span commented Mar 14, 2018

Hi!

This looks like an amazing extension that hides the complexity of data translations very well. I found this after reading the articles posted here https://oncodedesign.com/tag/localization/.

It is not clear to me how to set this up from scratch using code first. There is a reference to a Language class and a table so I presume I need to create that entity.

Then the README says that I can change keys to an LCID key but it is not clear how it relates to the id in the Language class and the naming conventions used for the translation entities.

I will dabble around a bit and if I get something working I'll write up a more newbie-friendly example (if I get it working) unless someone else does not have time to do it first ;)

@popcatalin81
Copy link
Member

@span have a look at the unit tests, they have all the configuration needed:

https://github.com/iQuarc/DataLocalization/blob/master/src/iQuarc.DataLocalization.Tests/UnitTests/CultureKeyMappingTests.cs

https://github.com/iQuarc/DataLocalization/blob/master/src/iQuarc.DataLocalization.Tests/UnitTests/QueryTranslationTests.cs

If something is not clear after this, please let me know and I will write a more detailed tutorial.

@span
Copy link
Author

span commented Mar 15, 2018

Thank you, those examples helped me get started. I am setting up a small sample project with real database connections from which I can put together a more extensive step by step tutorial. I thought I'd publish it on my blog and if you want it in the README once it is finished i'll be more then happy to provide a pull request.

I'll leave this open for now (please close if you prefer) and I'll open a new ticket for an issue I am having when trying to localize a list of entities in a many to one relationship.

@popcatalin81
Copy link
Member

popcatalin81 commented Mar 15, 2018

@span Thank you, that would be highly appreciated! If you've encountered an issue please open a ticket with repro details if possible.

@span
Copy link
Author

span commented Mar 17, 2018

I've added an extended example on my blog here: https://danielkvist.net/code/simple-data-localisation-with-net-core-and-iquarc-datalocalization-from-scratch-part-4-add-data-localisation-for-models-using-iquarc-datalocalization

I'll update the entities to match Product and Category for an extended README example if you want it but some feedback would be great first.

@popcatalin81
Copy link
Member

popcatalin81 commented Mar 17, 2018

That is really awesome. Really appreciate the time you took to do this.

The tutorial looks really good and detailed. There's no need for a readme. I will link to your blog directly. Maybe the one thing I would add is a small paragraph explaining the TranslationFor attribute as a required configuration, otherwise I think it makes everything very clear.

Thank you,
Cata

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants