Skip to content
Open
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
212 changes: 211 additions & 1 deletion backend/locales/en.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async function applyLocale (locale) {
} catch (err) {
$q.notify({
type: 'negative',
message: `Failed to load ${locale} locale strings.`,
message: i18n.t('common.locale.loadFailed', { locale }),
caption: err.message
})
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/ApiKeyCreateDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ async function create () {
onDialogOK()
})
} else {
throw new Error(resp?.data?.createApiKey?.operation?.message || 'An unexpected error occured.')
throw new Error(resp?.data?.createApiKey?.operation?.message || t('common.error.unexpected'))
}
} catch (err) {
$q.notify({
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/ApiKeyRevokeDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async function confirm () {
})
onDialogOK()
} else {
throw new Error(resp?.data?.revokeApiKey?.operation?.message || 'An unexpected error occured.')
throw new Error(resp?.data?.revokeApiKey?.operation?.message || t('common.error.unexpected'))
}
} catch (err) {
$q.notify({
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/AssetDeleteDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async function confirm () {
})
onDialogOK()
} else {
throw new Error(resp?.data?.deleteAsset?.operation?.message || 'An unexpected error occured.')
throw new Error(resp?.data?.deleteAsset?.operation?.message || t('common.error.unexpected'))
}
} catch (err) {
$q.notify({
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/AssetRenameDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ async function rename () {
})
onDialogOK()
} else {
throw new Error(resp?.data?.renameAsset?.operation?.message || 'An unexpected error occured.')
throw new Error(resp?.data?.renameAsset?.operation?.message || t('common.error.unexpected'))
}
} catch (err) {
$q.notify({
Expand Down Expand Up @@ -150,7 +150,7 @@ onMounted(async () => {
}
})
if (resp?.data?.assetById?.id !== props.assetId) {
throw new Error('Failed to fetch asset data.')
throw new Error(t('fileman.fetchAssetDataFailed'))
}
state.path = resp.data.assetById.fileName
} catch (err) {
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/AuthLoginPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ function switchTo (screen) {
break
}
default: {
throw new Error('Invalid Screen')
throw new Error(t('common.error.unexpected'))
}
}
}
Expand Down Expand Up @@ -576,7 +576,7 @@ async function handleLoginResponse (resp) {
$q.loading.hide()
$q.notify({
type: 'negative',
message: 'Unexpected Authentication Response'
message: t('auth.errors.unexpectedResponse')
})
}
}
Expand Down Expand Up @@ -705,7 +705,7 @@ async function forgotPassword () {
// TODO: Implement forgot password
$q.notify({
type: 'negative',
message: 'Not implemented yet.'
message: t('auth.forgotPasswordUnavailable')
})
} catch (err) {
$q.notify({
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/ChangePwdDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ q-dialog(ref='dialogRef', @hide='onDialogHide')
@click='randomizePassword'
)
q-icon(name='las la-dice-d6')
.q-pl-xs.text-caption: strong Generate
.q-pl-xs.text-caption: strong {{ t('common.actions.generate') }}
q-item
blueprint-icon(icon='good-pincode')
q-item-section
Expand Down Expand Up @@ -235,7 +235,7 @@ async function save () {
})
onDialogOK()
} else {
throw new Error(resp?.data?.changePassword?.operation?.message || 'An unexpected error occured.')
throw new Error(resp?.data?.changePassword?.operation?.message || t('common.error.unexpected'))
}
} catch (err) {
$q.notify({
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/CheckUpdateDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ async function check () {
state.latest = resp.latest
state.latestDate = DateTime.fromISO(resp.latestDate).toFormat(userStore.preferredDateFormat)
} else {
throw new Error(resp?.message || 'An unexpected error occured.')
throw new Error(resp?.message || t('common.error.unexpected'))
}
} catch (err) {
$q.notify({
Expand Down
26 changes: 13 additions & 13 deletions frontend/src/components/EditorMarkdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
q-item-section(side)
q-icon(name='las la-folder-open', color='positive')
q-item-section
q-item-label From File Manager...
q-item-label {{ t('editor.markup.fromFileManager') }}
q-item(
clickable
@click='getAssetFromClipboard'
Expand All @@ -35,7 +35,7 @@
q-item-section(side)
q-icon(name='las la-clipboard', color='brown')
q-item-section
q-item-label From Clipboard...
q-item-label {{ t('editor.markup.fromClipboard') }}
q-item(
clickable
@click='notImplemented'
Expand All @@ -44,7 +44,7 @@
q-item-section(side)
q-icon(name='las la-cloud-download-alt', color='blue')
q-item-section
q-item-label From Remote URL...
q-item-label {{ t('editor.markup.fromRemoteURL') }}
q-tooltip(anchor='center right' self='center left') {{ t('editor.markup.insertAssets') }}
q-btn(
icon='mdi-code-json'
Expand Down Expand Up @@ -103,7 +103,7 @@
)
q-tooltip(anchor='center right' self='center left') {{ t('editor.markup.insertHorizontalBar') }}
q-space
span.editor-markdown-type Markdown
span.editor-markdown-type {{ t('editor.markup.markdown') }}
.editor-markdown-mid
//--------------------------------------------------------
//- TOP TOOLBAR
Expand Down Expand Up @@ -506,7 +506,7 @@ async function getAssetFromClipboard () {
name: 'clipboard-read'
})
if (permission.state === 'denied') {
throw new Error('Not allowed to read clipboard.')
throw new Error(t('editor.markup.clipboardReadDenied'))
}
const clipboardContents = await navigator.clipboard.read()
let hasValidItem = false
Expand All @@ -522,12 +522,12 @@ async function getAssetFromClipboard () {
}
}
if (!hasValidItem) {
throw new Error('No supported content found in the Clipboard.')
throw new Error(t('editor.markup.clipboardUnsupported'))
}
} catch (err) {
return $q.notify({
type: 'negative',
message: 'Unable to copy from Clipboard',
message: t('editor.markup.clipboardError'),
caption: err.message
})
}
Expand Down Expand Up @@ -592,7 +592,7 @@ onMounted(async () => {
contextMenuOrder: 0,
id: 'markdown.extension.editing.toggleBold',
keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyB],
label: 'Toggle bold',
label: t('editor.markup.toggleBold'),
precondition: '',
run (ed) {
toggleMarkup({ start: '**' })
Expand All @@ -604,7 +604,7 @@ onMounted(async () => {
contextMenuOrder: 0,
id: 'markdown.extension.editing.toggleItalic',
keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyI],
label: 'Toggle italic',
label: t('editor.markup.toggleItalic'),
precondition: '',
run (ed) {
toggleMarkup({ start: '*' })
Expand All @@ -614,7 +614,7 @@ onMounted(async () => {
editor.addAction({
id: 'markdown.extension.editing.increaseHeaderLevel',
keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyMod.Alt | monaco.KeyCode.RightArrow],
label: 'Increase Header Level',
label: t('editor.markup.increaseHeaderLevel'),
precondition: '',
run (ed) {
let lvl = getHeaderLevel()
Expand All @@ -625,7 +625,7 @@ onMounted(async () => {
editor.addAction({
id: 'markdown.extension.editing.decreaseHeaderLevel',
keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyMod.Alt | monaco.KeyCode.LeftArrow],
label: 'Decrease Header Level',
label: t('editor.markup.decreaseHeaderLevel'),
precondition: '',
run (ed) {
let lvl = getHeaderLevel()
Expand All @@ -637,7 +637,7 @@ onMounted(async () => {
editor.addAction({
id: 'save',
keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyS],
label: 'Save',
label: t('common.actions.save'),
precondition: '',
run (ed) {
}
Expand Down Expand Up @@ -754,7 +754,7 @@ onBeforeUnmount(() => {
function notImplemented () {
$q.notify({
type: 'negative',
message: 'Not implemented'
message: t('common.error.notImplemented')
})
}
</script>
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/EditorMarkdownConfigOverlay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ async function load () {
} catch (err) {
$q.notify({
type: 'negative',
message: 'Failed to fetch markdown editor configuration.'
message: t('editor.markup.fetchConfigFailed')
})
}
$q.loading.hide()
Expand Down Expand Up @@ -398,12 +398,12 @@ async function save () {
editorStore.$patch({ configIsLoaded: false })
close()
} else {
throw new Error(respRaw?.data?.updateSite?.operation?.message || 'An unexpected error occured.')
throw new Error(respRaw?.data?.updateSite?.operation?.message || t('common.error.unexpected'))
}
} catch (err) {
$q.notify({
type: 'negative',
message: 'Failed to save Markdown editor config',
message: t('editor.markup.saveConfigFailed'),
caption: err.message
})
}
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/EditorMarkdownUserSettingsOverlay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ async function load () {
} catch (err) {
$q.notify({
type: 'negative',
message: 'Failed to fetch Markdown editor settings.'
message: t('editor.markup.fetchUserSettingsFailed')
})
}
$q.loading.hide()
Expand Down Expand Up @@ -179,12 +179,12 @@ async function save () {
})
close()
} else {
throw new Error(respRaw?.data?.saveUserEditorSettings?.operation?.message || 'An unexpected error occured.')
throw new Error(respRaw?.data?.saveUserEditorSettings?.operation?.message || t('common.error.unexpected'))
}
} catch (err) {
$q.notify({
type: 'negative',
message: 'Failed to save Markdown editor settings.',
message: t('editor.markup.saveUserSettingsFailed'),
caption: err.message
})
}
Expand Down
22 changes: 11 additions & 11 deletions frontend/src/components/FileManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ q-layout.fileman(view='hHh lpR lFr', container)
q-item(clickable)
q-item-section(side)
q-icon(name='las la-list', color='grey', size='xs')
q-item-section.q-pr-sm Browse using...
q-item-section.q-pr-sm {{ t('fileman.browseUsing') }}
q-item-section(side)
q-icon(name='las la-angle-right', color='grey', size='xs')
q-menu(
Expand All @@ -149,31 +149,31 @@ q-layout.fileman(view='hHh lpR lFr', container)
:color='state.displayMode === `path` ? `positive` : `grey`'
size='xs'
)
q-item-section.q-pr-sm Browse Using Paths
q-item-section.q-pr-sm {{ t('pageSaveDialog.displayModePath') }}
q-item(clickable, @click='state.displayMode = `title`')
q-item-section(side)
q-icon(
:name='state.displayMode === `title` ? `las la-check-circle` : `las la-circle`'
:color='state.displayMode === `title` ? `positive` : `grey`'
size='xs'
)
q-item-section.q-pr-sm Browse Using Titles
q-item-section.q-pr-sm {{ t('pageSaveDialog.displayModeTitle') }}
q-item(clickable, @click='state.isCompact = !state.isCompact')
q-item-section(side)
q-icon(
:name='state.isCompact ? `las la-check-square` : `las la-stop`'
:color='state.isCompact ? `positive` : `grey`'
size='xs'
)
q-item-section.q-pr-sm Compact List
q-item-section.q-pr-sm {{ t('fileman.compactList') }}
q-item(clickable, @click='state.shouldShowFolders = !state.shouldShowFolders')
q-item-section(side)
q-icon(
:name='state.shouldShowFolders ? `las la-check-square` : `las la-stop`'
:color='state.shouldShowFolders ? `positive` : `grey`'
size='xs'
)
q-item-section.q-pr-sm Show Folders
q-item-section.q-pr-sm {{ t('fileman.showFolders') }}
q-btn.q-mr-sm(
flat
dense
Expand Down Expand Up @@ -221,10 +221,10 @@ q-layout.fileman(view='hHh lpR lFr', container)
)
.fileman-loadinglist(v-if='state.fileListLoading')
q-spinner.q-mr-sm(color='primary', size='64px', :thickness='1')
span.text-primary Fetching folder contents...
span.text-primary {{ t('fileman.fetchingFolderContents') }}
.fileman-emptylist(v-else-if='files.length < 1')
img(src='/_assets/icons/carbon-copy-empty-box.svg')
span This folder is empty.
span {{ t('common.pageSelector.folderEmptyWarning') }}
q-list.fileman-filelist(
v-else
:class='state.isCompact && `is-compact`'
Expand Down Expand Up @@ -689,7 +689,7 @@ async function loadTree ({ parentId = null, parentPath = null, types, initLoad =
} catch (err) {
$q.notify({
type: 'negative',
message: 'Failed to load folder tree.',
message: t('fileman.loadTreeFailed'),
caption: err.message
})
}
Expand Down Expand Up @@ -900,7 +900,7 @@ async function uploadNewFiles () {
}
})
if (!resp?.data?.uploadAssets?.operation?.succeeded) {
throw new Error(resp?.data?.uploadAssets?.operation?.message || 'An unexpected error occured.')
throw new Error(resp?.data?.uploadAssets?.operation?.message || t('common.error.unexpected'))
}
}
state.uploadPercentage = 100
Expand All @@ -912,7 +912,7 @@ async function uploadNewFiles () {
} catch (err) {
$q.notify({
type: 'negative',
message: 'Failed to upload file.',
message: t('fileman.uploadFailed'),
caption: err.message
})
}
Expand Down Expand Up @@ -995,7 +995,7 @@ async function copyItemURL (item) {
} catch (err) {
$q.notify({
type: 'negative',
message: 'Failed to copy URL to clipboard.',
message: t('fileman.copyURLFailed'),
caption: err.message
})
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/FolderCreateDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ async function create () {
})
onDialogOK()
} else {
throw new Error(resp?.data?.createFolder?.operation?.message || 'An unexpected error occured.')
throw new Error(resp?.data?.createFolder?.operation?.message || t('common.error.unexpected'))
}
} catch (err) {
$q.notify({
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/FolderDeleteDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async function confirm () {
})
onDialogOK()
} else {
throw new Error(resp?.data?.deleteFolder?.operation?.message || 'An unexpected error occured.')
throw new Error(resp?.data?.deleteFolder?.operation?.message || t('common.error.unexpected'))
}
} catch (err) {
$q.notify({
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/FolderRenameDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ async function rename () {
})
onDialogOK()
} else {
throw new Error(resp?.data?.renameFolder?.operation?.message || 'An unexpected error occured.')
throw new Error(resp?.data?.renameFolder?.operation?.message || t('common.error.unexpected'))
}
} catch (err) {
$q.notify({
Expand Down Expand Up @@ -210,7 +210,7 @@ onMounted(async () => {
}
})
if (resp?.data?.folderById?.id !== props.folderId) {
throw new Error('Failed to fetch folder data.')
throw new Error(t('fileman.fetchFolderDataFailed'))
}
state.path = resp.data.folderById.fileName
state.title = resp.data.folderById.title
Expand Down
Loading