-
-
Notifications
You must be signed in to change notification settings - Fork 6
BL-15812 Prefer autonyms in language cards #603
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,12 @@ | ||
| { | ||
| "workbench.colorCustomizations": { | ||
| "statusBar.background": "#49d668", | ||
| "statusBar.debuggingBackground": "#49d668", | ||
| "statusBar.background": "#549d3e", | ||
| "statusBar.noFolderBackground": "#49d668", | ||
| "statussBar.prominentBackground": "#D65649" | ||
| "statussBar.prominentBackground": "#D65649", | ||
| "statusBar.foreground": "#e7e7e7", | ||
| "statusBarItem.hoverBackground": "#6bbb53", | ||
| "statusBarItem.remoteBackground": "#549d3e", | ||
| "statusBarItem.remoteForeground": "#e7e7e7" | ||
|
Comment on lines
+3
to
+9
|
||
| }, | ||
| "editor.formatOnSave": true, | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode", | ||
|
|
@@ -29,5 +32,6 @@ | |
| "uilang", | ||
| "voca", | ||
| "yagni" | ||
| ] | ||
| ], | ||
| "peacock.color": "#549d3e" | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,11 @@ import { css } from "@emotion/react"; | |||||||||||||||||||
|
|
||||||||||||||||||||
| import React from "react"; | ||||||||||||||||||||
| import { CheapCard } from "./CheapCard"; | ||||||||||||||||||||
| import { ILanguage, getDisplayNamesForLanguage } from "../model/Language"; | ||||||||||||||||||||
| import { | ||||||||||||||||||||
| ILanguage, | ||||||||||||||||||||
| getDisplayNamesForLanguage, | ||||||||||||||||||||
| kTagForNoLanguage, | ||||||||||||||||||||
| } from "../model/Language"; | ||||||||||||||||||||
| import { commonUI } from "../theme"; | ||||||||||||||||||||
| import { useResponsiveChoice } from "../responsiveUtilities"; | ||||||||||||||||||||
| import { FormattedMessage } from "react-intl"; | ||||||||||||||||||||
|
|
@@ -43,13 +47,55 @@ export const LanguageCard: React.FunctionComponent< | |||||||||||||||||||
| ...propsToPassDown | ||||||||||||||||||||
| } = props; // Prevent React warnings | ||||||||||||||||||||
|
|
||||||||||||||||||||
| const { primary, secondary } = getDisplayNamesForLanguage(props); | ||||||||||||||||||||
| const displayNames = getDisplayNamesForLanguage(props); | ||||||||||||||||||||
| const getResponsiveChoice = useResponsiveChoice(); | ||||||||||||||||||||
| const { cardWidthPx, cardHeightPx } = useLanguageCardSpec(props.larger); | ||||||||||||||||||||
| const urlPrefix = props.targetPrefix ?? "/language:"; | ||||||||||||||||||||
| const showCount = !useIsAppHosted(); | ||||||||||||||||||||
| const cardSpacing = useBaseCardSpec().cardSpacingPx; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| const isPictureBook = isoCode === kTagForNoLanguage; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| // BL-15812 Prefer the autonym (`name`) as the primary label; fall back to existing display logic | ||||||||||||||||||||
| // for picture books or other special cases where `name` can be empty. | ||||||||||||||||||||
| const primary = isPictureBook | ||||||||||||||||||||
| ? displayNames.primary | ||||||||||||||||||||
| : name.trim() | ||||||||||||||||||||
| ? name | ||||||||||||||||||||
|
Comment on lines
+61
to
+64
|
||||||||||||||||||||
| const primary = isPictureBook | |
| ? displayNames.primary | |
| : name.trim() | |
| ? name | |
| const trimmedName = name.trim(); | |
| const primary = isPictureBook | |
| ? displayNames.primary | |
| : trimmedName | |
| ? trimmedName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would agree, unless we have some way of knowing that displayNames.primary is already trimmed, or at least can't be all whitespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The VS Code setting key
statussBar.prominentBackgroundis misspelled (extra "s"), so it will be ignored by VS Code. Rename it to the correctstatusBar.prominentBackgroundif the intent is to customize the prominent status bar background.