Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Localized string storage, Culture set, Front-end supports. #105

Closed
yukozh opened this issue Oct 8, 2015 · 13 comments
Closed

Localized string storage, Culture set, Front-end supports. #105

yukozh opened this issue Oct 8, 2015 · 13 comments
Labels
Milestone

Comments

@yukozh
Copy link

yukozh commented Oct 8, 2015

/cc @hishamco @DamianEdwards @kirthik

  • To make a ILocalizedStringProvider and allow different ways to storage the string, such as .json like i18n did, or store these in EF. It should be writable by using the provider instance. Resx is so heavy and has a bad readability, it is hard to edit by using vs code or other editors.
  • Make a culture set, to describe a set of localized strings, and these string will be displayed when the set contains the target culture. For this, we do not need CultureList.cs anymore.
  • Make a reload or refresh function in the above interface, and we can use Reload() to reload strings when someone made some changes external. Or implement a resource listener.
  • Add a middle ware to map a javascript to ensure we can use these string in front-end.
  • Implement a RouteRequestCultureProvider if possible.

I did some works to implement these, but not based on this repo, I am too fool and cannot understand the structure of this repo. If you think my suggestions are valuable, you can have a look https://github.com/CodeComb/Localization

EF-Storage: https://github.com/CodeComb/Localization/blob/dev/src/CodeComb.AspNet.Localization/EntityFramework/EFCollection.cs

Json-Storage: https://github.com/CodeComb/Localization/blob/dev/src/CodeComb.AspNet.Localization/Json/JsonCollection.cs

Json sample:
https://github.com/CodeComb/Localization/blob/dev/test/CodeComb.AspNet.Localization.Tests/Localization/en-us.json

Javascript Localizer: https://github.com/CodeComb/Localization/blob/dev/src/CodeComb.AspNet.Localization/Extensions/LocalizationScriptMiddleware.cs

@yukozh yukozh changed the title Some suggestions. Localized string storage, Cultures set, Front-end supports. Oct 8, 2015
@yukozh yukozh changed the title Localized string storage, Cultures set, Front-end supports. Localized string storage, Culture set, Front-end supports. Oct 8, 2015
@hishamco
Copy link
Contributor

hishamco commented Oct 9, 2015

@kagamine If i'm not wrong I saw an issue related to what you said before. The guy using the localization repo to store the key/value in database instead of resx file.
I will look for that issue and get back to you

@danroth27 danroth27 added the task label Oct 13, 2015
@danroth27 danroth27 added this to the 1.0.0-rc1 milestone Oct 13, 2015
@danroth27
Copy link
Member

We should look at providing some more samples that shows how to use alternative localized resource providers, like a DB.

@hishamco
Copy link
Contributor

@danroth27 should this will be included in the docs too or just in the sample? If there's a possibility to send a PR for this I will do ..

@danroth27
Copy link
Member

@Eilon is going to look at putting a sample together first and then we can look at documenting the recommended patterns.

@yukozh
Copy link
Author

yukozh commented Oct 14, 2015

What's your view about the other lines in this issue such as frontend support? @danroth27

@hishamco
Copy link
Contributor

I was thinking to send a PR for this, but if @Eilon will create the sample, this is fine

@Eilon Eilon modified the milestones: 1.0.0-rc1, 1.0.0-rc2 Oct 22, 2015
@hishamco
Copy link
Contributor

hishamco commented Nov 3, 2015

@Eilon I created a sample that uses EF as data source can I make a PR for that or you have another strategy to do it?

@hishamco
Copy link
Contributor

hishamco commented Nov 3, 2015

@kagamine regrading your points:
1- The current implementation is open, simply you can implement IStringLocalizer and IStringLocalizerFactory so the storage could be database, json .. name it
2- CultureList.cs is not there anymore after the design change in issue #111
3- Implement such a resource monitor may has side effect
4- According RouteRequestCultureProvider I already suggest DomainRequestCultureProvider which is in backlog

@hishamco
Copy link
Contributor

@kagamine I made a PR #149 to use EntityFramework as localization source, hopefully you will get the idea how to use IStringLocalizer & IStringLocalizerFactory without changing the core APIs

@yukozh
Copy link
Author

yukozh commented Nov 16, 2015

@hishamco Please do not at me anymore, I just want to listen to the official replies. Thanks.

@hishamco
Copy link
Contributor

Sorry, but the latest two posts answers what you asking for?!!

@yukozh
Copy link
Author

yukozh commented Nov 16, 2015

I don't care about this anymore. I have not used the Localization package which released by Microsoft.

@hishamco
Copy link
Contributor

Strange if you don't care why you post this issue?!!

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

No branches or pull requests

5 participants