Skip to content

📚 The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

refactor: cleanup translations & codes

Smaug6739991848e03be6
diff --git a/frontend/app/components/MarkdownEditor/GridOrganizationModal.vue b/frontend/app/components/MarkdownEditor/GridOrganizationModal.vue
index f4c54b0e..0420f707 100644
--- a/frontend/app/components/MarkdownEditor/GridOrganizationModal.vue
+++ b/frontend/app/components/MarkdownEditor/GridOrganizationModal.vue
@@ -1,6 +1,6 @@
<template>
<div>
- <EditorAppHeader icon="grid" :title="t('markdown.markdown.table.title')" :subtitle="t('markdown.markdown.table.subtitle')" />
+ <EditorAppHeader icon="grid" :title="t('markdown.table.title')" :subtitle="t('markdown.table.subtitle')" />
<div>
<div class="table-grid">
@@ -20,8 +20,8 @@
</div>
</div>
<div class="table-info">
- <span v-if="hoveredSize">{{ t('markdown.markdown.table.tableSize', { rows: hoveredSize.rows, columns: hoveredSize.columns }) }}</span>
- <span v-else>{{ t('markdown.markdown.table.hoverHint') }}</span>
+ <span v-if="hoveredSize">{{ t('markdown.table.tableSize', { rows: hoveredSize.rows, columns: hoveredSize.columns }) }}</span>
+ <span v-else>{{ t('markdown.table.hoverHint') }}</span>
</div>
</div>
</div>
diff --git a/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue b/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue
index 2380804d..70ab826d 100644
--- a/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue
+++ b/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue
@@ -1,12 +1,12 @@
<template>
<div class="container">
- <EditorAppHeader icon="image" :title="t('markdown.markdown.image.title')" :subtitle="t('markdown.markdown.image.subtitle')" />
+ <EditorAppHeader icon="image" :title="t('markdown.image.title')" :subtitle="t('markdown.image.subtitle')" />
<div class="content">
<AppDrop ref="dropComponent" @select="submitFile as (file: File) => void" />
<Loader v-if="isLoading" style="margin: 12px auto" />
<p v-if="uploadError" class="error">{{ uploadError }}</p>
<div class="search-bar">
- <input v-model="searchQuery" :placeholder="t('markdown.markdown.image.searchPlaceholder')" />
+ <input v-model="searchQuery" :placeholder="t('markdown.image.searchPlaceholder')" />
</div>
<div class="images-grid">
<div v-for="image in filteredImages.values()" :key="image.id" class="image-item" @click="selectImage(image)">
@@ -19,7 +19,7 @@
</div>
<div v-if="filteredImages.size === 0" class="no-images">
- <p>{{ t('markdown.markdown.image.noImages') }}</p>
+ <p>{{ t('markdown.image.noImages') }}</p>
</div>
</div>
</div>
@@ -51,7 +51,7 @@ const submitFile = (selectedFile: File) => {
dropComponent.value.reset(); // Reset drop component
resourcesStore
.post(body)
- .catch(e => (uploadError.value = e || t('markdown.markdown.image.uploadError')))
+ .catch(e => (uploadError.value = e || t('markdown.image.uploadError')))
.finally(() => (isLoading.value = false));
};
diff --git a/frontend/app/components/MarkdownEditor/Toolbar.vue b/frontend/app/components/MarkdownEditor/Toolbar.vue
index 2e53fac1..0611c18e 100644
--- a/frontend/app/components/MarkdownEditor/Toolbar.vue
+++ b/frontend/app/components/MarkdownEditor/Toolbar.vue
@@ -61,7 +61,7 @@
<div class="group-buttons">
<VoiceRecognition :class="{ 'no-mobile': mobileSimplifiedView }" @transcription="handleTranscription" />
</div>
- <AppSelect v-model="localValue.parent_id" :items="categories" nullable :placeholder="t('markdown.markdown.toolbar.category')" class="category-select" />
+ <AppSelect v-model="localValue.parent_id" :items="categories" nullable :placeholder="t('markdown.toolbar.category')" class="category-select" />
</div>
<!-- Right Section -->
@@ -70,25 +70,25 @@
<div v-if="displayStats" class="stats-badge no-tablet">
<div class="stat-item">
<span class="stat-value">{{ stats.words }}</span>
- <span class="stat-label">{{ t('markdown.markdown.stats.words') }}</span>
+ <span class="stat-label">{{ t('markdown.stats.words') }}</span>
</div>
<div class="stat-divider" />
<div class="stat-item">
<span class="stat-value">{{ stats.characters }}</span>
- <span class="stat-label">{{ t('markdown.markdown.stats.chars') }}</span>
+ <span class="stat-label">{{ t('markdown.stats.chars') }}</span>
</div>
<div class="stat-divider" />
<div class="stat-item">
<span class="stat-value">{{ stats.lines }}</span>
- <span class="stat-label">{{ t('markdown.markdown.stats.lines') }}</span>
+ <span class="stat-label">{{ t('markdown.stats.lines') }}</span>
</div>
</div>
<!-- Actions & Settings Group -->
<div class="action-buttons">
- <button class="toolbar-btn btn-ghost" :aria-label="t('markdown.markdown.toolbar.clearFormatting')" @click="emitAction('clearFormatting')">
+ <button class="toolbar-btn btn-ghost" :aria-label="t('markdown.toolbar.clearFormatting')" @click="emitAction('clearFormatting')">
<Icon name="format/clear-formatting" />
- <span class="tooltip">{{ t('markdown.markdown.toolbar.clearFormatting') }}<kbd>Ctrl+Shift+X</kbd></span>
+ <span class="tooltip">{{ t('markdown.toolbar.clearFormatting') }}<kbd>Ctrl+Shift+X</kbd></span>
</button>
<button
v-for="item in actionTools"
@@ -106,11 +106,11 @@
<div class="action-divider" />
<button class="toolbar-btn btn-ghost" aria-label="Settings" @click="openSettings">
<Icon name="settings" display="lg" />
- <span class="tooltip">{{ t('markdown.markdown.toolbar.editorSettings') }}</span>
+ <span class="tooltip">{{ t('markdown.toolbar.editorSettings') }}</span>
</button>
<button class="toolbar-btn btn-ghost" aria-label="Help" @click="openHelp">
<Icon name="help" display="lg" />
- <span class="tooltip">{{ t('markdown.markdown.toolbar.markdownSyntax') }}</span>
+ <span class="tooltip">{{ t('markdown.toolbar.markdownSyntax') }}</span>
</button>
</div>
</div>
@@ -178,42 +178,42 @@ interface ToolItem {
}
const formattingTools = computed<ToolItem[]>(() => [
- { name: t('markdown.markdown.toolbar.bold'), icon: 'format/bold', action: 'bold', shortcut: 'Ctrl+B' },
- { name: t('markdown.markdown.toolbar.italic'), icon: 'format/italic', action: 'italic', shortcut: 'Ctrl+I' },
- { name: t('markdown.markdown.toolbar.underline'), icon: 'format/underline', action: 'underline', shortcut: 'Ctrl+U' },
- { name: t('markdown.markdown.toolbar.strikethrough'), icon: 'format/strikethrough', action: 'strike', shortcut: 'Ctrl+Shift+S' },
- { name: t('markdown.markdown.toolbar.highlight'), icon: 'format/highlight', action: 'mark', shortcut: 'Ctrl+Shift+H' },
+ { name: t('markdown.toolbar.bold'), icon: 'format/bold', action: 'bold', shortcut: 'Ctrl+B' },
+ { name: t('markdown.toolbar.italic'), icon: 'format/italic', action: 'italic', shortcut: 'Ctrl+I' },
+ { name: t('markdown.toolbar.underline'), icon: 'format/underline', action: 'underline', shortcut: 'Ctrl+U' },
+ { name: t('markdown.toolbar.strikethrough'), icon: 'format/strikethrough', action: 'strike', shortcut: 'Ctrl+Shift+S' },
+ { name: t('markdown.toolbar.highlight'), icon: 'format/highlight', action: 'mark', shortcut: 'Ctrl+Shift+H' },
]);
const extendedFormattingTools = computed<ToolItem[]>(() => [
- { name: t('markdown.markdown.toolbar.superscript'), icon: 'format/superscript', action: 'superscript', shortcut: 'Ctrl+↑' },
- { name: t('markdown.markdown.toolbar.subscript'), icon: 'format/subscript', action: 'subscript', shortcut: 'Ctrl+↓' },
- { name: t('markdown.markdown.toolbar.math'), icon: 'maths', action: 'mathInline', shortcut: 'Ctrl+M' },
+ { name: t('markdown.toolbar.superscript'), icon: 'format/superscript', action: 'superscript', shortcut: 'Ctrl+↑' },
+ { name: t('markdown.toolbar.subscript'), icon: 'format/subscript', action: 'subscript', shortcut: 'Ctrl+↓' },
+ { name: t('markdown.toolbar.math'), icon: 'maths', action: 'mathInline', shortcut: 'Ctrl+M' },
]);
const insertTools = computed<ToolItem[]>(() => [
- { name: t('markdown.markdown.toolbar.link'), icon: 'format/link', action: 'link', shortcut: 'Ctrl+K' },
- { name: t('markdown.markdown.toolbar.image'), icon: 'format/image', action: 'image', shortcut: 'Ctrl+Shift+I' },
- { name: t('markdown.markdown.toolbar.inlineCode'), icon: 'format/code', action: 'code', shortcut: 'Ctrl+E' },
- { name: t('markdown.markdown.toolbar.codeBlock'), icon: 'format/code-block', action: 'codeBlock', shortcut: 'Ctrl+Shift+C' },
- { name: t('markdown.markdown.toolbar.color'), icon: 'format/color', action: 'openColorPicker' },
- { name: t('markdown.markdown.toolbar.footnote'), icon: 'format/footnote', action: 'footnote' },
+ { name: t('markdown.toolbar.link'), icon: 'format/link', action: 'link', shortcut: 'Ctrl+K' },
+ { name: t('markdown.toolbar.image'), icon: 'format/image', action: 'image', shortcut: 'Ctrl+Shift+I' },
+ { name: t('markdown.toolbar.inlineCode'), icon: 'format/code', action: 'code', shortcut: 'Ctrl+E' },
+ { name: t('markdown.toolbar.codeBlock'), icon: 'format/code-block', action: 'codeBlock', shortcut: 'Ctrl+Shift+C' },
+ { name: t('markdown.toolbar.color'), icon: 'format/color', action: 'openColorPicker' },
+ { name: t('markdown.toolbar.footnote'), icon: 'format/footnote', action: 'footnote' },
]);
const structureTools = computed<ToolItem[]>(() => [
- { name: t('markdown.markdown.toolbar.heading'), icon: 'format/h1', action: 'h1', shortcut: 'Ctrl+[1-6]' },
- { name: t('markdown.markdown.toolbar.quote'), icon: 'format/quote', action: 'quote', shortcut: 'Ctrl+Shift+.' },
- { name: t('markdown.markdown.toolbar.bulletList'), icon: 'format/list-bulleted', action: 'list', shortcut: 'Ctrl+Shift+8' },
- { name: t('markdown.markdown.toolbar.numberedList'), icon: 'format/list-ordered', action: 'orderedList', shortcut: 'Ctrl+Shift+7' },
- { name: t('markdown.markdown.toolbar.taskList'), icon: 'format/task-list', action: 'taskList', shortcut: 'Ctrl+Shift+9' },
- { name: t('markdown.markdown.toolbar.table'), icon: 'format/table', action: 'gridOrganization' },
- { name: t('markdown.markdown.toolbar.horizontalRule'), icon: 'format/horizontal-rule', action: 'horizontalRule', shortcut: 'Ctrl+Shift+R' },
+ { name: t('markdown.toolbar.heading'), icon: 'format/h1', action: 'h1', shortcut: 'Ctrl+[1-6]' },
+ { name: t('markdown.toolbar.quote'), icon: 'format/quote', action: 'quote', shortcut: 'Ctrl+Shift+.' },
+ { name: t('markdown.toolbar.bulletList'), icon: 'format/list-bulleted', action: 'list', shortcut: 'Ctrl+Shift+8' },
+ { name: t('markdown.toolbar.numberedList'), icon: 'format/list-ordered', action: 'orderedList', shortcut: 'Ctrl+Shift+7' },
+ { name: t('markdown.toolbar.taskList'), icon: 'format/task-list', action: 'taskList', shortcut: 'Ctrl+Shift+9' },
+ { name: t('markdown.toolbar.table'), icon: 'format/table', action: 'gridOrganization' },
+ { name: t('markdown.toolbar.horizontalRule'), icon: 'format/horizontal-rule', action: 'horizontalRule', shortcut: 'Ctrl+Shift+R' },
]);
const actionTools = computed<ToolItem[]>(() => [
- { name: t('markdown.markdown.toolbar.preview'), icon: 'preview', action: 'preview', shortcut: 'Ctrl+P' },
- { name: t('markdown.markdown.toolbar.save'), icon: 'save', action: 'save', shortcut: 'Ctrl+S' },
- { name: t('markdown.markdown.toolbar.goToDocument'), icon: 'file_shortcut', action: 'goto' },
+ { name: t('markdown.toolbar.preview'), icon: 'preview', action: 'preview', shortcut: 'Ctrl+P' },
+ { name: t('markdown.toolbar.save'), icon: 'save', action: 'save', shortcut: 'Ctrl+S' },
+ { name: t('markdown.toolbar.goToDocument'), icon: 'file_shortcut', action: 'goto' },
]);
</script>
<style scoped lang="scss">
diff --git a/frontend/app/components/MarkdownEditor/VoiceRecognition.vue b/frontend/app/components/MarkdownEditor/VoiceRecognition.vue
index e4ab491c..1a70b80c 100644
--- a/frontend/app/components/MarkdownEditor/VoiceRecognition.vue
+++ b/frontend/app/components/MarkdownEditor/VoiceRecognition.vue
@@ -1,7 +1,7 @@
<template>
<button
:class="{ recording: isRecording }"
- :title="isRecording ? t('markdown.markdown.voice.stopRecording') : t('markdown.markdown.voice.startRecording')"
+ :title="isRecording ? t('markdown.voice.stopRecording') : t('markdown.voice.startRecording')"
@click="toggleRecording"
>
<Icon v-if="!isRecording" name="voice/default" />
@@ -34,7 +34,7 @@ const language = 'fr-FR';
const startRecording = () => {
if (!('webkitSpeechRecognition' in window) && !('SpeechRecognition' in window)) {
- alert(t('markdown.markdown.voice.notSupported'));
+ alert(t('markdown.voice.notSupported'));
return;
}
diff --git a/frontend/app/components/MarkdownSyntax.vue b/frontend/app/components/MarkdownSyntax.vue
index ad184440..0ce8c0ba 100644
--- a/frontend/app/components/MarkdownSyntax.vue
+++ b/frontend/app/components/MarkdownSyntax.vue
@@ -1,11 +1,11 @@
<template>
<div class="markdown-guide">
<div class="content">
- <h1><IconApp style="width: 60px" /> {{ t('markdown.markdown.syntax.title') }}</h1>
- <p style="margin: 0">{{ t('markdown.markdown.syntax.subtitle') }}</p>
+ <h1><IconApp style="width: 60px" /> {{ t('markdown.syntax.title') }}</h1>
+ <p style="margin: 0">{{ t('markdown.syntax.subtitle') }}</p>
<!-- BASIC FORMATTING -->
- <h2><Icon name="edit" fill="var(--primary)" /> {{ t('markdown.markdown.syntax.basicFormatting') }}</h2>
+ <h2><Icon name="edit" fill="var(--primary)" /> {{ t('markdown.syntax.basicFormatting') }}</h2>
<ul>
<li><strong>Bold</strong>: <code>**bold**</code> or <code>__bold__</code></li>
<li><em>Italic</em>: <code>*italic*</code> or <code>_italic_</code></li>
@@ -18,14 +18,14 @@
<!-- TAGS -->
<p>
- <strong>{{ t('markdown.markdown.syntax.tags') }}: </strong> <tag blue>Blue</tag> <tag green>Green</tag> <tag red>Red</tag> <tag yellow>Yellow</tag>
+ <strong>{{ t('markdown.syntax.tags') }}: </strong> <tag blue>Blue</tag> <tag green>Green</tag> <tag red>Red</tag> <tag yellow>Yellow</tag>
<tag grey>Grey</tag> <tag teal>Teal</tag><br />
Syntax: <code v-text="`<tag 'color'>Content</tag>`"></code> — example: <code v-text="`<tag blue>Blue</tag>`"></code>
</p>
<!-- COLORS -->
<p>
- <strong>{{ t('markdown.markdown.syntax.colors') }}: </strong>
+ <strong>{{ t('markdown.syntax.colors') }}: </strong>
<strong>
<span style="color: var(--blue)">blue</span> ; <span style="color: var(--red)">red</span> ; <span style="color: var(--green)">green</span> ;
<span style="color: var(--yellow)">yellow</span> ; <span style="color: var(--primary)">primary</span> ;
@@ -36,17 +36,17 @@
</p>
<p>
- <strong>{{ t('markdown.markdown.syntax.titles') }}:</strong>
+ <strong>{{ t('markdown.syntax.titles') }}:</strong>
Syntax: <code v-text="`# H1`"></code> → <code v-text="`###### H6`"></code>
</p>
<p>
- <strong>{{ t('markdown.markdown.syntax.linksAndImages') }}:</strong>
+ <strong>{{ t('markdown.syntax.linksAndImages') }}:</strong>
Use <code>[links](https://example.com)</code> and <code>![images](image.png)</code>.
</p>
<!-- COLORED BLOCKS -->
- <h2><Icon name="layers" fill="var(--primary)" /> {{ t('markdown.markdown.syntax.coloredBlocks') }}</h2>
+ <h2><Icon name="layers" fill="var(--primary)" /> {{ t('markdown.syntax.coloredBlocks') }}</h2>
<p>Use colored blocks with the syntax <code>:::color TITLE</code>.</p>
<div class="block-grid">
<div class="custom-block blue">
@@ -76,7 +76,7 @@
</div>
<!-- ADVANCED BLOCKS -->
- <h2><Icon name="layers" fill="var(--primary)" /> {{ t('markdown.markdown.syntax.advancedBlocks') }}</h2>
+ <h2><Icon name="layers" fill="var(--primary)" /> {{ t('markdown.syntax.advancedBlocks') }}</h2>
<p>Use info blocks with the syntax <code>:::name TITLE Content :::</code>.</p>
<div class="block-grid">
@@ -131,7 +131,7 @@
</details>
</div>
- <h2><Icon name="layers" fill="var(--primary)" /> {{ t('markdown.markdown.syntax.cardsAndPanels') }}</h2>
+ <h2><Icon name="layers" fill="var(--primary)" /> {{ t('markdown.syntax.cardsAndPanels') }}</h2>
<p>
Use powerful block containers with a simplified syntax and <strong>modifiers</strong>. You can style your blocks using attributes like
<code>border</code>, <code>rounded</code>, <code>bordered</code>, <code>shadow</code>, and even a custom <code>title="..."</code>.
@@ -198,7 +198,7 @@ Useful for side content or notes.
</div>
<!-- MATH -->
- <h2><Icon name="maths" fill="var(--primary)" /> {{ t('markdown.markdown.syntax.mathSyntax') }}</h2>
+ <h2><Icon name="maths" fill="var(--primary)" /> {{ t('markdown.syntax.mathSyntax') }}</h2>
<p>Use KaTeX for math expressions: <code>$...$</code> (inline) or <code>$$...$$</code> (block).</p>
<div class="demo">
<pre>$\int_{-\infty}^{+\infty} e^{-x^2} dx = \sqrt{\pi}$</pre>
@@ -207,7 +207,7 @@ Useful for side content or notes.
</div>
<!-- EXTENDED SYNTAX -->
- <h2><Icon name="import" fill="var(--primary)" /> {{ t('markdown.markdown.syntax.extendedSyntax') }}</h2>
+ <h2><Icon name="import" fill="var(--primary)" /> {{ t('markdown.syntax.extendedSyntax') }}</h2>
<ul>
<li><strong>Code blocks:</strong> <code>```language ... ```</code></li>
<li><strong>Blockquotes:</strong> <code>> Quoted text</code></li>
@@ -228,7 +228,7 @@ Useful for side content or notes.
</ul>
<!-- FOOTNOTES -->
- <h2><Icon name="format/footnote" fill="var(--primary)" /> {{ t('markdown.markdown.syntax.footnotes') }}</h2>
+ <h2><Icon name="format/footnote" fill="var(--primary)" /> {{ t('markdown.syntax.footnotes') }}</h2>
<p>Add footnotes to your text for references or additional information.</p>
<div class="demo">
<pre>
diff --git a/frontend/app/components/Node/ContainerView.vue b/frontend/app/components/Node/ContainerView.vue
index 87ee8091..875b9810 100644
--- a/frontend/app/components/Node/ContainerView.vue
+++ b/frontend/app/components/Node/ContainerView.vue
@@ -93,6 +93,7 @@ const nodesStore = useNodesStore();
const router = useRouter();
const userStore = useUserStore();
const { isMobile } = useDevice();
+const modals = useModal();
const { getAppAccent } = useAppColors();
const { t } = useI18nT();
@@ -100,8 +101,8 @@ const connectedId = userStore.user?.id;
const view = ref<ViewMode>();
const filteredNodes = ref<Node[]>(props.nodes);
-// Kanban board reference
const kanbanBoard = ref<InstanceType<typeof KanbanBoard> | null>(null);
+
const resetKanban = () => {
useModal().add(
new Modal(shallowRef(ResetBoardModal), {
@@ -116,31 +117,20 @@ const resetKanban = () => {
// Watch for nodes changes to update filtered nodes
watch(
() => props.nodes,
- newNodes => {
- filteredNodes.value = newNodes;
- },
+ newNodes => (filteredNodes.value = newNodes),
{ immediate: true },
);
const openPermissionsModal = () => {
- if (props.parent) useModal().add(new Modal(shallowRef(NodePermissions), { props: { node: props.parent }, size: 'small' }));
+ if (props.parent) modals.add(new Modal(shallowRef(NodePermissions), { props: { node: props.parent }, size: 'small' }));
};
const openRemoveShareModal = () => {
- if (props.parent) useModal().add(new Modal(shallowRef(RemoveSharedNode), { props: { nodeId: props.parent.id }, size: 'small' }));
+ if (props.parent) modals.add(new Modal(shallowRef(RemoveSharedNode), { props: { nodeId: props.parent.id }, size: 'small' }));
};
-const openEditModal = () => useModal().add(new Modal(shallowRef(NodeMetadataModal), { props: { doc: props.parent }, size: 'small' }));
+const openEditModal = () => modals.add(new Modal(shallowRef(NodeMetadataModal), { props: { doc: props.parent }, size: 'small' }));
const openDeleteModal = () => {
- if (props.parent)
- useModal().add(
- new Modal(shallowRef(NodeDeleteModal), {
- size: 'small',
- props: {
- node: props.parent,
- redirect: '/dashboard',
- },
- }),
- );
+ if (props.parent) modals.add(new Modal(shallowRef(NodeDeleteModal), { size: 'small', props: { node: props.parent, redirect: '/dashboard' } }));
};
// Kanban functionality
diff --git a/frontend/app/components/Node/Filter.vue b/frontend/app/components/Node/Filter.vue
index 379e1865..008123cb 100644
--- a/frontend/app/components/Node/Filter.vue
+++ b/frontend/app/components/Node/Filter.vue
@@ -18,21 +18,21 @@
<div class="row">
<label class="row">
<input v-model="options.sortType" type="radio" value="ascending" />
- <span>{{ t('common.filter.ascending') }}</span>
+ <span>{{ t('components.filter.ascending') }}</span>
</label>
<label class="row">
<input v-model="options.sortType" type="radio" value="descending" />
- <span>{{ t('common.filter.descending') }}</span>
+ <span>{{ t('components.filter.descending') }}</span>
</label>
</div>
<div class="row">
<div style="flex: 1">
- <label>{{ t('common.filter.sort') }}</label>
+ <label>{{ t('components.filter.sort') }}</label>
<AppSelect v-model="options.sortBy" :items="SORT_OPTIONS" />
</div>
<div>
- <label>{{ t('common.filter.match') }}</label>
+ <label>{{ t('components.filter.match') }}</label>
<AppSelect v-model="options.matchMode" :items="MATCH_OPTIONS" size="125px" class="select" />
</div>
</div>
@@ -51,7 +51,6 @@
</template>
<script setup lang="ts">
-import { useNodesStore } from '~/stores';
import type { Node, SearchOptions } from '~/stores';
const props = defineProps<{ nodes: Node[] }>();
@@ -63,6 +62,7 @@ const defaultOptions: SearchOptions = {
sortBy: 'created',
matchMode: 'includes',
};
+
const { t } = useI18nT();
const store = useNodesStore();
const options = ref({ ...defaultOptions });
@@ -71,25 +71,25 @@ const inputRef = ref<HTMLInputElement | null>(null);
const root = ref<HTMLDivElement | null>(null);
const SORT_OPTIONS = [
- { id: 'created', label: 'Created' },
- { id: 'modified', label: 'Modified' },
- { id: 'name', label: 'Name' },
+ { id: 'created', label: t('components.filter.created') },
+ { id: 'modified', label: t('components.filter.modified') },
+ { id: 'name', label: t('common.labels.name') },
];
const MATCH_OPTIONS = [
- { id: 'includes', label: 'Contains' },
- { id: 'starts', label: 'Starts with' },
- { id: 'exact', label: 'Exact' },
+ { id: 'includes', label: t('components.filter.contains') },
+ { id: 'starts', label: t('components.filter.startsWith') },
+ { id: 'exact', label: t('components.filter.exact') },
];
let outsideHandler: ((e: MouseEvent) => void) | null = null;
const filtered = computed(() => store.search(options.value, props.nodes));
-function toggle() {
+const toggle = () => {
opened.value = !opened.value;
if (opened.value) focusInput();
-}
+};
const close = () => (opened.value = false);
const reset = () => (options.value = { ...defaultOptions });
const focusInput = () => nextTick(() => inputRef.value?.focus());
diff --git a/frontend/app/stores/resources.store.ts b/frontend/app/stores/resources.store.ts
index 0ebc9f8f..19567aaa 100644
--- a/frontend/app/stores/resources.store.ts
+++ b/frontend/app/stores/resources.store.ts
@@ -1,7 +1,8 @@
import { makeRequest } from './_utils';
+
import type { Node } from './db_strustures';
+
export const useResourcesStore = defineStore('resources', {
- state: () => ({}),
actions: {
async post(resource: FormData): Promise<Node> {
const defaultUploadFolder = usePreferences().get('defaultUploadFolder').value;
@@ -15,6 +16,7 @@ export const useResourcesStore = defineStore('resources', {
return request.result as Node;
} else throw request.message;
},
+
async postAvatar(resource: FormData): Promise<{ original_path: string; content_compiled: string }> {
const request = await makeRequest(`resources/avatar`, 'POST', resource);
if (request.status == 'success') {
diff --git a/frontend/app/stores/user.store.ts b/frontend/app/stores/user.store.ts
index 592bf5e5..30b29c50 100644
--- a/frontend/app/stores/user.store.ts
+++ b/frontend/app/stores/user.store.ts
@@ -1,9 +1,10 @@
-import { makeRequest } from './_utils';
import type { User, PublicUser, Session } from './db_strustures';
+import { makeRequest } from './_utils';
+
export const useUserStore = defineStore('user', {
state: () => ({
- user: undefined as User | undefined,
+ user: undefined as undefined | User,
users: {} as Record<string, PublicUser>,
sessions: [] as Session[],
current_fetching: [] as string[], // List of curently fetching user ids to avoid duplicate requests
@@ -28,13 +29,13 @@ export const useUserStore = defineStore('user', {
}
},
- async register(user: Omit<User, 'id' | 'created_timestamp' | 'updated_timestamp'>): Promise<boolean> {
+ async register(user: Omit<User, 'created_timestamp' | 'id' | 'updated_timestamp'>): Promise<boolean> {
const request = await makeRequest('users', 'POST', user);
if (request.status === 'success') return true;
throw request.message;
},
- async fetch(): Promise<User | undefined> {
+ async fetch(): Promise<undefined | User> {
if (this.user) return this.user;
const responce = await makeRequest<User>(`users/@me`, 'GET', {});
if (responce.status === 'success') {
@@ -53,7 +54,7 @@ export const useUserStore = defineStore('user', {
throw response.message;
},
- async fetchPublicUser(id: string): Promise<PublicUser | null> {
+ async fetchPublicUser(id: string): Promise<null | PublicUser> {
if (this.users[id]) return this.users[id];
if (this.current_fetching.includes(id)) return null;
this.current_fetching.push(id);
@@ -79,7 +80,7 @@ export const useUserStore = defineStore('user', {
throw response.message;
},
- async fetchById(id: string): Promise<User | undefined> {
+ async fetchById(id: string): Promise<undefined | User> {
const responce = await makeRequest<{ user: User }>(`users/${id}`, 'GET', {});
if (responce.status === 'success') return responce.result?.user as User;
throw responce.message;
diff --git a/frontend/i18n/locales/en/common.ts b/frontend/i18n/locales/en/common.ts
index 21345a70..9bf42a79 100644
--- a/frontend/i18n/locales/en/common.ts
+++ b/frontend/i18n/locales/en/common.ts
@@ -37,13 +37,6 @@ export default {
unknown: 'An unknown error occurred',
},
- filter: {
- ascending: 'Ascending',
- descending: 'Descending',
- match: 'Match',
- sort: 'Sort by',
- },
-
labels: {
action: 'Action',
all: 'All',
diff --git a/frontend/i18n/locales/en/components.ts b/frontend/i18n/locales/en/components.ts
index ca39fb26..d9e2e36e 100644
--- a/frontend/i18n/locales/en/components.ts
+++ b/frontend/i18n/locales/en/components.ts
@@ -41,8 +41,19 @@ export default {
placeholder: {
title: 'Document title',
description: 'Document description',
+ },
+ },
- }
+ filter: {
+ ascending: 'Ascending',
+ descending: 'Descending',
+ match: 'Match',
+ sort: 'Sort by',
+ created: 'Created',
+ modified: 'Modified',
+ contains: 'Contains',
+ startsWith: 'Starts with',
+ exact: 'Exact match',
},
kanban: {
diff --git a/frontend/i18n/locales/en/markdown.ts b/frontend/i18n/locales/en/markdown.ts
index c9ee9235..96e41e95 100644
--- a/frontend/i18n/locales/en/markdown.ts
+++ b/frontend/i18n/locales/en/markdown.ts
@@ -1,86 +1,83 @@
export default {
- markdown: {
- colors: {
- brightness: 'Brightness',
- customColors: 'Custom colors',
- quickColors: 'Quick colors',
- subtitle: 'Choose a color for your text',
- title: 'Colors',
- useColor: 'Use color',
- },
- image: {
- noImages: 'No images found',
- searchPlaceholder: 'Search images...',
- subtitle: 'Choose an image to insert into your document.',
- title: 'Select an image',
- uploadError: 'An error occurred while uploading.',
- },
- stats: {
- chars: 'chars.',
- lines: 'lines',
- words: 'words',
- },
- syntax: {
- advancedBlocks: 'Advanced blocks',
- basicFormatting: 'Basic formatting',
- cardsAndPanels: 'Cards & panels',
- coloredBlocks: 'Colored blocks',
- colors: 'Colors',
- extendedSyntax: 'Extended syntax',
- footnotes: 'Footnotes',
- layoutBlocks: 'Layout blocks',
- linksAndImages: 'Links & images',
- mathSyntax: 'Math syntax',
- subtitle: "This guide shows how to use Alexandrie's extended Markdown features to create expressive, structured notes.",
- tags: 'Tags',
- title: 'Alexandrie Markdown syntax guide',
- titles: 'Headings',
- },
- table: {
- hoverHint: 'Hover to see size',
- subtitle: 'Select your table size with your mouse',
- tableSize: '{rows} × {columns} table',
- title: 'Insert table',
- },
- toolbar: {
- bold: 'Bold',
- bulletList: 'Bullet list',
- category: 'Category',
- clearFormatting: 'Clear formatting',
- codeBlock: 'Code block',
+ colors: {
+ customColors: 'Custom colors',
+ quickColors: 'Quick colors',
+ subtitle: 'Choose a color for your text',
+ title: 'Colors',
+ useColor: 'Use color',
+ },
+ image: {
+ noImages: 'No images found',
+ searchPlaceholder: 'Search images...',
+ subtitle: 'Choose an image to insert into your document.',
+ title: 'Select an image',
+ uploadError: 'An error occurred while uploading.',
+ },
+ stats: {
+ chars: 'chars.',
+ lines: 'lines',
+ words: 'words',
+ },
+ syntax: {
+ advancedBlocks: 'Advanced blocks',
+ basicFormatting: 'Basic formatting',
+ cardsAndPanels: 'Cards & panels',
+ coloredBlocks: 'Colored blocks',
+ colors: 'Colors',
+ extendedSyntax: 'Extended syntax',
+ footnotes: 'Footnotes',
+ layoutBlocks: 'Layout blocks',
+ linksAndImages: 'Links & images',
+ mathSyntax: 'Math syntax',
+ subtitle: "This guide shows how to use Alexandrie's extended Markdown features to create expressive, structured notes.",
+ tags: 'Tags',
+ title: 'Alexandrie Markdown syntax guide',
+ titles: 'Headings',
+ },
+ table: {
+ hoverHint: 'Hover to see size',
+ subtitle: 'Select your table size with your mouse',
+ tableSize: '{rows} × {columns} table',
+ title: 'Insert table',
+ },
+ toolbar: {
+ bold: 'Bold',
+ bulletList: 'Bullet list',
+ category: 'Category',
+ clearFormatting: 'Clear formatting',
+ codeBlock: 'Code block',
- color: 'Color',
- editorSettings: 'Editor settings',
- footnote: 'Footnote',
+ color: 'Color',
+ editorSettings: 'Editor settings',
+ footnote: 'Footnote',
- goToDocument: 'Go to document',
- heading: 'Heading',
- highlight: 'Highlight',
- horizontalRule: 'Horizontal rule',
- image: 'Image',
- inlineCode: 'Inline code',
+ goToDocument: 'Go to document',
+ heading: 'Heading',
+ highlight: 'Highlight',
+ horizontalRule: 'Horizontal rule',
+ image: 'Image',
+ inlineCode: 'Inline code',
- italic: 'Italic',
- link: 'Link',
- markdownSyntax: 'Markdown syntax',
- math: 'Math',
- numberedList: 'Numbered list',
- preview: 'Preview',
- quote: 'Quote',
+ italic: 'Italic',
+ link: 'Link',
+ markdownSyntax: 'Markdown syntax',
+ math: 'Math',
+ numberedList: 'Numbered list',
+ preview: 'Preview',
+ quote: 'Quote',
- save: 'Save',
- strikethrough: 'Strikethrough',
- subscript: 'Subscript',
+ save: 'Save',
+ strikethrough: 'Strikethrough',
+ subscript: 'Subscript',
- superscript: 'Superscript',
- table: 'Table',
- taskList: 'Task list',
- underline: 'Underline',
- },
- voice: {
- notSupported: "Speech recognition is not supported in this browser",
- startRecording: 'Start speech recognition',
- stopRecording: 'Stop recording',
- },
+ superscript: 'Superscript',
+ table: 'Table',
+ taskList: 'Task list',
+ underline: 'Underline',
+ },
+ voice: {
+ notSupported: 'Speech recognition is not supported in this browser',
+ startRecording: 'Start speech recognition',
+ stopRecording: 'Stop recording',
},
};
diff --git a/frontend/i18n/locales/fr/common.ts b/frontend/i18n/locales/fr/common.ts
index 622a60d0..13b28600 100644
--- a/frontend/i18n/locales/fr/common.ts
+++ b/frontend/i18n/locales/fr/common.ts
@@ -25,7 +25,6 @@ export default {
unpin: 'Détacher du haut',
update: 'Mettre à jour',
upload: 'Téléverser',
-
},
confirm: {
@@ -38,13 +37,6 @@ export default {
unknown: 'Une erreur inconnue est survenue',
},
- filter: {
- ascending: 'Ascendant',
- descending: 'Descendant',
- match: 'Correspondance',
- sort: 'Trier par',
- },
-
labels: {
action: 'Action',
all: 'Tous',
diff --git a/frontend/i18n/locales/fr/components.ts b/frontend/i18n/locales/fr/components.ts
index dc415985..2715a940 100644
--- a/frontend/i18n/locales/fr/components.ts
+++ b/frontend/i18n/locales/fr/components.ts
@@ -31,18 +31,29 @@ export default {
},
},
- editor: {
+ dataTable: {
+ rowsPerPage: 'Lignes par page',
+ searchPlaceholder: 'Rechercher...',
+ showing: 'Affichage de {start} à {end} sur {total} entrées',
+ },
+
+ editor: {
placeholder: {
title: 'Document title',
description: 'Document description',
-
- }
+ },
},
- dataTable: {
- rowsPerPage: 'Lignes par page',
- searchPlaceholder: 'Rechercher...',
- showing: 'Affichage de {start} à {end} sur {total} entrées',
+ filter: {
+ ascending: 'Ascendant',
+ descending: 'Descendant',
+ match: 'Correspondance',
+ sort: 'Trier par',
+ created: 'Créé',
+ modified: 'Modifié',
+ contains: 'Contient',
+ startsWith: 'Commence par',
+ exact: 'Correspondance exacte',
},
kanban: {
diff --git a/frontend/i18n/locales/fr/markdown.ts b/frontend/i18n/locales/fr/markdown.ts
index fe17ba74..4a721061 100644
--- a/frontend/i18n/locales/fr/markdown.ts
+++ b/frontend/i18n/locales/fr/markdown.ts
@@ -1,86 +1,83 @@
export default {
- markdown: {
- colors: {
- brightness: 'Luminosité',
- customColors: 'Couleurs personnalisées',
- quickColors: 'Couleurs rapides',
- subtitle: 'Choisissez une couleur pour votre texte',
- title: 'Couleurs',
- useColor: 'Utiliser la couleur',
- },
- image: {
- noImages: 'Aucune image trouvée',
- searchPlaceholder: 'Rechercher des images...',
- subtitle: 'Choisissez une image à insérer dans votre document.',
- title: 'Sélectionner une image',
- uploadError: 'Une erreur est survenue lors du téléchargement.',
- },
- stats: {
- chars: 'car.',
- lines: 'lignes',
- words: 'mots',
- },
- syntax: {
- advancedBlocks: 'Blocs avancés',
- basicFormatting: 'Formatage de base',
- cardsAndPanels: 'Cartes & panneaux',
- coloredBlocks: 'Blocs colorés',
- colors: 'Couleurs',
- extendedSyntax: 'Syntaxe étendue',
- footnotes: 'Notes de bas de page',
- layoutBlocks: 'Blocs de mise en page',
- linksAndImages: 'Liens & Images',
- mathSyntax: 'Syntaxe mathématique',
- subtitle: "Ce guide vous montre comment utiliser les fonctionnalités Markdown étendues d'Alexandrie pour créer des notes expressives et organisées.",
- tags: 'Tags',
- title: 'Guide de syntaxe Markdown Alexandrie',
- titles: 'Titres',
- },
- table: {
- hoverHint: 'Survolez pour voir la taille',
- subtitle: 'Sélectionnez la taille de votre tableau avec votre souris',
- tableSize: '{rows} × {columns} tableau',
- title: 'Insérer un tableau',
- },
- toolbar: {
- bold: 'Gras',
- bulletList: 'Liste à puces',
- category: 'Catégorie',
- clearFormatting: 'Effacer le formatage',
- codeBlock: 'Bloc de code',
+ colors: {
+ customColors: 'Couleurs personnalisées',
+ quickColors: 'Couleurs rapides',
+ subtitle: 'Choisissez une couleur pour votre texte',
+ title: 'Couleurs',
+ useColor: 'Utiliser la couleur',
+ },
+ image: {
+ noImages: 'Aucune image trouvée',
+ searchPlaceholder: 'Rechercher des images...',
+ subtitle: 'Choisissez une image à insérer dans votre document.',
+ title: 'Sélectionner une image',
+ uploadError: 'Une erreur est survenue lors du téléchargement.',
+ },
+ stats: {
+ chars: 'car.',
+ lines: 'lignes',
+ words: 'mots',
+ },
+ syntax: {
+ advancedBlocks: 'Blocs avancés',
+ basicFormatting: 'Formatage de base',
+ cardsAndPanels: 'Cartes & panneaux',
+ coloredBlocks: 'Blocs colorés',
+ colors: 'Couleurs',
+ extendedSyntax: 'Syntaxe étendue',
+ footnotes: 'Notes de bas de page',
+ layoutBlocks: 'Blocs de mise en page',
+ linksAndImages: 'Liens & Images',
+ mathSyntax: 'Syntaxe mathématique',
+ subtitle: "Ce guide vous montre comment utiliser les fonctionnalités Markdown étendues d'Alexandrie pour créer des notes expressives et organisées.",
+ tags: 'Tags',
+ title: 'Guide de syntaxe Markdown Alexandrie',
+ titles: 'Titres',
+ },
+ table: {
+ hoverHint: 'Survolez pour voir la taille',
+ subtitle: 'Sélectionnez la taille de votre tableau avec votre souris',
+ tableSize: '{rows} × {columns} tableau',
+ title: 'Insérer un tableau',
+ },
+ toolbar: {
+ bold: 'Gras',
+ bulletList: 'Liste à puces',
+ category: 'Catégorie',
+ clearFormatting: 'Effacer le formatage',
+ codeBlock: 'Bloc de code',
- color: 'Couleur',
- editorSettings: "Paramètres de l'éditeur",
- footnote: 'Note de bas de page',
+ color: 'Couleur',
+ editorSettings: "Paramètres de l'éditeur",
+ footnote: 'Note de bas de page',
- goToDocument: 'Aller au document',
- heading: 'Titre',
- highlight: 'Surligner',
- horizontalRule: 'Règle horizontale',
- image: 'Image',
- inlineCode: 'Code en ligne',
+ goToDocument: 'Aller au document',
+ heading: 'Titre',
+ highlight: 'Surligner',
+ horizontalRule: 'Règle horizontale',
+ image: 'Image',
+ inlineCode: 'Code en ligne',
- italic: 'Italique',
- link: 'Lien',
- markdownSyntax: 'Syntaxe Markdown',
- math: 'Mathématiques',
- numberedList: 'Liste numérotée',
- preview: 'Aperçu',
- quote: 'Citation',
+ italic: 'Italique',
+ link: 'Lien',
+ markdownSyntax: 'Syntaxe Markdown',
+ math: 'Mathématiques',
+ numberedList: 'Liste numérotée',
+ preview: 'Aperçu',
+ quote: 'Citation',
- save: 'Enregistrer',
- strikethrough: 'Barré',
- subscript: 'Indice',
+ save: 'Enregistrer',
+ strikethrough: 'Barré',
+ subscript: 'Indice',
- superscript: 'Exposant',
- table: 'Tableau',
- taskList: 'Liste de tâches',
- underline: 'Souligné',
- },
- voice: {
- notSupported: "La reconnaissance vocale n'est pas supportée dans ce navigateur",
- startRecording: 'Démarrer la reconnaissance vocale',
- stopRecording: "Arrêter l'enregistrement",
- },
+ superscript: 'Exposant',
+ table: 'Tableau',
+ taskList: 'Liste de tâches',
+ underline: 'Souligné',
+ },
+ voice: {
+ notSupported: "La reconnaissance vocale n'est pas supportée dans ce navigateur",
+ startRecording: 'Démarrer la reconnaissance vocale',
+ stopRecording: "Arrêter l'enregistrement",
},
};