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

Use BCP-47 tags for locale in JS #1206

Open
wants to merge 1 commit into
base: skosmos-2
Choose a base branch
from
Open

Conversation

kinow
Copy link
Collaborator

@kinow kinow commented Sep 15, 2021

Prevents errors due to invalid locales with _ (as per BCP-47).

Closes #1204

@kinow
Copy link
Collaborator Author

kinow commented Sep 15, 2021

@osma fixing it was super easy thanks to your pointers on where to look at the code. However, not sure how to write a test for this one... our PHPUnit are mainly RDFGraph models, PHP controllers, request/response. I think we have no tests for JS yet? (kinda related to #1189 I think)

Thanks!

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 0 Code Smells

No Coverage information No Coverage information
1.9% 1.9% Duplication

@osma
Copy link
Member

osma commented Sep 15, 2021

The fix looks reasonable - except for the question I made in this comment: does it even make sense to use underscores for language tags in config.ttl? We know they cause problems for JS, and this fixes that issue, but are they sensible on the PHP side? If not, the real problem is elsewhere and perhaps they should be fixed (underscores converted to dashes) already when reading config.ttl (perhaps emitting a warning if underscores are used).

@kinow
Copy link
Collaborator Author

kinow commented Sep 18, 2021

Replied to comment in the issue 👍

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.

[JS] Error when comparing with invalid locale (Incorrect locale information provided)
2 participants