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

Support specific field assignment extraction #33

Open
gluck opened this issue Jun 25, 2013 · 2 comments
Open

Support specific field assignment extraction #33

gluck opened this issue Jun 25, 2013 · 2 comments

Comments

@gluck
Copy link

gluck commented Jun 25, 2013

I'm considering Vernacular to add localization support to our (Winforms) solution.
Using Catalog.get* is easy enough, but I'm wondering if it could be further simplified for developpers, by automagically extracting some fields assignments.

For instance every assignment to Control::Text property to a string constant could be extracted.
Further down we could extract all string properties which have the attribute [Localizable(true)] (like the VS designer is doing when enabling Localizable).

If I write control.Text = "Foo", processing the assembly through Vernacular would also replace this by control.Text = Catalog.getString("Foo").

Any thoughts on this ?

@benjamin-bader
Copy link
Contributor

It's certainly feasible to do this. Take a look at AssemblyParser.cs, which is what examines DLLs for Catalog.Get* calls; it will provide a good jumping-off point. If implemented, this should take the form of a separate Parser.

As for the desirability of this feature, I personally feel that the value added by the Catalog abstraction outweighs the burden of using it. That said, I wouldn't be opposed to a good patch.

@gluck
Copy link
Author

gluck commented Jun 26, 2013

Thanks for the pointers, I was considering to make the change, but I prefer short-lived forks pulled upstream.
I'll let you know when/if/how I move forward on this.

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