Skip to content

Improve FromAbbreviatedHeading for localized headings#1117

Merged
clairernovotny merged 3 commits intoHumanizr:mainfrom
hangy:issue1103
Aug 23, 2021
Merged

Improve FromAbbreviatedHeading for localized headings#1117
clairernovotny merged 3 commits intoHumanizr:mainfrom
hangy:issue1103

Conversation

@hangy
Copy link
Contributor

@hangy hangy commented Aug 17, 2021

Here is a checklist you should tick through before submitting a pull request:

  • Implementation is clean
  • Code adheres to the existing coding standards; e.g. no curlies for one-line blocks, no redundant empty lines between methods or code blocks, spaces rather than tabs, etc.
  • No Code Analysis warnings
  • There is proper unit test coverage
  • If the code is copied from StackOverflow (or a blog or OSS) full disclosure is included. That includes required license files and/or file headers explaining where the code came from with proper attribution
  • There are very few or no comments (because comments shouldn't be needed if you write clean code)
  • Xml documentation is added/updated for the addition/change
  • Your PR is (re)based on top of the latest commits from the dev branch (more info below)
  • Link to the issue(s) you're fixing from your PR description. Use fixes #<the issue number>
  • Readme is updated if you change an existing feature or add a new one
  • Run either build.cmd or build.ps1 and ensure there are no test failures

Adds localized parsing for FromAbbreviatedHeading for localized versions, and add new FromHeadingArrow method

Fixes #1103

@hangy hangy changed the title feat: Improve FromAbbreviatedHeading for localized headings Improve FromAbbreviatedHeading for localized headings Aug 17, 2021
Copy link
Member

@clairernovotny clairernovotny left a comment

Choose a reason for hiding this comment

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

LGTM with the one fix

/// <param name="culture">The culture of the heading</param>
/// <returns>The heading. -1 if the heading could not be parsed.</returns>
public static double FromAbbreviatedHeading(this string heading)
public static double FromAbbreviatedHeading(this string heading, CultureInfo culture = null)
Copy link
Member

Choose a reason for hiding this comment

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

This should be an additional method/override, so we don't break existing people.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I think it should be fixed in 9d48857.

@hangy hangy requested a review from clairernovotny August 23, 2021 08:12
@clairernovotny clairernovotny merged commit edc57f7 into Humanizr:main Aug 23, 2021
@hangy hangy deleted the issue1103 branch August 23, 2021 12:28
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.

Headings cannot be parsed from localized abbreviations

2 participants