Skip to content

Conversation

@obecker
Copy link
Contributor

@obecker obecker commented Sep 7, 2021

… a list of durations

Fix for the logic that adjusts the german grammatical case for some units in
the decorate and decorateUnrounded methods.
The new logic replaces all occurrences of words that need to be adjusted in the
translated time string, the old logic did this only for single durations.

This should also fix issue #220, because the new logic simply replaces plural words
and doesn't check if the duration is a plural duration.

Contains also a minor improvement in SimpleTimeFormat.isPlural() that prevents
computing the same number twice.

…matting a list of durations

Fix for the logic that adjusts the german grammatical case for some units in
the `decorate` and `decorateUnrounded` methods.
The new logic replaces all occurrences of words that need to be adjusted in the
translated time string, the old logic did this only for single durations.

This should also fix issue ocpsoft#220, because the new logic simply replaces plural words
and doesn't check if the duration is a plural duration.

Contains also a minor improvement in SimpleTimeFormat.isPlural() that prevents
computing the same number twice.
@obecker obecker mentioned this pull request Sep 7, 2021
@lincolnthree
Copy link
Member

Hey @obecker , this looks great! Thanks for the PR.

I think your refactoring in SimpleTimeUnit also looks good. Good catch.

Also, I believe you're correct that we should likely be using the Calendar for all unit tests (At which point it should be refactored into a shared class). I know that would be a BIG PR, but... if you're up for it...

Also, if you do that, or other PRs, could you please use the Eclipse code formatting preferences provided at the root of this project? It would help keep things clean and standard.

Much appreciated!

@lincolnthree
Copy link
Member

@lincolnthree
Copy link
Member

Merged.

@obecker
Copy link
Contributor Author

obecker commented Sep 9, 2021

Thanks for merging and publishing a new release. Instead of asking everyone to follow the code formatting rules you may consider using a maven plugin that will enforce this. See #230

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.

2 participants