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

Problems with T4 code generation #169

Closed
anoehre opened this issue Apr 10, 2014 · 3 comments · Fixed by #171
Closed

Problems with T4 code generation #169

anoehre opened this issue Apr 10, 2014 · 3 comments · Fixed by #171
Labels

Comments

@anoehre
Copy link
Contributor

anoehre commented Apr 10, 2014

I would like to contribute some ideas in the fluent date section.
Unfortunately I have some problems runnning the T4 Templates.

After running the "In.SomeTimeFrom" template the classes look like:
public static class 1 {}
instead of
public static class One {}

Obviously this line in the template doesn't work on my machine:
public static class <#= i.ToWords().Dehumanize() #>

What might be the problem here?

@MehdiK
Copy link
Member

MehdiK commented Apr 10, 2014

Thanks for reporting this.

On the top of the T4 there is a reference to <#@ assembly name="$(SolutionDir)Humanizer\bin\Debug\Humanizer.dll" #>. So for this to work you have to have compiled your code at least once and with Debug Build Configuration so that dll can be found at that path. Have you done this?

@anoehre
Copy link
Contributor Author

anoehre commented Apr 10, 2014

Yes, I already checked that. The dll exists, the path is correct.
Is english the default? I am asking because my dev machine is a german OS with german VS.

@MehdiK MehdiK added the bug label Apr 10, 2014
@MehdiK
Copy link
Member

MehdiK commented Apr 10, 2014

Do'h!! This is something we changed only a few hours ago in #149. Basically before we were defaulting to English when the culture didn't match, and now we're not and instead return the plain number.

Here is how we can fix this, and a PR would be really appreciated on it.

Change EnglishNumberToWordsConverter to public and change the T4 to hit that class directly instead of going through ToWords. Alternatively you could change the culture to English before the call so it's routed properly to where it should.

Thanks for finding and reporting this :)

anoehre added a commit to anoehre/Humanizer that referenced this issue Apr 10, 2014
anoehre added a commit to anoehre/Humanizer that referenced this issue Apr 10, 2014
anoehre added a commit to anoehre/Humanizer that referenced this issue Apr 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants