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

Humanize pt-PT problem #601

Closed
sirfilipef opened this issue Dec 6, 2016 · 3 comments
Closed

Humanize pt-PT problem #601

sirfilipef opened this issue Dec 6, 2016 · 3 comments

Comments

@sirfilipef
Copy link

sirfilipef commented Dec 6, 2016

Doesn't work
new TimeSpan(0,1,0,0).Humanize(culture: new CultureInfo("pt-PT"));

Works
new TimeSpan(0,1,0,0).Humanize(culture: new CultureInfo("pt-BR"));

Any ideias?

@hangy
Copy link
Contributor

hangy commented Dec 6, 2016

So for some reason, the resource file Resources.pt.resx is in Portuguese, but the formatter is only registered for Brazilian Portuguese. If you can confirm that the translations in Resources.pt.resx are correct for Portuguese in general (not just in Brazil), then the change is really easy.

@sirfilipef
Copy link
Author

Ok I will check it out tomorrow, probably it will be the same.

@sirfilipef
Copy link
Author

i confirm the translations in Resources.pt.resx are correct for Portuguese in general

hangy added a commit to hangy/Humanizer that referenced this issue Dec 7, 2016
According to Humanizr#601, the localisation is good for
Portuguese in general, not just for Brazilian Portuguese.
I copied the unit test, so that we can prove that there's no regression.

Additionally, I copied the `OrginalizeTests`, because those were
already registered as "pt", not "pt-BR".

Note that `NumberToWords` is still only valid for pt-BR unless confirmed
otherwise.
ogsilvaa pushed a commit to ogsilvaa/Humanizer that referenced this issue Sep 12, 2017
* Add Esperanto support to NumberToWords. Fixes Humanizr#558

* Fixed incorrect locale in readme

For example on `ToOrdinalWords` the Arabic example was incorrectly listed as 'Brazilian Portuguese'

* Pass through the content of the "Letter, other" Unicode category.

fixes Humanizr#578

* Fix misspelling

Fixed misspelling of "Uper" to "Upper".

* added translation for DateHumanize_Now

* update for latest gv config

* Add resource validation for DefaultFormatter to prevent  "Value cannot be null." exception on the .NET format.

* Fix missing format value for the argument exception.

* Validate resource key before using .FormatWith extension.

* Use string interpolation beside string format.

* Add summary for DefaultFormatter.

* temp disable gitlink

* Fix CONTRIBUTING.md of broken links.

* Squashed commit of the following:

commit f9423de
Author: hangy <hangy@hangy.de>
Date:   Thu Dec 1 20:48:01 2016 +0100

    Update TimeSpanHumanizeTests.cs

commit 2e5dfe5
Author: hangy <hangy@hangy.de>
Date:   Thu Dec 1 20:37:50 2016 +0100

    Apparently I'm stupid and 7 days actually get humanized as 1 week.

commit 152a119
Author: hangy <hangy@hangy.de>
Date:   Wed Nov 30 23:50:51 2016 +0100

    Workaround for unneeded suffix: Just use the same value.

    The reason for this workaround is that at the method that decides if the suffix should be applied, the information about the time unit is not available. So it would either need to do some string magic and explicitly exclude the "TimeSpanHumanize_MultipleDays" resource key from adding the postfix, or most of the `TimeSpan` formatting code would need to be rewriten for Croatian or modified for all languages to support Croatian. Neither seems reasonable for a quick change.

commit 002cc7b
Author: hangy <hangy@hangy.de>
Date:   Wed Nov 30 23:12:57 2016 +0100

    Added some more tests. From what I've read, all days should resolve to "dana" for the Croatian language. (No "_DualTrialQuadral" postfix.")

commit c190e9d
Author: hangy <hangy@hangy.de>
Date:   Tue Nov 22 00:29:51 2016 +0100

    Add initial test for issue 597.

* fix cmd build

* update packages

* Revert "Add Esperanto support to NumberToWords. Fixes Humanizr#558"

* Add Authenticode signing to binaries

* install signclient package

* Register Portuguese TimeSpan localisation as "pt".

According to Humanizr#601, the localisation is good for
Portuguese in general, not just for Brazilian Portuguese.
I copied the unit test, so that we can prove that there's no regression.

Additionally, I copied the `OrginalizeTests`, because those were
already registered as "pt", not "pt-BR".

Note that `NumberToWords` is still only valid for pt-BR unless confirmed
otherwise.

* Syntax correction in readme.md

Very minor correction to the syntax. Named parameters require a :, not a =. 

(I found this when I copy/pasted the code and it didn't work without changes)

* Added test to reproduce issue

* Handles issue without try-catch

Utilize null-checks to verify there is a description in the enums
display attribute

* Added whitespace before if-statement

Added a whitespace before if-statement

* adding parameter decimals toMetric(). See issue Humanizr#609

* Added Sweedish collection formatter

* issue 611: added the method Kebaberize

* removed a comment and an empty char

* Update readme.md

* Update to VS 2017

* remove file from root

* gv

* update CS url

* appveyor

* clean code a bit

I am not sure about the line 12. I think the difference between both is more clear like this.

* Revert "clean code a bit"

This reverts commit eb110e5.

* IsDefined is prefered

`IsDefined` won't loop through all the attributes.
Just saying, didn't bench it.

* Latvian localization

Thanks to Līva Miltuze for help with translation.

* Create Humanizer.Core.lv.nuspec

* Update Humanizer.sln

* Update Humanizer.old.csproj

* Implemented TimeSpan Humanize extension method for TimeUnit.Month and TimeUnit.Year with translations.

* Readme updated.

* Changes in csproj reverted.

* Test for uniqueness of day sequences added.

* Include LV in main package

* remove old project file

* Build script updates

* Add sourcelink

* fix sign client syntax

* Add support for long to ToQuantity

* Update Number to words to take a long

* Add long.ToQuantity(ShowQuantityAs.Words)

* Add extra public method for int and long

* Update public_api_approved.txt

* Add tests for long.ToWords() and update XML comment

* Removing out of range test, correcting names of large numbers

* update to long

* fix merge

* Add ToOrdinalWords extension with gender overload

* Use localisation for ToOrdinalWords to allow for localised implementation and add readme section

* Update XML docs for DateToOrdinalWords

* VS...grr.

* pdb is embedded now

* Incorporated review comments by @khellang, @M-Zuber, @jeremymeng. Marked reviewed language with "Native speaker". Marked 'sv' as reviewed even confirmation is pending.

* Marked confirmed translations with "Native speaker".

* Update xUnit and fix test overload issue

* Added greek language resources as per #pr632

* v2.2 release notes

* Update package
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