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

Allow scoped calls to toHumanSize() #583

Merged
merged 2 commits into from Oct 15, 2020

Conversation

scumah
Copy link

@scumah scumah commented Sep 30, 2020

Hey! This PR adds support for the scope option to the toHumanSize() function.

Right now, the function directly looks for a specific hardcoded scope that doesn't take into account if the user is passing a scope option. In our case, we wanted to have this kind of translations under a shared scope, along the date formats and that kind of stuff, but using toHumanSize() in it's current state makes it impossible.

To fix it we calculate the scope before calling t() using getFullScope(), passing the options toHumanSize() got.

Thanks!

@coveralls
Copy link

coveralls commented Sep 30, 2020

Pull Request Test Coverage Report for Build 684

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 68.519%

Totals Coverage Status
Change from base Build 683: 0.0%
Covered Lines: 296
Relevant Lines: 432

💛 - Coveralls

@TravisBuddy
Copy link

TravisBuddy commented Sep 30, 2020

Hey @scumah,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: aaa78e30-0340-11eb-8abf-036a378110f7

@PikachuEXE
Copy link

Sorry I am on holiday
Come back next week

@PikachuEXE
Copy link

That seems a great addition
Can you also update the README to reflect your changes?

@scumah
Copy link
Author

scumah commented Oct 13, 2020

Done @PikachuEXE. I took the chance and:

  • Fixed a couple of typos
  • Updated the plural rules broken link
  • Removed trailing white spaces

I hope it's OK.

@PikachuEXE
Copy link

Hey thx
But I notice some trailing double spaces are removed which is for formatting
Can you add back those double spaces to keep the formatting right? (Unless that's also part of the fix)

@scumah
Copy link
Author

scumah commented Oct 14, 2020

wops! I didn't know about this double space for md, sry. fixing it!

- Document scope option in toHumanSize
- Fix typos
- Update plural rules broken link
- Remove white spaces

[ci skip]
@PikachuEXE PikachuEXE merged commit 41c5554 into fnando:master Oct 15, 2020
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.

None yet

4 participants