Skosmos icon indicating copy to clipboard operation
Skosmos copied to clipboard

Use BCP-47 tags for locale in JS

Open kinow opened this issue 3 years ago • 4 comments

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

Closes #1204

kinow avatar Sep 15 '21 09:09 kinow

@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!

kinow avatar Sep 15 '21 09:09 kinow

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

sonarqubecloud[bot] avatar Sep 15 '21 09:09 sonarqubecloud[bot]

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).

osma avatar Sep 15 '21 09:09 osma

Replied to comment in the issue :+1:

kinow avatar Sep 18 '21 03:09 kinow