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

WIP - Number to words localisation improvements #149

Merged
merged 7 commits into from
Apr 10, 2014

Conversation

hazzik
Copy link
Member

@hazzik hazzik commented Apr 9, 2014

I'm trying to improve experience and encourage users to localise ToWords/ToOrdinalWords extension methods.

I've introduced INumberToWordsConverter:

public interface INumberToWordsConverter
{
    string Convert(int number);
    string ConvertToOrdinal(int number);
}

Also I want to clarify how shall behave untranslated converter? Shall it throw NotSupportedException or just return number.ToString()?

@hazzik
Copy link
Member Author

hazzik commented Apr 9, 2014

Related to #132

@thunsaker
Copy link
Contributor

RE: Unsupported languages - Throwing an error would just upset people using it, at least the number would still have usable code.

@hazzik
Copy link
Member Author

hazzik commented Apr 9, 2014

Yep, I do not like exceptions here as well

@@ -65,11 +65,16 @@
<AssemblyOriginatorKeyFile>Humanizer.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Compile Include="Localisation\DefaultNumberToWordsConverter.cs" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. I think we'll need to structure the Localisation folder a bit better; but good for now.

@MehdiK MehdiK merged commit 6e60aa3 into Humanizr:master Apr 10, 2014
@MehdiK
Copy link
Member

MehdiK commented Apr 10, 2014

Thanks for the great work @hazzik. I think #132 should be fixed now! It's a shame we didn't have some failing tests for it; although admittedly we never tackled it directly.

@MehdiK
Copy link
Member

MehdiK commented Apr 10, 2014

Thanks for your great contribution @hazzik. This is now released to NuGet as v1.19.1.

@hazzik hazzik deleted the number-to-words-localisation branch May 8, 2017 21:46
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

Successfully merging this pull request may close these issues.

3 participants