Skip to content

[#128] Make case comparisons consistent between various locale settin…#255

Merged
mashpie merged 1 commit intomashpie:masterfrom
monkpow:issue_128
Jul 30, 2016
Merged

[#128] Make case comparisons consistent between various locale settin…#255
mashpie merged 1 commit intomashpie:masterfrom
monkpow:issue_128

Conversation

@monkpow
Copy link
Copy Markdown

@monkpow monkpow commented Jul 20, 2016

…g methods (e.g. cookies, headers, query).

… setting methods (e.g. cookies, headers, query).
@monkpow
Copy link
Copy Markdown
Author

monkpow commented Jul 20, 2016

In the existing code line, the behavior is a bit different when using queryParameters to set locale in the case of a language code like en-US.

if setting via:
cookie => en-US
header => en-US
queryParameter => en-us

After reading it a few times, I suspect this is a bug, but have wrapped it in a config value just in case some current users rely on this behavior.

path = require("path");

describe('Locale switching should work queryParameter', function() {
describe('Locale switching should work when set via cookie', function() {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Not really related to this change set, but seemed polite to clean this up.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

yap I've seen this... thanks again - I bet there are still some more typos in readme, comments & tests - 6 years of part time maintenance...

@mashpie
Copy link
Copy Markdown
Owner

mashpie commented Jul 20, 2016

Thank you sir! It'd be best to handle those consistent internally. Refactoring such is still on my backlog, so your help catching up is much appreciated. I will review some extra changes on weekend to merge and publish.

@monkpow
Copy link
Copy Markdown
Author

monkpow commented Jul 20, 2016

Ok thanks, let me know if you'd prefer I pull out the config switch, and just fix it as a bug.

@mashpie
Copy link
Copy Markdown
Owner

mashpie commented Jul 20, 2016

the switch is fine - I am a big fan of feature switches and legacy switches could help with issues until next major release.

@coveralls
Copy link
Copy Markdown

coveralls commented Jul 20, 2016

Coverage Status

Coverage increased (+0.01%) to 97.912% when pulling 7e1c9e1 on monkpow:issue_128 into a74afa5 on mashpie:master.

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