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

Can I have an option to automatically add the key into the LocationRecord table? #30

Closed
stanleychen opened this issue Mar 19, 2017 · 4 comments

Comments

@stanleychen
Copy link

It would be nice if I can have an option to add the key into the LocationRecord table if it is not found. There are many keys need to manually add into the table for a new application, I am a kind of lazy to do that.

@damienbod
Copy link
Owner

damienbod commented Mar 19, 2017

great idea, thanks

@stanleychen
Copy link
Author

Thanks for reply. I can help to implement this as I need it for my project but I am struggling which class should I put this AddNewKey method.

I tried to put it inside the SqlStringLocalizer but I couldn't find an easy way to pass in the DbConext.

It would help if you can shed some light on this?

@damienbod
Copy link
Owner

@stanleychen sorry for the delay, I will address this, been busy.

https://github.com/damienbod/AspNet5Localization/blob/master/src/Localization.SqlLocalizer/SqlLocalizationServiceCollectionExtensions.cs#L64

We could do it something like the above extension.

Greetings Damien

@damienbod
Copy link
Owner

damienbod commented May 11, 2017

Implemented this feature now

https://github.com/damienbod/AspNet5Localization/tree/feature-branch

@stanleychen @ericbrunner
I add a new record everything a resource is not found for the configuration in the startup, even if the culture is not supported. This feature should only be used in development.

https://github.com/damienbod/AspNet5Localization/blob/feature-branch/src/AspNetCoreLocalization/Startup.cs#L30

https://github.com/damienbod/AspNet5Localization/blob/feature-branch/src/AspNetCoreLocalization/Startup.cs#L58

good, bad, view?

Greetings Damien

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

No branches or pull requests

2 participants