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

Standardize on 'en', not 'en-US' as a language code, but register both #868

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

eyeseast
Copy link
Collaborator

Trying to solve #818

My browser sets the accept-language header and window.navigator.language to en-US, but we weren't registering that as a locale, only en. So this adds that registration and also standardizes our own setting to en.

Copy link

github-actions bot commented Nov 21, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 30.9% 6727 / 21766
🔵 Statements 30.9% 6727 / 21766
🔵 Functions 49.72% 274 / 551
🔵 Branches 75.65% 1013 / 1339
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/lib/components/documents/Access.svelte 100% 100% 100% 100%
src/lib/components/documents/BulkActions.svelte 0% 0% 0% 0% 1-113
src/lib/i18n/index.js 100% 66.66% 100% 100%
src/lib/utils/language.ts 100% 100% 100% 100%
src/lib/utils/tests/language.test.ts 100% 100% 100% 100%
src/routes/+layout.ts 0% 0% 0% 0% 1
Generated in workflow #770 for commit dd5672e by the Vitest Coverage Report Action

});

// handle two-part locales
register("en-US", () => import("@/langs/json/en.json"));
register("en-GB", () => import("@/langs/json/en.json"));
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to handle other two part locales? Spanish is spoken in a lot of countries.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure these are strictly necessary. I think part of the issue was that we were defaulting (in hooks.server.ts) to en-US and that wasn't registered.

Copy link

netlify bot commented Nov 21, 2024

Deploy Preview for documentcloud-frontend ready!

Name Link
🔨 Latest commit dd5672e
🔍 Latest deploy log https://app.netlify.com/sites/documentcloud-frontend/deploys/673fa934fd7b830008ea0814
😎 Deploy Preview https://deploy-preview-868.muckcloud.com
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 31
Accessibility: 85
Best Practices: 92
SEO: 91
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@eyeseast eyeseast merged commit fd77515 into sveltekit Nov 21, 2024
10 of 11 checks passed
Copy link

sentry-io bot commented Dec 3, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ TypeError: Cannot read properties of null (reading 'getItem') /documents/24803583-69efc8d9-996b-44d4-b386-9ff... View Issue
  • ‼️ TypeError: Cannot read properties of null (reading 'getItem') /documents/24803583-69efc8d9-996b-44d4-b386-9ff... View Issue
  • ‼️ SecurityError: The operation is insecure. /documents/4481608-Om-Krisen-Eller-Kriget-Komme... View Issue
  • ‼️ SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document. /documents/25075818-superseding/ View Issue
  • ‼️ NS_ERROR_ABORT: No error message /documents/24663335-repository_letter-2024-04-09/ View Issue

Did you find this useful? React with a 👍 or 👎

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