Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/mobile/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ platform :ios do
end

platform :android do
def android_package_name(variant)
variant == 'dev' ? 'com.standardnotes.dev' : 'com.standardnotes'
end

def build_android(variant, versionCode)
gradle(
task: 'bundle',
Expand All @@ -132,6 +136,7 @@ platform :android do
sh('yarn run android:bundle')
build_android(variant, versionCode)
upload_to_play_store(
package_name: android_package_name(variant),
track: track,
json_key_data: (ENV['GOOGLE_PLAY_JSON_KEY_DATA']).to_s,
skip_upload_metadata: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const ClippedNoteView = ({
if (
await confirmDialog({
text: c('B4.Notes.EditingUI.Confirmation').t`Are you sure you want to discard this clip?`,
confirmButtonText: 'Discard',
confirmButtonText: c('B4.Notes.EditingUI.Action').t`Discard`,
confirmButtonStyle: 'danger',
})
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { FileItem, SNNote } from '@standardnotes/snjs'
import { useMemo, useState, createContext, ReactNode, useRef, useCallback, useEffect, useContext, memo } from 'react'
import Portal from './Portal/Portal'
import { ElementIds } from '@/Constants/ElementIDs'
import { FeatureName, getFeatureNameLabel } from '@/Controllers/FeatureName'
import { c } from 'ttag'

type FileDragTargetCommonData = {
Expand Down Expand Up @@ -198,7 +199,7 @@ const FileDragNDropProvider = ({ application, children }: Props) => {
resetState()

if (!application.featuresController.entitledToFiles) {
premiumModal.activate('Files')
premiumModal.activate(getFeatureNameLabel(FeatureName.Files))
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ const FileViewWithoutProtection = ({ application, file }: FileViewProps) => {

if (target) {
addDragTarget(target, {
tooltipText: 'Drop your files to upload and link them to the current file',
tooltipText: c('B7.FilesSubscriptionHelp.Files.Info')
.t`Drop your files to upload and link them to the current file`,
async callback(uploadedFile) {
await application.linkingController.linkItems(uploadedFile, file)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ const AccountMenuButton = ({ hasError, controller, mainApplicationGroup, onClick
const { show: isOpen } = controller

useEffect(
() => application.commands.add('open-acc-menu', 'Open account menu', toggleMenu, 'account-circle'),
() =>
application.commands.add(
'open-acc-menu',
c('B2.NavSharedUI.Label').t`Open account menu`,
toggleMenu,
'account-circle',
),
[application.commands, toggleMenu],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ const ImportModalFileItem = ({
className="mr-2 rounded border border-border bg-default px-2 py-1 text-sm"
defaultValue={file.service ? file.service : undefined}
>
<option value="evernote">{c('B1.Account.ImportExport.ImportSource').t`Evernote`}</option>
<option value="simplenote">{c('B1.Account.ImportExport.ImportSource').t`Simplenote`}</option>
<option value="google-keep">{c('B1.Account.ImportExport.ImportSource').t`Google Keep`}</option>
<option value="aegis">{c('B1.Account.ImportExport.ImportSource').t`Aegis`}</option>
<option value="evernote">Evernote</option>
<option value="simplenote">Simplenote</option>
<option value="google-keep">Google Keep</option>
<option value="aegis">Aegis</option>
<option value="plaintext">{c('B1.Account.ImportExport.ImportSource').t`Plaintext`}</option>
<option value="html">{c('B1.Account.ImportExport.ImportSource').t`HTML`}</option>
<option value="html">HTML</option>
<option value="super">{SuperName}</option>
</select>
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Icon from '../Icon/Icon'
import { useApplication } from '../ApplicationProvider'
import { FeatureName } from '@/Controllers/FeatureName'
import { NativeFeatureIdentifier, FeatureStatus } from '@standardnotes/snjs'
import { SuperName, jtString } from '@standardnotes/features'
import { SuperName } from '@standardnotes/features'
import { c } from 'ttag'

type Props = {
Expand Down Expand Up @@ -37,27 +37,27 @@ const ImportModalInitialPage = ({ setFiles, selectFiles }: Props) => {
<div className="flex flex-wrap items-center justify-center gap-4">
<Button className="flex items-center !py-2" onClick={() => selectFiles('evernote')}>
<Icon type="evernote" className="mr-2 text-[#14cc45]" />
{c('B1.Account.ImportExport.ImportSource').t`Evernote`}
Evernote
</Button>
<Button className="flex items-center !py-2" onClick={() => selectFiles('google-keep')}>
<Icon type="gkeep" className="mr-2 text-[#fbbd00]" />
{c('B1.Account.ImportExport.ImportSource').t`Google Keep`}
Google Keep
</Button>
<Button className="flex items-center !py-2" onClick={() => selectFiles('simplenote')}>
<Icon type="simplenote" className="mr-2 text-[#3360cc]" />
{c('B1.Account.ImportExport.ImportSource').t`Simplenote`}
Simplenote
</Button>
<Button className="flex items-center !py-2" onClick={() => selectFiles('aegis')}>
<Icon type="aegis" className="mr-2 rounded bg-[#0d47a1] p-1 text-[#fff]" size="normal" />
{c('B1.Account.ImportExport.ImportSource').t`Aegis`}
Aegis
</Button>
<Button className="flex items-center !py-2" onClick={() => selectFiles('plaintext')}>
<Icon type="plain-text" className="mr-2 text-info" />
{c('B1.Account.ImportExport.ImportSource').t`Plaintext / Markdown`}
</Button>
<Button className="flex items-center !py-2" onClick={() => selectFiles('html')}>
<Icon type="rich-text" className="mr-2 text-accessory-tint-2" />
{c('B1.Account.ImportExport.ImportSource').t`HTML`}
HTML
</Button>
<Button
className="flex items-center !py-2"
Expand All @@ -74,7 +74,7 @@ const ImportModalInitialPage = ({ setFiles, selectFiles }: Props) => {
}}
>
<Icon type="file-doc" className="mr-2 text-accessory-tint-1" />
{jtString(c('B1.Account.ImportExport.ImportSource').jt`${SuperName} (JSON)`)}
{`${SuperName} (JSON)`}
</Button>
</div>
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ListedName } from '@standardnotes/features'
import { c } from 'ttag'
import { PreferencesMenuItem } from './PreferencesMenuItem'

Expand All @@ -8,7 +9,7 @@ export const PREFERENCES_MENU_ITEMS: PreferencesMenuItem[] = [
{ id: 'security', label: c('B6.Preferences.Other.Label').t`Security`, icon: 'security', order: 4 },
{ id: 'backups', label: c('B6.Preferences.Other.Action').t`Backups`, icon: 'restore', order: 5 },
{ id: 'appearance', label: c('B6.Preferences.Other.Label').t`Appearance`, icon: 'themes', order: 6 },
{ id: 'listed', label: 'Listed', icon: 'listed', order: 7 },
{ id: 'listed', label: ListedName, icon: 'listed', order: 7 },
{ id: 'shortcuts', label: c('B6.Preferences.Other.Label').t`Shortcuts`, icon: 'keyboard', order: 8 },
{ id: 'plugins', label: c('B6.Preferences.Other.Label').t`Plugins`, icon: 'dashboard', order: 8 },
{ id: 'accessibility', label: c('B6.Preferences.Other.Label').t`Accessibility`, icon: 'accessibility', order: 9 },
Expand All @@ -23,7 +24,7 @@ export const READY_PREFERENCES_MENU_ITEMS: PreferencesMenuItem[] = [
{ id: 'security', label: c('B6.Preferences.Other.Label').t`Security`, icon: 'security', order: 4 },
{ id: 'backups', label: c('B6.Preferences.Other.Action').t`Backups`, icon: 'restore', order: 5 },
{ id: 'appearance', label: c('B6.Preferences.Other.Label').t`Appearance`, icon: 'themes', order: 6 },
{ id: 'listed', label: 'Listed', icon: 'listed', order: 7 },
{ id: 'listed', label: ListedName, icon: 'listed', order: 7 },
{ id: 'plugins', label: c('B6.Preferences.Other.Label').t`Plugins`, icon: 'dashboard', order: 8 },
{ id: 'help-feedback', label: c('B6.Preferences.Other.Label').t`Help & feedback`, icon: 'help', order: 11 },
]
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,51 @@ type Props = {
application: WebApplication
}

function getEditorFontSizeLabel(fontSize: EditorFontSize): string {
switch (fontSize) {
case EditorFontSize.ExtraSmall:
return c('B6.Preferences.Appearance.Label').t`Extra small`
case EditorFontSize.Small:
return c('B6.Preferences.Appearance.Label').t`Small`
case EditorFontSize.Normal:
return c('B6.Preferences.Appearance.Label').t`Normal`
case EditorFontSize.Medium:
return c('B6.Preferences.Appearance.Label').t`Medium`
case EditorFontSize.Large:
return c('B6.Preferences.Appearance.Label').t`Large`
}
}

function getEditorLineHeightLabel(lineHeight: EditorLineHeight): string {
switch (lineHeight) {
case EditorLineHeight.None:
return c('B6.Preferences.Appearance.Label').t`None`
case EditorLineHeight.Tight:
return c('B6.Preferences.Appearance.Label').t`Tight`
case EditorLineHeight.Snug:
return c('B6.Preferences.Appearance.Label').t`Snug`
case EditorLineHeight.Normal:
return c('B6.Preferences.Appearance.Label').t`Normal`
case EditorLineHeight.Relaxed:
return c('B6.Preferences.Appearance.Label').t`Relaxed`
case EditorLineHeight.Loose:
return c('B6.Preferences.Appearance.Label').t`Loose`
}
}

function getEditorLineWidthLabel(width: EditorLineWidth): string {
switch (width) {
case EditorLineWidth.Narrow:
return c('B4.Notes.EditorOptions.Label').t`Narrow`
case EditorLineWidth.Wide:
return c('B4.Notes.EditorOptions.Label').t`Wide`
case EditorLineWidth.Dynamic:
return c('B4.Notes.EditorOptions.Label').t`Dynamic`
case EditorLineWidth.FullWidth:
return c('B4.Notes.EditorOptions.Label').t`Full width`
}
}

const EditorDefaults = ({ application }: Props) => {
const [lineHeight, setLineHeight] = useLocalPreference(LocalPrefKey.EditorLineHeight)

Expand All @@ -27,7 +72,7 @@ const EditorDefaults = ({ application }: Props) => {
const lineHeightDropdownOptions = useMemo(
() =>
Object.values(EditorLineHeight).map((lineHeight) => ({
label: lineHeight,
label: getEditorLineHeightLabel(lineHeight),
value: lineHeight,
})),
[],
Expand All @@ -46,7 +91,7 @@ const EditorDefaults = ({ application }: Props) => {
const fontSizeDropdownOptions = useMemo(
() =>
Object.values(EditorFontSize).map((fontSize) => ({
label: fontSize,
label: getEditorFontSizeLabel(fontSize),
value: fontSize,
})),
[],
Expand Down Expand Up @@ -118,7 +163,7 @@ const EditorDefaults = ({ application }: Props) => {
className="flex w-full min-w-55 items-center justify-between rounded border border-border bg-default px-3.5 py-1.5 text-left text-base text-foreground md:w-fit lg:text-sm"
onClick={toggleEditorWidthModal}
>
{editorWidth === EditorLineWidth.FullWidth ? 'Full width' : editorWidth}
{getEditorLineWidthLabel(editorWidth)}
<Icon type="chevron-down" size="normal" />
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Moments: FunctionComponent<Props> = ({ application }: Props) => {

const enable = useCallback(() => {
if (!application.featuresController.entitledToFiles) {
premiumModal.activate('Moments')
premiumModal.activate(c('B6.Preferences.General.Title').t`Moments`)
return
}
void application.momentsService.enableMoments()
Expand All @@ -58,7 +58,7 @@ const Moments: FunctionComponent<Props> = ({ application }: Props) => {

const takePhoto = useCallback(() => {
if (!application.featuresController.entitledToFiles) {
premiumModal.activate('Moments')
premiumModal.activate(c('B6.Preferences.General.Title').t`Moments`)
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const EditSmartViewModal = ({ controller, platform }: Props) => {
mobileSlot: 'left',
},
{
label: isSaving ? <Spinner className="h-4.5 w-4.5" /> : 'Save',
label: isSaving ? <Spinner className="h-4.5 w-4.5" /> : c('B6.Preferences.General.Action').t`Save`,
onClick: saveSmartView,
disabled: isSaving,
type: 'primary',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,12 @@ const VaultItem = ({ vault }: Props) => {
)}
<div className="mt-2 flex w-full flex-wrap gap-3">
<Button label={c('B6.Preferences.Vaults.Action').t`Edit`} onClick={openEditModal} />
{canShowLockOption && <Button label={isLocked ? 'Unlock' : 'Lock'} onClick={toggleLock} />}
{canShowLockOption && (
<Button
label={isLocked ? c('B2.NavSharedUI.Action').t`Unlock vault` : c('B2.NavSharedUI.Action').t`Lock vault`}
onClick={toggleLock}
/>
)}
{isCurrentUserOwner && (
<Button colorStyle="danger" label={c('B6.Preferences.Vaults.Action').t`Delete`} onClick={deleteVault} />
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ListableContentItem } from '@/Components/ContentListView/Types/ListableContentItem'
import { debounce, destroyAllObjectProperties, isMobileScreen } from '@/Utils'
import { c } from 'ttag'
import { c, msgid } from 'ttag'
import {
ApplicationEvent,
CollectionSort,
Expand Down Expand Up @@ -80,7 +80,7 @@ export class ItemListController
items: ListableContentItem[] = []
notesToDisplay = 0
pageSize = 0
panelTitle = 'Notes'
panelTitle = c('B4.Notes.TagsLinkedItems.Label').t`Notes`
renderedItems: ListableContentItem[] = []
searchSubmitted = false
showDisplayOptionsMenu = false
Expand Down Expand Up @@ -417,13 +417,19 @@ export class ItemListController
}

reloadPanelTitle = () => {
let title = this.panelTitle
let title = c('B4.Notes.TagsLinkedItems.Label').t`Notes`

if (this.isFiltering) {
const resultCount = this.items.length
title = `${resultCount} search results`
title = jtString(
c('B3.Notes.NoteList.Info').ngettext(
msgid`${resultCount} search result`,
`${resultCount} search results`,
resultCount,
),
)
} else if (this.navigationController.selected) {
title = `${this.navigationController.selected.title}`
title = this.navigationController.selected.title
}

this.panelTitle = title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
VaultServiceInterface,
} from '@standardnotes/snjs'
import { action, computed, makeObservable, observable } from 'mobx'
import { c } from 'ttag'
import { AbstractViewController } from './Abstract/AbstractViewController'
import { CrossControllerEvent } from './CrossControllerEvent'
import { FilesController } from './FilesController'
Expand Down Expand Up @@ -241,7 +242,7 @@ export class LinkingController extends AbstractViewController implements Interna
if (isNote(item)) {
if (isNote(itemToLink) && !this.isEntitledToNoteLinking) {
void this.publishCrossControllerEventSync(CrossControllerEvent.DisplayPremiumModal, {
featureName: 'Note linking',
featureName: c('B4.Notes.LinkedItems.Label').t`Note linking`,
})
return
}
Expand Down Expand Up @@ -282,7 +283,7 @@ export class LinkingController extends AbstractViewController implements Interna
const cannotLinkItem = !this.isEntitledToNoteLinking && itemToLink instanceof SNNote
if (cannotLinkItem) {
void this.publishCrossControllerEventSync(CrossControllerEvent.DisplayPremiumModal, {
featureName: 'Note linking',
featureName: c('B4.Notes.LinkedItems.Label').t`Note linking`,
})
return false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ export class MomentsService extends AbstractViewController implements InternalEv
}
}

const filename = `Moment ${dateToStringStyle1(new Date())}.png`
const date = dateToStringStyle1(new Date())
const filename = jtString(c('B4.Notes.EditingUI.Label').jt`Moment ${date}.png`)
const camera = new PhotoRecorder()
await camera.initialize()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { RevisionType } from '@/Components/RevisionHistoryModal/RevisionType'
import { sortRevisionListIntoGroups } from '@/Components/RevisionHistoryModal/utils'
import { STRING_RESTORE_LOCKED_ATTEMPT } from '@/Constants/Strings'
import { confirmDialog } from '@standardnotes/ui-services'
import { jtString } from '@standardnotes/features'
import { c } from 'ttag'
import {
Action,
Expand Down Expand Up @@ -352,7 +353,9 @@ export class NoteHistoryController {

const duplicatedItem = await this.mutator.duplicateItem(originalNote, false, {
...revision.payload.content,
title: revision.payload.content.title ? revision.payload.content.title + ' (copy)' : undefined,
title: revision.payload.content.title
? jtString(c('B4.Notes.History.Label').jt`${revision.payload.content.title} (copy)`)
: undefined,
})

void this.sync.sync()
Expand Down
Loading