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

UI language negotiation fix #1455

Merged
merged 1 commit into from
May 25, 2023
Merged

UI language negotiation fix #1455

merged 1 commit into from
May 25, 2023

Conversation

namedgraph
Copy link
Contributor

With these fixes applied we are not experiencing #1453 anymore.

Reasons for creating this PR

Code fix and configuration fix

Link to relevant issue(s), if any

Description of the changes in this PR

  • Pass language value to in_array() as string instead of object
  • Replaced _ with - in skosmos:languages language tags found in the dockerfiles configuration files

Known problems or uncertainties in this PR

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't reduce accessibility of the front-end code (e.g. tab focus, scaling to different resolutions, use of .sr-only class, color contrast)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

Also fixed the language tags in the sample `skosmos:languages` config
@sonarcloud
Copy link

sonarcloud bot commented May 23, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@osma osma added the bug label May 23, 2023
@osma osma added this to the 2.17 milestone May 23, 2023
@codecov
Copy link

codecov bot commented May 23, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (a6f1795) 69.57% compared to head (0c5e300) 69.57%.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1455   +/-   ##
=========================================
  Coverage     69.57%   69.57%           
  Complexity     1651     1651           
=========================================
  Files            32       32           
  Lines          4259     4259           
=========================================
  Hits           2963     2963           
  Misses         1296     1296           
Impacted Files Coverage Δ
controller/WebController.php 15.59% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@osma
Copy link
Member

osma commented May 24, 2023

Thanks a lot @namedgraph , this looks like a very reasonable set of fixes.

The code that this PR is targeting is really begging for unit tests. I think this would be the right moment to add those tests, verifying that the fix actually worked. I will see if I can add those easily before merging. This needs to go both to the master branch and to the skosmos-3 branch where we have started to develop version 3 of Skosmos.

@osma
Copy link
Member

osma commented May 24, 2023

I implemented unit tests for the guessLanguage method, then applied the commits from this PR on top, and put it into PR #1457 which supersedes this one.

@osma osma merged commit 8cbc92f into NatLibFi:master May 25, 2023
@osma
Copy link
Member

osma commented May 25, 2023

Merged via #1457. Thanks again!

@namedgraph
Copy link
Contributor Author

You're welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Skosmos UI loads in Arabic
2 participants