diff --git a/packages/desktop/app/javascripts/Main/Menus/Menus.ts b/packages/desktop/app/javascripts/Main/Menus/Menus.ts index af9e2257a51..51a5c54147e 100644 --- a/packages/desktop/app/javascripts/Main/Menus/Menus.ts +++ b/packages/desktop/app/javascripts/Main/Menus/Menus.ts @@ -30,40 +30,26 @@ const Separator: MenuItemConstructorOptions = { type: 'separator', } +function menuRole(label: string, role: string): MenuItemConstructorOptions { + return { label, role: role as MenuItemConstructorOptions['role'] } +} + export function buildContextMenu(webContents: WebContents, params: ContextMenuParams): Menu { if (!params.isEditable) { - return Menu.buildFromTemplate([ - { - role: 'copy', - }, - ]) + return Menu.buildFromTemplate([menuRole(str().copy, Roles.Copy)]) } return Menu.buildFromTemplate([ ...suggestionsMenu(params.selectionText, params.misspelledWord, params.dictionarySuggestions, webContents), Separator, - { - role: 'undo', - }, - { - role: 'redo', - }, + menuRole(str().undo, Roles.Undo), + menuRole(str().redo, Roles.Redo), Separator, - { - role: 'cut', - }, - { - role: 'copy', - }, - { - role: 'paste', - }, - { - role: 'pasteAndMatchStyle', - }, - { - role: 'selectAll', - }, + menuRole(str().cut, Roles.Cut), + menuRole(str().copy, Roles.Copy), + menuRole(str().paste, Roles.Paste), + menuRole(str().pasteAndMatchStyle, Roles.PasteAndMatchStyle), + menuRole(str().selectAll, Roles.SelectAll), ]) } @@ -208,28 +194,19 @@ function macAppMenu(appName: string): MenuItemConstructorOptions { role: 'appMenu', label: appName, submenu: [ - { - role: Roles.About, - }, + menuRole(str().about(appName), Roles.About), Separator, { + label: str().services, role: Roles.Services, submenu: [], }, Separator, - { - role: Roles.Hide, - }, - { - role: Roles.HideOthers, - }, - { - role: Roles.UnHide, - }, + menuRole(str().hide(appName), Roles.Hide), + menuRole(str().hideOthers, Roles.HideOthers), + menuRole(str().showAll, Roles.UnHide), Separator, - { - role: Roles.Quit, - }, + menuRole(str().quit(appName), Roles.Quit), ], } } @@ -249,28 +226,14 @@ function editMenu( role: 'editMenu', label: str().edit, submenu: [ - { - role: Roles.Undo, - }, - { - role: Roles.Redo, - }, + menuRole(str().undo, Roles.Undo), + menuRole(str().redo, Roles.Redo), Separator, - { - role: Roles.Cut, - }, - { - role: Roles.Copy, - }, - { - role: Roles.Paste, - }, - { - role: Roles.PasteAndMatchStyle, - }, - { - role: Roles.SelectAll, - }, + menuRole(str().cut, Roles.Cut), + menuRole(str().copy, Roles.Copy), + menuRole(str().paste, Roles.Paste), + menuRole(str().pasteAndMatchStyle, Roles.PasteAndMatchStyle), + menuRole(str().selectAll, Roles.SelectAll), ...(isMac() ? [Separator, macSpeechMenu()] : [spellcheckerMenu(spellcheckerManager!, reload)]), ], } @@ -279,14 +242,7 @@ function editMenu( function macSpeechMenu(): MenuItemConstructorOptions { return { label: str().speech, - submenu: [ - { - role: Roles.StopSeeking, - }, - { - role: Roles.StopSeeking, - }, - ], + submenu: [menuRole(str().startSpeaking, Roles.StartSeeking), menuRole(str().stopSpeaking, Roles.StopSeeking)], } } @@ -317,26 +273,14 @@ function viewMenu(window: Electron.BrowserWindow, store: Store, reload: () => vo return { label: str().view, submenu: [ - { - role: Roles.Reload, - }, - { - role: Roles.ToggleDevTools, - }, + menuRole(str().reload, Roles.Reload), + menuRole(str().toggleDeveloperTools, Roles.ToggleDevTools), Separator, - { - role: Roles.ResetZoom, - }, - { - role: Roles.ZoomIn, - }, - { - role: Roles.ZoomOut, - }, + menuRole(str().actualSize, Roles.ResetZoom), + menuRole(str().zoomIn, Roles.ZoomIn), + menuRole(str().zoomOut, Roles.ZoomOut), Separator, - { - role: Roles.ToggleFullScreen, - }, + menuRole(str().toggleFullScreen, Roles.ToggleFullScreen), ...(isMac() ? [] : [Separator, ...menuBarOptions(window, store, reload)]), ], } @@ -375,14 +319,11 @@ function menuBarOptions(window: Electron.BrowserWindow, store: Store, reload: () function windowMenu(store: Store, trayManager: TrayManager, reload: () => void): MenuItemConstructorOptions { return { + label: str().window, role: Roles.Window, submenu: [ - { - role: Roles.Minimize, - }, - { - role: Roles.Close, - }, + menuRole(str().minimize, Roles.Minimize), + menuRole(str().close, Roles.Close), Separator, ...(isMac() ? macWindowItems() : [minimizeToTrayItem(store, trayManager, reload)]), ], @@ -512,6 +453,7 @@ function updateMenu(window: BrowserWindow, appState: AppState) { function helpMenu(window: Electron.BrowserWindow, shell: Electron.Shell) { return { + label: str().help, role: Roles.Help, submenu: [ { diff --git a/packages/desktop/app/javascripts/Main/Strings/strings.ts b/packages/desktop/app/javascripts/Main/Strings/strings.ts index 625214293ad..d14af39879f 100644 --- a/packages/desktop/app/javascripts/Main/Strings/strings.ts +++ b/packages/desktop/app/javascripts/Main/Strings/strings.ts @@ -5,8 +5,37 @@ import { Strings } from './types' export function createStrings(): Strings { return { appMenu: { + window: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Window`, + help: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Help`, edit: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Edit`, view: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`View`, + about(appName: string) { + return jtString(c('B8.MobileDesktopShared.Desktop.Menu.Label').jt`About ${appName}`) + }, + services: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Services`, + hide(appName: string) { + return jtString(c('B8.MobileDesktopShared.Desktop.Menu.Label').jt`Hide ${appName}`) + }, + hideOthers: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Hide Others`, + showAll: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Show All`, + quit(appName: string) { + return jtString(c('B8.MobileDesktopShared.Desktop.Menu.Label').jt`Quit ${appName}`) + }, + startSpeaking: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Start Speaking`, + stopSpeaking: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Stop Speaking`, + undo: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Undo`, + redo: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Redo`, + cut: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Cut`, + copy: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Copy`, + paste: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Paste`, + pasteAndMatchStyle: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Paste and Match Style`, + selectAll: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Select All`, + reload: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Reload`, + toggleDeveloperTools: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Toggle Developer Tools`, + actualSize: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Actual Size`, + zoomIn: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Zoom In`, + zoomOut: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Zoom Out`, + toggleFullScreen: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Toggle Full Screen`, hideMenuBar: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Hide Menu Bar`, useThemedMenuBar: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Use Themed Menu Bar`, minimizeToTrayOnClose: c('B8.MobileDesktopShared.Desktop.Menu.Label').t`Minimize To Tray On Close`, diff --git a/packages/desktop/app/javascripts/Main/Strings/types.ts b/packages/desktop/app/javascripts/Main/Strings/types.ts index 2c5649468e8..bd14e176412 100644 --- a/packages/desktop/app/javascripts/Main/Strings/types.ts +++ b/packages/desktop/app/javascripts/Main/Strings/types.ts @@ -7,8 +7,31 @@ export interface Strings { } interface AppMenuStrings { + window: string + help: string edit: string view: string + about(appName: string): string + services: string + hide(appName: string): string + hideOthers: string + showAll: string + quit(appName: string): string + startSpeaking: string + stopSpeaking: string + undo: string + redo: string + cut: string + copy: string + paste: string + pasteAndMatchStyle: string + selectAll: string + reload: string + toggleDeveloperTools: string + actualSize: string + zoomIn: string + zoomOut: string + toggleFullScreen: string hideMenuBar: string useThemedMenuBar: string minimizeToTrayOnClose: string diff --git a/packages/web/src/javascripts/Components/CommandPalette/CommandPalette.tsx b/packages/web/src/javascripts/Components/CommandPalette/CommandPalette.tsx index a11550434e7..ec061733403 100644 --- a/packages/web/src/javascripts/Components/CommandPalette/CommandPalette.tsx +++ b/packages/web/src/javascripts/Components/CommandPalette/CommandPalette.tsx @@ -229,7 +229,7 @@ function CommandPalette() { section, id: UuidGenerator.GenerateUuid(), itemUuid: item.uuid, - description: item.title || c('B2.NavSharedUI.Placeholder').t``, + description: item.title || c('B2.NavSharedUI.Placeholder').t`Untitled`, icon: , } }, diff --git a/packages/web/src/javascripts/Components/ContentListView/Header/NewNotePreferences.tsx b/packages/web/src/javascripts/Components/ContentListView/Header/NewNotePreferences.tsx index b327b942db8..fb9baab4f02 100644 --- a/packages/web/src/javascripts/Components/ContentListView/Header/NewNotePreferences.tsx +++ b/packages/web/src/javascripts/Components/ContentListView/Header/NewNotePreferences.tsx @@ -19,10 +19,11 @@ import { AnyTag } from '@/Controllers/Navigation/AnyTagType' import { PreferenceMode } from './PreferenceMode' import { EditorOption, getDropdownItemsForAllEditors } from '@/Utils/DropdownItemsForEditors' import { classNames } from '@standardnotes/utils' -import { NoteTitleFormatOptions } from './NoteTitleFormatOptions' +import { NOTE_TITLE_FORMAT_PATTERN_EXAMPLE, NoteTitleFormatOptions } from './NoteTitleFormatOptions' import { usePremiumModal } from '@/Hooks/usePremiumModal' import { getDayjsFormattedString } from '@/Utils/GetDayjsFormattedString' import { ErrorBoundary } from '@/Utils/ErrorBoundary' +import { jtString } from '@standardnotes/features' import { c } from 'ttag' const PrefChangeDebounceTimeInMs = 25 @@ -173,6 +174,31 @@ const NewNotePreferences: FunctionComponent = ({ }, PrefChangeDebounceTimeInMs) } + const titleFormatOptionsLink = ( + { + if (application.isNativeMobileWeb()) { + event.preventDefault() + application.mobileDevice.openUrl(HelpPageUrl) + } + }} + > + {c('B3.Notes.NoteList.Action').t`Options`} + + ) + + const bracketsLiteral = [] + + const titleFormatPreview = ( + + + + ) + return (
@@ -211,35 +237,15 @@ const NewNotePreferences: FunctionComponent = ({ 'w-full min-w-55 rounded border border-solid border-passive-3 bg-default px-2 py-1.5 text-sm md:translucent-ui:bg-transparent', 'focus-within:ring-2 focus-within:ring-info', )} - placeholder={c('B3.Notes.NoteList.Label').t`e.g. YYYY-MM-DD`} + placeholder={jtString(c('B3.Notes.NoteList.Label').jt`e.g. ${NOTE_TITLE_FORMAT_PATTERN_EXAMPLE}`)} value={customNoteTitleFormat} onChange={handleCustomFormatInputChange} spellCheck={false} />
-
- {c('B3.Notes.NoteList.Label').t`Preview:`} - - - -
+
{c('B3.Notes.NoteList.Info').jt`Preview: ${titleFormatPreview}`}
- { - if (application.isNativeMobileWeb()) { - event.preventDefault() - application.mobileDevice.openUrl(HelpPageUrl) - } - }} - > - {c('B3.Notes.NoteList.Action').t`Options`} - - . {c('B3.Notes.NoteList.Info').t`Use`} []{' '} - {c('B3.Notes.NoteList.Info').t`to escape formatting.`} + {c('B3.Notes.NoteList.Info').jt`${titleFormatOptionsLink}. Use ${bracketsLiteral} to escape formatting.`}
)} diff --git a/packages/web/src/javascripts/Components/ContentListView/Header/NoteTitleFormatOptions.tsx b/packages/web/src/javascripts/Components/ContentListView/Header/NoteTitleFormatOptions.tsx index dbd57bf83a5..824d46cf3a5 100644 --- a/packages/web/src/javascripts/Components/ContentListView/Header/NoteTitleFormatOptions.tsx +++ b/packages/web/src/javascripts/Components/ContentListView/Header/NoteTitleFormatOptions.tsx @@ -1,6 +1,8 @@ import { NewNoteTitleFormat } from '@standardnotes/snjs' import { c } from 'ttag' +export const NOTE_TITLE_FORMAT_PATTERN_EXAMPLE = 'YYYY-MM-DD' + export const NoteTitleFormatOptions = [ { label: c('B3.Notes.NoteList.Label').t`Current date and time`, diff --git a/packages/web/src/javascripts/Components/NoteView/UniversalSearch/UniversalSearchController.ts b/packages/web/src/javascripts/Components/NoteView/UniversalSearch/UniversalSearchController.ts index bdd69f04b87..a840ec8adfb 100644 --- a/packages/web/src/javascripts/Components/NoteView/UniversalSearch/UniversalSearchController.ts +++ b/packages/web/src/javascripts/Components/NoteView/UniversalSearch/UniversalSearchController.ts @@ -1,4 +1,5 @@ import { action, computed, makeObservable, observable, runInAction } from 'mobx' +import { c } from 'ttag' import { UniversalSearchProvider, UniversalSearchResult, @@ -32,7 +33,7 @@ function errorMessage(error: unknown): string { return error.message } - return 'Search failed' + return c('B3.Notes.EditorToolbar.Error').t`Search failed` } type SetSearchResultsOptions = { diff --git a/packages/web/src/javascripts/Components/NoteView/UniversalSearch/UniversalSearchShell.tsx b/packages/web/src/javascripts/Components/NoteView/UniversalSearch/UniversalSearchShell.tsx index 33540773b46..f9870f07572 100644 --- a/packages/web/src/javascripts/Components/NoteView/UniversalSearch/UniversalSearchShell.tsx +++ b/packages/web/src/javascripts/Components/NoteView/UniversalSearch/UniversalSearchShell.tsx @@ -2,6 +2,7 @@ import { ArrowDownIcon, ArrowRightIcon, ArrowUpIcon, CloseIcon } from '@standard import { classNames } from '@standardnotes/utils' import { observer } from 'mobx-react-lite' import { KeyboardEvent, useEffect, useRef } from 'react' +import { c } from 'ttag' import Button from '../../Button/Button' import Icon from '../../Icon/Icon' import DecoratedInput from '../../Input/DecoratedInput' @@ -22,11 +23,11 @@ interface UniversalSearchShellProps { function statusLabel(controller: UniversalSearchController): string { if (controller.status === 'loading') { - return 'Loading' + return c('B2.NavSharedUI.Info').t`Loading` } if (controller.status === 'error') { - return controller.error || 'Error' + return controller.error || c('B2.NavSharedUI.Label').t`Error` } if (!controller.query) { @@ -129,8 +130,12 @@ export const UniversalSearchShell = observer(function UniversalSearchShell {controller.isReplaceMode ? ( @@ -149,7 +154,7 @@ export const UniversalSearchShell = observer(function UniversalSearchShell
{statusLabel(controller)}
, @@ -173,23 +178,29 @@ export const UniversalSearchShell = observer(function UniversalSearchShell Aa + {c('B3.Notes.EditorToolbar.Label').t`Case sensitive`} @@ -197,16 +208,20 @@ export const UniversalSearchShell = observer(function UniversalSearchShell @@ -215,7 +230,7 @@ export const UniversalSearchShell = observer(function UniversalSearchShell { controller.setReplaceQuery(event.target.value) @@ -224,23 +239,23 @@ export const UniversalSearchShell = observer(function UniversalSearchShell )} @@ -252,17 +267,20 @@ export const UniversalSearchShell = observer(function UniversalSearchShell controller.setShouldHighlightAll(event.target.checked)} disabled={!canHighlightAll} - aria-label="Highlight all results" + aria-label={c('B3.Notes.EditorToolbar.Label').t`Highlight all results`} /> -
Highlight all results
+
{c('B3.Notes.EditorToolbar.Label').t`Highlight all results`}
{!canHighlightAll && ( - diff --git a/packages/web/src/javascripts/Components/NoteView/UniversalSearch/registerUniversalSearchKeyboardHandlers.ts b/packages/web/src/javascripts/Components/NoteView/UniversalSearch/registerUniversalSearchKeyboardHandlers.ts index c3131ef2ced..5565b46dbf1 100644 --- a/packages/web/src/javascripts/Components/NoteView/UniversalSearch/registerUniversalSearchKeyboardHandlers.ts +++ b/packages/web/src/javascripts/Components/NoteView/UniversalSearch/registerUniversalSearchKeyboardHandlers.ts @@ -7,6 +7,7 @@ import { UNIVERSAL_TOGGLE_SEARCH, } from '@standardnotes/ui-services' import { Disposer } from '@/Types/Disposer' +import { c } from 'ttag' import { UniversalSearchController } from './UniversalSearchController' export function registerUniversalSearchKeyboardHandlers( @@ -17,7 +18,7 @@ export function registerUniversalSearchKeyboardHandlers( { command: UNIVERSAL_TOGGLE_SEARCH, category: 'Search', - description: 'Search in current note', + description: c('B3.Notes.EditorToolbar.Action').t`Search in current note`, onKeyDown: (event) => { event.preventDefault() event.stopPropagation() @@ -32,7 +33,7 @@ export function registerUniversalSearchKeyboardHandlers( { command: UNIVERSAL_SEARCH_TOGGLE_REPLACE_MODE, category: 'Search', - description: 'Search and replace in current note', + description: c('B3.Notes.EditorToolbar.Action').t`Search and replace in current note`, onKeyDown: (event) => { if (!controller.canReplace) { return @@ -65,7 +66,7 @@ export function registerUniversalSearchKeyboardHandlers( { command: UNIVERSAL_SEARCH_NEXT_RESULT, category: 'Search', - description: 'Go to next search result', + description: c('B3.Notes.EditorToolbar.Action').t`Go to next search result`, onKeyDown(event) { if (!controller.isOpen) { return @@ -79,7 +80,7 @@ export function registerUniversalSearchKeyboardHandlers( { command: UNIVERSAL_SEARCH_PREVIOUS_RESULT, category: 'Search', - description: 'Go to previous search result', + description: c('B3.Notes.EditorToolbar.Action').t`Go to previous search result`, onKeyDown(event) { if (!controller.isOpen) { return diff --git a/packages/web/src/javascripts/Components/NotesOptions/PlainNoteOptions.tsx b/packages/web/src/javascripts/Components/NotesOptions/PlainNoteOptions.tsx index 5c52d614c55..3b2ed94d362 100644 --- a/packages/web/src/javascripts/Components/NotesOptions/PlainNoteOptions.tsx +++ b/packages/web/src/javascripts/Components/NotesOptions/PlainNoteOptions.tsx @@ -5,6 +5,7 @@ import { iconClass } from './ClassNames' import MenuSection from '../Menu/MenuSection' import { UNIVERSAL_TOGGLE_SEARCH } from '@standardnotes/ui-services' import { useMemo, useCallback } from 'react' +import { c } from 'ttag' import { useKeyboardService } from '../KeyboardServiceProvider' type Props = { @@ -28,7 +29,7 @@ const PlainNoteOptions = ({ closeMenu }: Props) => { - Find in note + {c('B4.Notes.EditorOptions.Action').t`Find in note`} {findShortcut && } diff --git a/packages/web/src/javascripts/Components/Preferences/Panes/Account/Email/Email.tsx b/packages/web/src/javascripts/Components/Preferences/Panes/Account/Email/Email.tsx index d46380630ff..ef7ebc0c0e5 100644 --- a/packages/web/src/javascripts/Components/Preferences/Panes/Account/Email/Email.tsx +++ b/packages/web/src/javascripts/Components/Preferences/Panes/Account/Email/Email.tsx @@ -118,8 +118,6 @@ const Email: FunctionComponent = ({ application }: Props) => { } } - const subscriptionBold = {c('B6.Preferences.Account.Label').t`subscription`} - return ( @@ -139,7 +137,7 @@ const Email: FunctionComponent = ({ application }: Props) => { text={ {c('B6.Preferences.Account.Info') - .jt`Sign-in notification emails are available only on a ${subscriptionBold} plan. Please upgrade in order to enable sign-in notifications.`} + .t`Sign-in notification emails are available only on a subscription plan. Please upgrade in order to enable sign-in notifications.`} } /> diff --git a/packages/web/src/javascripts/Components/Preferences/Panes/Account/Subscription/SubscriptionStatusText.tsx b/packages/web/src/javascripts/Components/Preferences/Panes/Account/Subscription/SubscriptionStatusText.tsx index 7560107e6d1..5a8081e0596 100644 --- a/packages/web/src/javascripts/Components/Preferences/Panes/Account/Subscription/SubscriptionStatusText.tsx +++ b/packages/web/src/javascripts/Components/Preferences/Panes/Account/Subscription/SubscriptionStatusText.tsx @@ -16,6 +16,10 @@ const SubscriptionStatusText = () => { const isSharedSubscription = application.subscriptionController.isSharedSubscription const expirationDateString = userSubscriptionExpirationDate?.toLocaleString() + const appNameBold = {AppName} + const subscriptionTierBold = userSubscriptionName ? {userSubscriptionName} : null + const expirationDateBold = {expirationDateString} + const sharedMessage = isSharedSubscription ? ( <>
@@ -28,23 +32,11 @@ const SubscriptionStatusText = () => { if (isUserSubscriptionCanceled) { return ( - {c('B6.Preferences.Subscription.Info').t`Your`}{' '} - - {AppName} - {userSubscriptionName ? ' ' : ''} - {userSubscriptionName} - {' '} - {c('B6.Preferences.Subscription.Info').t`subscription has been canceled`}{' '} - {isUserSubscriptionExpired ? ( - - {c('B6.Preferences.Subscription.Info').t`and expired on`} {expirationDateString} - - ) : ( - - {c('B6.Preferences.Subscription.Info').t`but will remain valid until`} {expirationDateString} - - )} - {c('B6.Preferences.Subscription.Info').t`. You may resubscribe below if you wish.`} + {isUserSubscriptionExpired + ? c('B6.Preferences.Subscription.Info') + .jt`Your ${appNameBold}${subscriptionTierBold} subscription has been canceled and expired on ${expirationDateBold}. You may resubscribe below if you wish.` + : c('B6.Preferences.Subscription.Info') + .jt`Your ${appNameBold}${subscriptionTierBold} subscription has been canceled but will remain valid until ${expirationDateBold}. You may resubscribe below if you wish.`} {sharedMessage} ) @@ -53,17 +45,8 @@ const SubscriptionStatusText = () => { if (isUserSubscriptionExpired) { return ( - {c('B6.Preferences.Subscription.Info').t`Your`}{' '} - - {AppName} - {userSubscriptionName ? ' ' : ''} - {userSubscriptionName} - {' '} - {c('B6.Preferences.Subscription.Info').t`subscription`}{' '} - - {c('B6.Preferences.Subscription.Info').t`expired on`} {expirationDateString} - - {c('B6.Preferences.Subscription.Info').t`. You may resubscribe below if you wish.`} + {c('B6.Preferences.Subscription.Info') + .jt`Your ${appNameBold}${subscriptionTierBold} subscription expired on ${expirationDateBold}. You may resubscribe below if you wish.`} {sharedMessage} ) @@ -71,17 +54,9 @@ const SubscriptionStatusText = () => { return ( - {c('B6.Preferences.Subscription.Info').t`Your`}{' '} - - {AppName} - {userSubscriptionName ? ' ' : ''} - {userSubscriptionName} - {' '} - {c('B6.Preferences.Subscription.Info').t`subscription will be`}{' '} - - {c('B6.Preferences.Subscription.Info').t`renewed on`} {expirationDateString} - - .{sharedMessage} + {c('B6.Preferences.Subscription.Info') + .jt`Your ${appNameBold}${subscriptionTierBold} subscription will be renewed on ${expirationDateBold}.`} + {sharedMessage} ) } diff --git a/packages/web/src/javascripts/Components/Preferences/Panes/Backups/Files/BackupsDropZone.tsx b/packages/web/src/javascripts/Components/Preferences/Panes/Backups/Files/BackupsDropZone.tsx index 050c4fda274..1040bd871aa 100644 --- a/packages/web/src/javascripts/Components/Preferences/Panes/Backups/Files/BackupsDropZone.tsx +++ b/packages/web/src/javascripts/Components/Preferences/Panes/Backups/Files/BackupsDropZone.tsx @@ -1,7 +1,14 @@ import { Title, Text, Subtitle } from '@/Components/Preferences/PreferencesComponents/Content' import { useCallback, useEffect, useMemo, useState, FunctionComponent } from 'react' import Button from '@/Components/Button/Button' -import { FileBackupMetadataFile, FileBackupsConstantsV1, FileItem, FileHandleRead } from '@standardnotes/snjs' +import { jtString } from '@standardnotes/features' +import { + escapeHtmlString, + FileBackupMetadataFile, + FileBackupsConstantsV1, + FileItem, + FileHandleRead, +} from '@standardnotes/snjs' import HorizontalSeparator from '@/Components/Shared/HorizontalSeparator' import Icon from '@/Components/Icon/Icon' import { ClassicFileReader, StreamingFileApi } from '@standardnotes/filepicker' @@ -52,9 +59,12 @@ const BackupsDropZone: FunctionComponent = ({ application }) => { if (result === 'success') { const decryptedFileName = decryptedFileItem.name + const decryptedFileNameBold = `${escapeHtmlString(decryptedFileName)}` void application.alerts.alert( - c('B6.Preferences.Backups.Info') - .t`${decryptedFileName} has been successfully decrypted and saved to your chosen directory.`, + jtString( + c('B6.Preferences.Backups.Info') + .jt`${decryptedFileNameBold} has been successfully decrypted and saved to your chosen directory.`, + ), ) setBinaryFile(undefined) setDecryptedFileItem(undefined) @@ -143,12 +153,14 @@ const BackupsDropZone: FunctionComponent = ({ application }) => { } }, [handleDragIn, handleDrop, handleDragOver, handleDragOut]) + const metadataFileName = {FileBackupsConstantsV1.MetadataFileName} + if (!droppedFile) { return ( <> {c('B6.Preferences.Backups.Info') - .t`To decrypt a backup file, drag and drop the file's respective metadata.sn.json file here or select it below.`} + .jt`To decrypt a backup file, drag and drop the file's respective ${metadataFileName} file here or select it below.`} diff --git a/packages/web/src/javascripts/Components/RevisionHistoryModal/RevisionContentLocked.tsx b/packages/web/src/javascripts/Components/RevisionHistoryModal/RevisionContentLocked.tsx index daab924e91b..5f2c56d7d83 100644 --- a/packages/web/src/javascripts/Components/RevisionHistoryModal/RevisionContentLocked.tsx +++ b/packages/web/src/javascripts/Components/RevisionHistoryModal/RevisionContentLocked.tsx @@ -26,7 +26,7 @@ const getPremiumContentCopy = (planName: string | undefined) => { const RevisionContentLocked: FunctionComponent = () => { const application = useApplication() - let planName = 'free' + let planName: string | undefined if (application.subscriptions.hasOnlineSubscription()) { if (!application.subscriptions.isUserSubscriptionCanceled && !application.subscriptions.isUserSubscriptionExpired) { planName = application.subscriptions.userSubscriptionName diff --git a/packages/web/src/javascripts/Components/SearchBar/SearchBar.tsx b/packages/web/src/javascripts/Components/SearchBar/SearchBar.tsx index fb553ce8867..83192e89d8f 100644 --- a/packages/web/src/javascripts/Components/SearchBar/SearchBar.tsx +++ b/packages/web/src/javascripts/Components/SearchBar/SearchBar.tsx @@ -35,7 +35,7 @@ const SearchFilterButton = ({ activeFilterCount, isOpen, onClick }: SearchFilter )} onMouseDown={(event) => event.preventDefault()} onClick={onClick} - aria-label="Search filters" + aria-label={c('B3.Notes.NoteList.AriaLabel').t`Search filters`} aria-expanded={isOpen} > diff --git a/packages/web/src/javascripts/Components/SearchOptions/EnhancedSearchOptionsContent.tsx b/packages/web/src/javascripts/Components/SearchOptions/EnhancedSearchOptionsContent.tsx index 4c695618abd..a6afd651bec 100644 --- a/packages/web/src/javascripts/Components/SearchOptions/EnhancedSearchOptionsContent.tsx +++ b/packages/web/src/javascripts/Components/SearchOptions/EnhancedSearchOptionsContent.tsx @@ -2,6 +2,7 @@ import Checkbox from '@/Components/Checkbox/Checkbox' import { SearchOptionsController } from '@/Controllers/SearchOptionsController' import { classNames } from '@standardnotes/snjs' import { observer } from 'mobx-react-lite' +import { c } from 'ttag' import SearchBubbles from './SearchBubbles' import SearchOptionsSection, { ClearFilterButton } from './SearchOptionsSection' import SearchTagFilters from './SearchTagFilters' @@ -20,16 +21,18 @@ const EnhancedSearchOptionsContent = ({ searchOptions, className }: Props) => {
searchOptions.setNoteTitleOnly(event.target.checked)} /> {activeSearchFilterCount > 0 && ( - Clear all filters + + {c('B3.Notes.NoteList.Action').t`Clear all filters`} + )}
- +
@@ -37,10 +40,12 @@ const EnhancedSearchOptionsContent = ({ searchOptions, className }: Props) => { 0 ? ( - Clear tag filters + + {c('B3.Notes.NoteList.Action').t`Clear tag filters`} + ) : undefined } > diff --git a/packages/web/src/javascripts/Components/SearchOptions/SearchBubbles.tsx b/packages/web/src/javascripts/Components/SearchOptions/SearchBubbles.tsx index c5ba1cfc581..8160f7a1235 100644 --- a/packages/web/src/javascripts/Components/SearchOptions/SearchBubbles.tsx +++ b/packages/web/src/javascripts/Components/SearchOptions/SearchBubbles.tsx @@ -2,6 +2,7 @@ import Bubble from '@/Components/Bubble/Bubble' import { SearchOptionsController } from '@/Controllers/SearchOptionsController' import { observer } from 'mobx-react-lite' import { useCallback } from 'react' +import { c } from 'ttag' type Props = { searchOptions: SearchOptionsController @@ -17,12 +18,20 @@ const SearchBubbles = ({ searchOptions }: Props) => { return ( <> - - + + ) } diff --git a/packages/web/src/javascripts/Components/SearchOptions/SearchFilterSheet.tsx b/packages/web/src/javascripts/Components/SearchOptions/SearchFilterSheet.tsx index 8d047491664..c181106f521 100644 --- a/packages/web/src/javascripts/Components/SearchOptions/SearchFilterSheet.tsx +++ b/packages/web/src/javascripts/Components/SearchOptions/SearchFilterSheet.tsx @@ -3,6 +3,7 @@ import { SearchOptionsController } from '@/Controllers/SearchOptionsController' import { useAndroidBackHandler } from '@/NativeMobileWeb/useAndroidBackHandler' import { observer } from 'mobx-react-lite' import { useEffect } from 'react' +import { c } from 'ttag' import EnhancedSearchOptionsContent from './EnhancedSearchOptionsContent' type Props = { @@ -26,7 +27,13 @@ const SearchFilterSheet = ({ open, onClose, searchOptions }: Props) => { }, [addAndroidBackHandler, onClose, open]) return ( - + ) diff --git a/packages/web/src/javascripts/Components/SearchOptions/SearchTagFilters.tsx b/packages/web/src/javascripts/Components/SearchOptions/SearchTagFilters.tsx index e7d5712bad0..b8b30e910de 100644 --- a/packages/web/src/javascripts/Components/SearchOptions/SearchTagFilters.tsx +++ b/packages/web/src/javascripts/Components/SearchOptions/SearchTagFilters.tsx @@ -6,6 +6,7 @@ import { SearchOptionsController } from '@/Controllers/SearchOptionsController' import { createLinkFromItem } from '@/Utils/Items/Search/createLinkFromItem' import { ContentType, SNTag } from '@standardnotes/snjs' import { observer } from 'mobx-react-lite' +import { c } from 'ttag' type Props = { searchOptions: SearchOptionsController @@ -38,7 +39,7 @@ const SearchTagFilters = ({ searchOptions }: Props) => { ))} searchOptions.addTagFilter(item as SNTag)} - placeholder="Add tag..." + placeholder={c('B4.Notes.TagsLinkedItems.Placeholder').t`Add tag...`} contentTypes={[ContentType.TYPES.Tag]} excludeUuids={excludeUuids} /> diff --git a/packages/web/src/javascripts/Components/SuperEditor/Plugins/EncryptedFilePlugin/Nodes/FileComponent.tsx b/packages/web/src/javascripts/Components/SuperEditor/Plugins/EncryptedFilePlugin/Nodes/FileComponent.tsx index 247110048f7..a10b4a1d5aa 100644 --- a/packages/web/src/javascripts/Components/SuperEditor/Plugins/EncryptedFilePlugin/Nodes/FileComponent.tsx +++ b/packages/web/src/javascripts/Components/SuperEditor/Plugins/EncryptedFilePlugin/Nodes/FileComponent.tsx @@ -142,8 +142,7 @@ function FileComponent({
- {c('B4.Notes.EditingUI.Status').t`Uploading file "`} - {uploadProgress.file.name}"... ({progress}%) + {c('B4.Notes.EditingUI.Status').jt`Uploading file "${uploadProgress.file.name}" (${progress}%)`}
-
- {c('B4.Notes.EditingUI.Label').t`Unable to find file`} {fileUuid} -
+
{c('B4.Notes.EditingUI.Label').jt`Unable to find file ${fileUuid}`}
) }