erudit 4.0.0-dev.2 → 4.0.0-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/components/Loading.vue +7 -0
- package/app/components/Prose.vue +1 -0
- package/app/components/aside/AsideMinor.vue +1 -4
- package/app/components/aside/major/contentNav/PaneBookNav.vue +3 -3
- package/app/components/aside/major/search/PaneSearch.vue +2 -0
- package/app/components/aside/major/search/SearchResult.vue +3 -0
- package/app/components/aside/major/settings/ThemeSwitcher.vue +2 -0
- package/app/components/aside/minor/content/ButtonPaneImprove.vue +3 -0
- package/app/components/aside/minor/news/AsideMinorNews.vue +1 -1
- package/app/components/main/MainAction.vue +7 -1
- package/app/components/main/MainQuote.vue +5 -3
- package/app/components/main/MainQuoteLoader.vue +1 -1
- package/app/components/preview/Preview.vue +6 -9
- package/app/components/preview/PreviewLoading.vue +1 -1
- package/app/composables/loading.ts +26 -2
- package/app/pages/contributors.vue +4 -1
- package/app/pages/sponsors.vue +1 -0
- package/modules/erudit/setup/projectConfig.ts +1 -0
- package/package.json +4 -4
- package/server/api/language/functions.ts +2 -2
- package/server/api/language/phrase/[phraseKey].ts +4 -1
- package/server/erudit/language/list/en.ts +1 -96
- package/server/erudit/language/list/ru.ts +1 -97
- package/server/erudit/language/setup.ts +2 -2
- package/server/erudit/language/types.ts +2 -2
- package/server/routes/search.json.gz.ts +3 -1
- package/shared/types/runtimeConfig.ts +1 -0
package/app/components/Prose.vue
CHANGED
|
@@ -63,10 +63,7 @@ onUnmounted(() => {
|
|
|
63
63
|
class="absolute top-0 left-0 grid h-full w-full
|
|
64
64
|
place-items-center"
|
|
65
65
|
>
|
|
66
|
-
<
|
|
67
|
-
:svg="loadingSvg"
|
|
68
|
-
class="text-text-disabled text-[60px]"
|
|
69
|
-
/>
|
|
66
|
+
<Loading class="text-text-disabled text-[65px]" />
|
|
70
67
|
</div>
|
|
71
68
|
<div v-else></div>
|
|
72
69
|
</template>
|
|
@@ -106,10 +106,10 @@ const pharse = await usePhrases('to_index', 'about_textbook');
|
|
|
106
106
|
</div>
|
|
107
107
|
<div
|
|
108
108
|
v-else
|
|
109
|
-
class="
|
|
110
|
-
|
|
109
|
+
class="absolute top-0 left-0 flex h-full w-full items-center
|
|
110
|
+
justify-center transition-opacity"
|
|
111
111
|
>
|
|
112
|
-
<
|
|
112
|
+
<Loading class="text-text-dimmed text-[65px]" />
|
|
113
113
|
</div>
|
|
114
114
|
</TransitionFade>
|
|
115
115
|
</AsideMajorPaneTemplate>
|
|
@@ -4,6 +4,7 @@ import { isContentType } from '@erudit-js/core/content/type';
|
|
|
4
4
|
import type { MaybeMyIconName, MyIconName } from '#my-icons';
|
|
5
5
|
|
|
6
6
|
const { result } = defineProps<{ result: SearchEntry }>();
|
|
7
|
+
const loadingSvg = useLoadingSvg();
|
|
7
8
|
|
|
8
9
|
const ELEMENT_PREFIX = 'element:';
|
|
9
10
|
const isElementCategory = result.category?.startsWith(ELEMENT_PREFIX);
|
|
@@ -33,6 +34,8 @@ watch(icon, () => {
|
|
|
33
34
|
});
|
|
34
35
|
|
|
35
36
|
async function requestElementIcon(elementName: string) {
|
|
37
|
+
icon.value = loadingSvg;
|
|
38
|
+
|
|
36
39
|
try {
|
|
37
40
|
icon.value = await getElementIcon(elementName);
|
|
38
41
|
} catch {
|
|
@@ -66,18 +66,21 @@ const phrase = await usePhrases(
|
|
|
66
66
|
icon="question-circle"
|
|
67
67
|
:main="phrase.how_to_improve"
|
|
68
68
|
:to="howToImproveLink"
|
|
69
|
+
target="_blank"
|
|
69
70
|
/>
|
|
70
71
|
<AsideListItem
|
|
71
72
|
v-if="reportIssueLink"
|
|
72
73
|
icon="bug"
|
|
73
74
|
:main="phrase.report_issue"
|
|
74
75
|
:to="reportIssueLink"
|
|
76
|
+
target="_blank"
|
|
75
77
|
/>
|
|
76
78
|
<AsideListItem
|
|
77
79
|
v-if="editLink"
|
|
78
80
|
icon="draw"
|
|
79
81
|
:main="phrase.edit_page"
|
|
80
82
|
:to="editLink"
|
|
83
|
+
target="_blank"
|
|
81
84
|
/>
|
|
82
85
|
</div>
|
|
83
86
|
<div
|
|
@@ -122,7 +122,7 @@ const phrase = await usePhrases('news', 'no_news', 'show_more');
|
|
|
122
122
|
w-auto cursor-pointer items-center rounded border-2
|
|
123
123
|
border-transparent text-sm transition-[border]"
|
|
124
124
|
>
|
|
125
|
-
<
|
|
125
|
+
<Loading v-if="newsLoading" />
|
|
126
126
|
<span>{{ phrase.show_more }}</span>
|
|
127
127
|
</button>
|
|
128
128
|
</TransitionFade>
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import type { MaybeMyIconName } from '#my-icons';
|
|
3
3
|
|
|
4
|
-
defineProps<{
|
|
4
|
+
defineProps<{
|
|
5
|
+
icon: MaybeMyIconName;
|
|
6
|
+
label: string;
|
|
7
|
+
link: string;
|
|
8
|
+
newTab?: boolean;
|
|
9
|
+
}>();
|
|
5
10
|
</script>
|
|
6
11
|
|
|
7
12
|
<template>
|
|
8
13
|
<section class="px-main py-main-half clear-both grid place-items-center">
|
|
9
14
|
<EruditLink
|
|
10
15
|
:to="link"
|
|
16
|
+
:target="newTab ? '_blank' : undefined"
|
|
11
17
|
class="bg-brand gap-small micro:gap-normal px-normal text-main-lg
|
|
12
18
|
shadow-brand/30 micro:h-[55px] hocus:bg-brand/80 flex h-[50px]
|
|
13
19
|
items-center rounded font-bold text-white shadow-lg
|
|
@@ -4,11 +4,13 @@ import type { MaybeMyIconName, MyIconName } from '#my-icons';
|
|
|
4
4
|
|
|
5
5
|
const { quote } = defineProps<{
|
|
6
6
|
quote: Quote;
|
|
7
|
-
|
|
7
|
+
canJoin?: boolean;
|
|
8
8
|
hasNextLink?: boolean;
|
|
9
9
|
}>();
|
|
10
10
|
const emit = defineEmits(['next']);
|
|
11
11
|
|
|
12
|
+
const loadingSvg = useLoadingSvg();
|
|
13
|
+
|
|
12
14
|
const color = quote.color ?? stringColor(quote.name);
|
|
13
15
|
|
|
14
16
|
const message = (() => {
|
|
@@ -126,12 +128,12 @@ const phrase = await usePhrases('add_quote', 'next_quote');
|
|
|
126
128
|
/>
|
|
127
129
|
</div>
|
|
128
130
|
<div
|
|
129
|
-
v-if="
|
|
131
|
+
v-if="canJoin || hasNextLink"
|
|
130
132
|
class="gap-normal micro:text-[1.5em] flex items-center
|
|
131
133
|
text-[1.2em]"
|
|
132
134
|
>
|
|
133
135
|
<EruditLink
|
|
134
|
-
v-if="
|
|
136
|
+
v-if="canJoin"
|
|
135
137
|
:to="PAGES.sponsors"
|
|
136
138
|
:title="phrase.add_quote"
|
|
137
139
|
class="hocus:text-(--colorIcon)
|
|
@@ -78,7 +78,7 @@ onMounted(() => {
|
|
|
78
78
|
<section v-if="quote" :key="quoteKey" class="px-main py-main-half">
|
|
79
79
|
<MainQuote
|
|
80
80
|
:quote
|
|
81
|
-
:
|
|
81
|
+
:canJoin="ERUDIT.config.project.sponsors?.enabled"
|
|
82
82
|
:hasNextLink="hasMultipleQuotes"
|
|
83
83
|
@next="!loadingQuote && nextQuote()"
|
|
84
84
|
/>
|
|
@@ -114,12 +114,12 @@ await usePhrases(
|
|
|
114
114
|
<div
|
|
115
115
|
ref="preview"
|
|
116
116
|
:class="[
|
|
117
|
-
`
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
`bg-bg-main micro:max-h-[70dvh] pointer-events-auto absolute
|
|
118
|
+
bottom-0 max-h-[90dvh] w-full touch-auto overflow-hidden
|
|
119
|
+
rounded-[25px] rounded-b-none
|
|
120
|
+
transition-[max-height,height,translate]`,
|
|
121
121
|
previewState.opened
|
|
122
|
-
? `translate-y-0
|
|
122
|
+
? `border-border translate-y-0 border-t
|
|
123
123
|
shadow-[0px_-10px_15px_5px_light-dark(rgba(0,0,0,0.1),rgba(255,255,255,0.05))]`
|
|
124
124
|
: 'translate-y-full shadow-none',
|
|
125
125
|
]"
|
|
@@ -145,10 +145,7 @@ await usePhrases(
|
|
|
145
145
|
class="bg-bg-main absolute bottom-0 flex h-full w-full
|
|
146
146
|
items-center justify-center"
|
|
147
147
|
>
|
|
148
|
-
<
|
|
149
|
-
:svg="loadingSvg"
|
|
150
|
-
class="text-text-dimmed text-[50px]"
|
|
151
|
-
/>
|
|
148
|
+
<Loading class="text-text-dimmed text-[50px]" />
|
|
152
149
|
</div>
|
|
153
150
|
</TransitionFade>
|
|
154
151
|
|
|
@@ -1,2 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const defaultLoadingSvg = `
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
3
|
+
<rect width="10" height="10" x="1" y="1" fill="currentColor" rx="1">
|
|
4
|
+
<animate id="svgSpinnersBlocksShuffle30" fill="freeze" attributeName="x" begin="0;svgSpinnersBlocksShuffle3b.end" dur="0.2s" values="1;13"/>
|
|
5
|
+
<animate id="svgSpinnersBlocksShuffle31" fill="freeze" attributeName="y" begin="svgSpinnersBlocksShuffle38.end" dur="0.2s" values="1;13"/>
|
|
6
|
+
<animate id="svgSpinnersBlocksShuffle32" fill="freeze" attributeName="x" begin="svgSpinnersBlocksShuffle39.end" dur="0.2s" values="13;1"/>
|
|
7
|
+
<animate id="svgSpinnersBlocksShuffle33" fill="freeze" attributeName="y" begin="svgSpinnersBlocksShuffle3a.end" dur="0.2s" values="13;1"/>
|
|
8
|
+
</rect>
|
|
9
|
+
<rect width="10" height="10" x="1" y="13" fill="currentColor" rx="1">
|
|
10
|
+
<animate id="svgSpinnersBlocksShuffle34" fill="freeze" attributeName="y" begin="svgSpinnersBlocksShuffle30.end" dur="0.2s" values="13;1"/>
|
|
11
|
+
<animate id="svgSpinnersBlocksShuffle35" fill="freeze" attributeName="x" begin="svgSpinnersBlocksShuffle31.end" dur="0.2s" values="1;13"/>
|
|
12
|
+
<animate id="svgSpinnersBlocksShuffle36" fill="freeze" attributeName="y" begin="svgSpinnersBlocksShuffle32.end" dur="0.2s" values="1;13"/>
|
|
13
|
+
<animate id="svgSpinnersBlocksShuffle37" fill="freeze" attributeName="x" begin="svgSpinnersBlocksShuffle33.end" dur="0.2s" values="13;1"/>
|
|
14
|
+
</rect>
|
|
15
|
+
<rect width="10" height="10" x="13" y="13" fill="currentColor" rx="1">
|
|
16
|
+
<animate id="svgSpinnersBlocksShuffle38" fill="freeze" attributeName="x" begin="svgSpinnersBlocksShuffle34.end" dur="0.2s" values="13;1"/>
|
|
17
|
+
<animate id="svgSpinnersBlocksShuffle39" fill="freeze" attributeName="y" begin="svgSpinnersBlocksShuffle35.end" dur="0.2s" values="13;1"/>
|
|
18
|
+
<animate id="svgSpinnersBlocksShuffle3a" fill="freeze" attributeName="x" begin="svgSpinnersBlocksShuffle36.end" dur="0.2s" values="1;13"/>
|
|
19
|
+
<animate id="svgSpinnersBlocksShuffle3b" fill="freeze" attributeName="y" begin="svgSpinnersBlocksShuffle37.end" dur="0.2s" values="1;13"/>
|
|
20
|
+
</rect>
|
|
21
|
+
</svg>
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
export function useLoadingSvg() {
|
|
25
|
+
return ERUDIT.config.project.siteInfo.loadingSvg || defaultLoadingSvg;
|
|
26
|
+
}
|
|
@@ -45,8 +45,11 @@ useStandartSeo({
|
|
|
45
45
|
<div class="h-main-half"></div>
|
|
46
46
|
<MainAction
|
|
47
47
|
icon="users"
|
|
48
|
+
:newTab="true"
|
|
48
49
|
:label="phrase.become_contributor"
|
|
49
|
-
:link="
|
|
50
|
+
:link="
|
|
51
|
+
ERUDIT.config.project.contributors!.becomeContributorLink
|
|
52
|
+
"
|
|
50
53
|
/>
|
|
51
54
|
<div class="h-main-half"></div>
|
|
52
55
|
</template>
|
package/app/pages/sponsors.vue
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "erudit",
|
|
3
|
-
"version": "4.0.0-dev.
|
|
3
|
+
"version": "4.0.0-dev.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "🤓 CMS for perfect educational sites.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"test": "bun vitest run"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@erudit-js/cli": "4.0.0-dev.
|
|
33
|
-
"@erudit-js/core": "4.0.0-dev.
|
|
34
|
-
"@erudit-js/prose": "4.0.0-dev.
|
|
32
|
+
"@erudit-js/cli": "4.0.0-dev.4",
|
|
33
|
+
"@erudit-js/core": "4.0.0-dev.4",
|
|
34
|
+
"@erudit-js/prose": "4.0.0-dev.4",
|
|
35
35
|
"@floating-ui/vue": "^1.1.9",
|
|
36
36
|
"@jsprose/core": "^1.0.0",
|
|
37
37
|
"@tailwindcss/vite": "^4.1.17",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export default defineEventHandler(async () => {
|
|
2
2
|
const strFunctions: Record<string, string> = {};
|
|
3
3
|
|
|
4
|
-
for (const [funcName,
|
|
4
|
+
for (const [funcName, funcValue] of Object.entries(
|
|
5
5
|
ERUDIT.language.functions,
|
|
6
6
|
)) {
|
|
7
|
-
strFunctions[
|
|
7
|
+
strFunctions[funcValue.name] = funcValue.toString();
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
return strFunctions;
|
|
@@ -9,7 +9,10 @@ export default defineEventHandler<Promise<PayloadLanguagePhraseValue>>(
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
let phraseValue =
|
|
12
|
+
let phraseValue =
|
|
13
|
+
ERUDIT.language.phrases[
|
|
14
|
+
phraseKey as keyof typeof ERUDIT.language.phrases
|
|
15
|
+
];
|
|
13
16
|
|
|
14
17
|
if (phraseValue) {
|
|
15
18
|
if (typeof phraseValue === 'string') {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
export const phrases: LanguagePhrases = {
|
|
2
2
|
language_code: 'en',
|
|
3
3
|
language_name: 'English',
|
|
4
4
|
erudit: 'Erudit',
|
|
@@ -103,103 +103,8 @@ const en: LanguagePhrases = {
|
|
|
103
103
|
default_index_title: 'Erudit',
|
|
104
104
|
default_index_short: 'Modern digital textbooks!',
|
|
105
105
|
default_site_info_short: 'Modern textbook',
|
|
106
|
-
|
|
107
|
-
// _language_title: 'English',
|
|
108
|
-
// _language_code: 'en',
|
|
109
|
-
// site_info_title: 'Erudit',
|
|
110
|
-
// site_info_slogan: 'Modern textbook',
|
|
111
|
-
// seo_index_title: 'Erudit - CMS for eductional sites',
|
|
112
|
-
// seo_index_description:
|
|
113
|
-
// 'Erudit is a CMS for creating and managing perfect educational sites, maintained by the community.',
|
|
114
|
-
// seo_article_description: (contentTitle) =>
|
|
115
|
-
// `Clear and interesting explanation of the topic "${contentTitle}". Illustrative examples, important properties, interesting facts, life applications, clear proofs. Here you will definitely understand the topic!`,
|
|
116
|
-
// seo_summary_description: (contentTitle) =>
|
|
117
|
-
// `Summary of the topic "${contentTitle}": key definitions, theorems, properties and examples of their use. All the most important things in a concise form!`,
|
|
118
|
-
// seo_practice_description: (contentTitle) =>
|
|
119
|
-
// `Various problems with hints and answers on the topic "${contentTitle}". Interesting conditions, hints and detailed solutions. Turn knowledge into a skill!`,
|
|
120
|
-
// index: 'Index',
|
|
121
|
-
// pages: 'Pages',
|
|
122
|
-
// search: 'Search',
|
|
123
|
-
// language: 'Language',
|
|
124
|
-
// other: 'Other',
|
|
125
|
-
// ads_replacer:
|
|
126
|
-
// 'Help us develop the project.<br><strong>Disable your ads blocker!</strong>',
|
|
127
|
-
// theme: 'Theme',
|
|
128
|
-
// theme_system: 'System',
|
|
129
|
-
// theme_light: 'Light',
|
|
130
|
-
// theme_dark: 'Dark',
|
|
131
|
-
// content: 'Content',
|
|
132
|
-
// main_page: 'Main page',
|
|
133
|
-
// contributors: 'Contributors',
|
|
134
|
-
// contributors_page_description:
|
|
135
|
-
// 'List of people who contributed to the project materials: suggested valuable ideas, made corrections to existing material or wrote their own!',
|
|
136
|
-
// contributors_page_invite:
|
|
137
|
-
// 'You can also help the project, make a contribution and get on this page!',
|
|
138
|
-
// become_contributor: 'Become a contributor',
|
|
139
|
-
// contributor: 'Contributor',
|
|
140
|
-
// contribution: 'Contribution',
|
|
141
|
-
// contributions_explain: (count) =>
|
|
142
|
-
// `Contributed to ${m(count, 'material', 'materials')}`,
|
|
143
|
-
// contributor_description: (name) =>
|
|
144
|
-
// `Page with information about the contributor "${name}" and his contribution to the project.`,
|
|
145
|
-
// editor: 'Editor',
|
|
146
|
-
// add_translation: 'Add translation',
|
|
147
|
-
// empty_nav: 'Empty navigation',
|
|
148
|
-
|
|
149
|
-
// popover_dependencies: 'Dependencies',
|
|
150
|
-
// popover_dependencies_description:
|
|
151
|
-
// 'There is no royal way into this topic! You can only figure it out if you know the following topics:',
|
|
152
|
-
// to_index: 'To index',
|
|
153
|
-
// about_book: 'About book',
|
|
154
|
-
// close: 'Close',
|
|
155
|
-
// back: 'Back',
|
|
156
|
-
// goto: 'Go to',
|
|
157
|
-
// error: 'Error!',
|
|
158
|
-
// external_link: 'External link',
|
|
159
|
-
// external_link_warn: 'You are going to visit external resource!',
|
|
160
|
-
// internal_link: 'Internal link',
|
|
161
|
-
// internal_link_warn: 'You are going to visit internal site page!',
|
|
162
|
-
// book: 'Textbook',
|
|
163
|
-
// group: 'Group',
|
|
164
|
-
// topic: 'Topic',
|
|
165
|
-
// topics: 'Topics',
|
|
166
|
-
// article: 'Article',
|
|
167
|
-
// summary: 'Summary',
|
|
168
|
-
// practice: 'Practice',
|
|
169
|
-
// element_id: 'Element ID',
|
|
170
|
-
// preview_missing_title: 'Element not found!',
|
|
171
|
-
// preview_missing_explain: `Can't find the element with specified ID in this page!<br>Perhaps the element ID is specified incorrectly or the element has been changed/deleted.`,
|
|
172
|
-
// preview_missing_explain_mismatch: `Can't find the element with specified ID in this page!<br>The version of the linked page is different from the current version of the page!<br>This is most likely the cause of the error.`,
|
|
173
|
-
// preview_hash_mismatch_title: 'Page version mismatch!',
|
|
174
|
-
// preview_hash_mismatch_explain:
|
|
175
|
-
// 'The version of the page you see now is different from the version of the page the original link led to!<br>The content may be different from what you expected to see.',
|
|
176
|
-
// current_page_hash: 'Current hash',
|
|
177
|
-
// expected_page_hash: 'Expected hash',
|
|
178
|
-
// empty_toc: 'Empty table of contents...',
|
|
179
|
-
// no_contributors: 'No contributors...',
|
|
180
|
-
// make_contribution: 'Make a contribution',
|
|
181
|
-
// material_improvement: 'Material improvement',
|
|
182
|
-
// how_to_improve: 'How to improve?',
|
|
183
|
-
// edit_page: 'Edit page',
|
|
184
|
-
// report_problem: 'Report a problem',
|
|
185
|
-
// references: 'References',
|
|
186
|
-
// reference_source_featured: 'Featured source',
|
|
187
|
-
// references_description:
|
|
188
|
-
// 'A list of external sources that were used to write this material. If there is an asterisk next to the title, it is a featured source and is worth reading if you want to delve deeper into the material.',
|
|
189
|
-
// sponsors: 'Sponsors',
|
|
190
|
-
// sponsors_description:
|
|
191
|
-
// 'People and organizations that support the project financially. Thanks to them, we can continue to develop the project and improve the quality of materials. If you want to support the project, you can become a sponsor too!',
|
|
192
|
-
// become_sponsor: 'Become a sponsor',
|
|
193
|
-
// toc: 'Table of contents',
|
|
194
|
-
// mentions: (count) => m(count, 'mention', 'mentions'),
|
|
195
|
-
// start_learning: 'Start learning!',
|
|
196
|
-
// x_contributors: (count) => m(count, 'Contributor', 'Contributors'),
|
|
197
|
-
// x_sponsors: (count) => m(count, 'Sponsor', 'Sponsors'),
|
|
198
|
-
// show_all: 'Show all',
|
|
199
106
|
};
|
|
200
107
|
|
|
201
|
-
export default en;
|
|
202
|
-
|
|
203
108
|
export function m(
|
|
204
109
|
number: number,
|
|
205
110
|
one: string,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
export const phrases: LanguagePhrases = {
|
|
2
2
|
language_code: 'ru',
|
|
3
3
|
language_name: 'Русский',
|
|
4
4
|
erudit: 'Erudit',
|
|
@@ -104,104 +104,8 @@ const ru: LanguagePhrases = {
|
|
|
104
104
|
default_index_title: 'Erudit',
|
|
105
105
|
default_index_short: 'Современные цифровые учебники!',
|
|
106
106
|
default_site_info_short: 'Современный учебник',
|
|
107
|
-
|
|
108
|
-
// _language_title: 'Русский',
|
|
109
|
-
// _language_code: 'ru',
|
|
110
|
-
// site_info_title: 'Erudit',
|
|
111
|
-
// site_info_slogan: 'Современный учебник',
|
|
112
|
-
// seo_index_title: 'Erudit - CMS для образовательных сайтов',
|
|
113
|
-
// seo_index_description:
|
|
114
|
-
// 'Erudit — CMS для создания и управления идеальными образовательными сайтами, которые поддерживаются сообществом.',
|
|
115
|
-
// seo_article_description: (contentTitle) =>
|
|
116
|
-
// `Понятное и интересное объяснение темы «${contentTitle}». Показательные примеры, важные свойства, интересные факты, применение в жизни, понятные доказательства. Здесь вы точно разберетесь!`,
|
|
117
|
-
// seo_summary_description: (contentTitle) =>
|
|
118
|
-
// `Конспект темы «${contentTitle}»: ключевые определения, теоремы, свойства и примеры их использвания. Все самое важное и в кратком виде!`,
|
|
119
|
-
// seo_practice_description: (contentTitle) =>
|
|
120
|
-
// `Разнообразные задачи с подсказками и ответами по теме «${contentTitle}». Интересные условия, подсказки и подробные решения. Превратите знания в навык!`,
|
|
121
|
-
// index: 'Оглавление',
|
|
122
|
-
// pages: 'Страницы',
|
|
123
|
-
// search: 'Поиск',
|
|
124
|
-
// language: 'Язык',
|
|
125
|
-
// other: 'Другое',
|
|
126
|
-
// ads_replacer:
|
|
127
|
-
// 'Помогите улучшать проект.<br><strong>Включите показ рекламы!</strong>',
|
|
128
|
-
// theme: 'Тема',
|
|
129
|
-
// theme_system: 'Системная',
|
|
130
|
-
// theme_light: 'Светлая',
|
|
131
|
-
// theme_dark: 'Темная',
|
|
132
|
-
// content: 'Контент',
|
|
133
|
-
// main_page: 'Главная страница',
|
|
134
|
-
// contributors: 'Авторы',
|
|
135
|
-
// contributors_page_description:
|
|
136
|
-
// 'Список людей, которые внесли вклад в материалы проекта: предложили ценные идеи, вносили корректировки в существующий материал или же написали собственный!',
|
|
137
|
-
// contributors_page_invite:
|
|
138
|
-
// 'Вы тоже можете помочь проекту, внести свой вклад и попасть на эту страницу!',
|
|
139
|
-
// become_contributor: 'Стать автором',
|
|
140
|
-
// contributor: 'Автор',
|
|
141
|
-
// contribution: 'Вклад',
|
|
142
|
-
// contributions_explain: (count) =>
|
|
143
|
-
// `Вклад в ${m(count, 'материал', 'материала', 'материалов')}`,
|
|
144
|
-
// contributor_description: (name) =>
|
|
145
|
-
// `Страница с информацией о авторе "${name}" и его вкладе в проект.`,
|
|
146
|
-
// editor: 'Редактор',
|
|
147
|
-
// add_translation: 'Добавить перевод',
|
|
148
|
-
// empty_nav: 'Пустая навигация',
|
|
149
|
-
// popover_dependencies: 'Зависимости',
|
|
150
|
-
// popover_dependencies_description:
|
|
151
|
-
// 'Царского пути в эту тему нет! Вы сможете разобраться только если знаете следующие темы:',
|
|
152
|
-
// to_index: 'К оглавлению',
|
|
153
|
-
// about_book: 'Об учебнике',
|
|
154
|
-
// close: 'Закрыть',
|
|
155
|
-
// back: 'Назад',
|
|
156
|
-
// goto: 'Перейти',
|
|
157
|
-
// error: 'Ошибка!',
|
|
158
|
-
// external_link: 'Внешняя ссылка',
|
|
159
|
-
// external_link_warn: 'Вы собираетесь перейти на внешний ресурс!',
|
|
160
|
-
// internal_link: 'Внутренняя ссылка',
|
|
161
|
-
// internal_link_warn: 'Вы собираетесь перейти на внутреннюю страницу сайта!',
|
|
162
|
-
// book: 'Учебник',
|
|
163
|
-
// group: 'Группа',
|
|
164
|
-
// topic: 'Тема',
|
|
165
|
-
// topics: 'Темы',
|
|
166
|
-
// article: 'Статья',
|
|
167
|
-
// summary: 'Конспект',
|
|
168
|
-
// practice: 'Задачи',
|
|
169
|
-
// element_id: 'ID элемента',
|
|
170
|
-
// preview_missing_title: 'Элемент не найден!',
|
|
171
|
-
// preview_missing_explain:
|
|
172
|
-
// 'Не удалось найти на этой странице элемент с указанным ID!<br>Возможно, ID элемента указан неправильно или элемент был изменен/удален.',
|
|
173
|
-
// preview_missing_explain_mismatch: `Не удалось найти на этой странице элемент с указанным ID!<br>Версия страницы, на которую вела ссылка, отличается от текущей версии страницы!<br>Скорее всего, именно это и является причиной ошибки.`,
|
|
174
|
-
// preview_hash_mismatch_title: 'Несовпадение версий страницы!',
|
|
175
|
-
// preview_hash_mismatch_explain:
|
|
176
|
-
// 'Версия страницы, которую вы видите сейчас отличается от версии страницы, на которую вела исходная ссылка!<br>Содержимое может отличаться от того, что вы ожидали увидеть.',
|
|
177
|
-
// current_page_hash: 'Текущий хеш',
|
|
178
|
-
// expected_page_hash: 'Ожидаемый хеш',
|
|
179
|
-
// empty_toc: 'Пустая таблица содержимого...',
|
|
180
|
-
// no_contributors: 'Авторов нет...',
|
|
181
|
-
// make_contribution: 'Внести свой вклад',
|
|
182
|
-
// material_improvement: 'Улучшение материала',
|
|
183
|
-
// how_to_improve: 'Как улучшить?',
|
|
184
|
-
// edit_page: 'Редактировать страницу',
|
|
185
|
-
// report_problem: 'Сообщить о проблеме',
|
|
186
|
-
// references: 'Источники',
|
|
187
|
-
// reference_source_featured: 'Избранный источник',
|
|
188
|
-
// references_description:
|
|
189
|
-
// 'Список внешних источников, которые использовались при написании этого материала. Если рядом с названием стоит звездочка, то это избранный источник и с ним стоит ознакомиться, если вы хотите глубже погрузиться в материал.',
|
|
190
|
-
// sponsors: 'Спонсоры',
|
|
191
|
-
// sponsors_description:
|
|
192
|
-
// 'Список людей и организаций, которые поддерживают проект финансово. Благодаря им проект может существовать и развиваться. Если вы хотите помочь проекту, то тоже можете стать спонсором и попасть на эту страницу!',
|
|
193
|
-
// become_sponsor: 'Стать спонсором',
|
|
194
|
-
// toc: 'Содержание',
|
|
195
|
-
// mentions: (count: number) =>
|
|
196
|
-
// m(count, 'упоминание', 'упоминания', 'упоминаний'),
|
|
197
|
-
// start_learning: 'Начать изучение!',
|
|
198
|
-
// x_contributors: (count: number) => m(count, 'Автор', 'Автора', 'Авторов'),
|
|
199
|
-
// x_sponsors: (count: number) => m(count, 'Спонсор', 'Спонсора', 'Спонсоров'),
|
|
200
|
-
// show_all: 'Показать все',
|
|
201
107
|
};
|
|
202
108
|
|
|
203
|
-
export default ru;
|
|
204
|
-
|
|
205
109
|
export function m(
|
|
206
110
|
number: number,
|
|
207
111
|
one: string,
|
|
@@ -2,7 +2,7 @@ import { serverLanguages } from './list';
|
|
|
2
2
|
|
|
3
3
|
export async function setupServerLanguage() {
|
|
4
4
|
ERUDIT.language = {
|
|
5
|
-
phrases: {},
|
|
5
|
+
phrases: {} as any,
|
|
6
6
|
functions: {},
|
|
7
7
|
};
|
|
8
8
|
|
|
@@ -19,7 +19,7 @@ export async function setupServerLanguage() {
|
|
|
19
19
|
|
|
20
20
|
const languageModule = await serverLanguages[targetLanguage]();
|
|
21
21
|
|
|
22
|
-
ERUDIT.language.phrases = languageModule.
|
|
22
|
+
ERUDIT.language.phrases = languageModule.phrases;
|
|
23
23
|
|
|
24
24
|
for (const [funcKey, funcValue] of Object.entries(languageModule)) {
|
|
25
25
|
if (typeof funcValue === 'function') {
|
|
@@ -6,8 +6,8 @@ export interface EruditServerLanguage {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export interface ServerLanguageModule {
|
|
9
|
-
|
|
10
|
-
[key: string]:
|
|
9
|
+
phrases: LanguagePhrases;
|
|
10
|
+
[key: string]: Function | LanguagePhrases;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export type ServerLanguageModules = Record<
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
searchIndexSnippets,
|
|
8
8
|
} from '@erudit/server/content/search';
|
|
9
9
|
|
|
10
|
-
export default defineEventHandler(async () => {
|
|
10
|
+
export default defineEventHandler(async (event) => {
|
|
11
11
|
const entryLists: SearchEntriesList[] = [
|
|
12
12
|
await searchIndexContributors(),
|
|
13
13
|
...(await searchIndexContentTypes()),
|
|
@@ -69,5 +69,7 @@ export default defineEventHandler(async () => {
|
|
|
69
69
|
|
|
70
70
|
const gzipped = await zip(JSON.stringify(exported));
|
|
71
71
|
|
|
72
|
+
setHeader(event, 'Content-Type', 'application/gzip');
|
|
73
|
+
|
|
72
74
|
return gzipped;
|
|
73
75
|
});
|