Skosmos
Skosmos copied to clipboard
Use BCP-47 tags for locale in JS
Prevents errors due to invalid locales with _
(as per BCP-47).
Closes #1204
@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!
SonarCloud Quality Gate failed.
0 Bugs
0 Vulnerabilities
1 Security Hotspot
0 Code Smells
No Coverage information
1.9% Duplication
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).
Replied to comment in the issue :+1: