Skip to content

Commit 5afd2b6

Browse files
Merge pull request #211 from vuejs-translations/sync
Sync with upstream
2 parents f5595bb + e3d1f5b commit 5afd2b6

File tree

196 files changed

+10212
-1928
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+10212
-1928
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,6 @@ src/api/index.json
111111
src/examples/data.json
112112
src/tutorial/data.json
113113
draft.md
114+
115+
# folders created by IDE
116+
.idea

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-manager-strict=false

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.vue

.vitepress/config.ts

Lines changed: 59 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const nav: ThemeConfig['nav'] = [
1717
{ text: 'انطلاقة سريعة', link: '/guide/quick-start' },
1818
// { text: 'دليل الأسلوب', link: '/style-guide/' },
1919
{ text: 'فهرس', link: '/glossary/' },
20+
{ text: 'مرجع الأخطاء', link: '/error-reference/' },
2021
{
2122
text: 'Vue 2 توثيقات ',
2223
link: 'https://v2.vuejs.org'
@@ -44,6 +45,7 @@ const nav: ThemeConfig['nav'] = [
4445
text: 'Resources',
4546
items: [
4647
{ text: 'الشركاء', link: '/partners/' },
48+
{ text: 'المطورون', link: '/developers/' },
4749
{ text: 'قوالب (Themes)', link: '/ecosystem/themes' },
4850
{ text: 'مكونات واجهة المستخدم', link: 'https://ui-libs.vercel.app/' },
4951
{
@@ -115,6 +117,7 @@ const nav: ThemeConfig['nav'] = [
115117
link: '/about/community-guide'
116118
},
117119
{ text: 'مدونة قواعد السلوك', link: '/about/coc' },
120+
{ text: 'سياسة الخصوصية', link: '/about/privacy' },
118121
{
119122
text: 'الوثائقي',
120123
link: 'https://www.youtube.com/watch?v=OrxmtDw4pVI'
@@ -126,9 +129,13 @@ const nav: ThemeConfig['nav'] = [
126129
link: '/sponsor/'
127130
},
128131
{
129-
text: 'الشركاء',
130-
link: '/partners/',
131-
activeMatch: `^/partners/`
132+
text: 'الخبراء',
133+
badge: { text: 'جديد' },
134+
activeMatch: `^/(partners|developers)/`,
135+
items: [
136+
{ text: 'الشركاء', link: '/partners/' },
137+
{ text: 'المطورون', link: '/developers/', badge: { text: 'جديد' } }
138+
]
132139
}
133140
]
134141

@@ -178,18 +185,15 @@ export const sidebar: ThemeConfig['sidebar'] = {
178185
link: '/guide/essentials/event-handling'
179186
},
180187
{ text: 'ربط إدخالات النموذج', link: '/guide/essentials/forms' },
181-
{
182-
text: 'خطافات دورة الحياة',
183-
link: '/guide/essentials/lifecycle'
184-
},
185188
{ text: 'الخاصيات المراقبة', link: '/guide/essentials/watchers' },
186-
{
187-
text: 'Refs مراجع القالب',
188-
link: '/guide/essentials/template-refs'
189-
},
189+
{ text: 'Refs مراجع القالب', link: '/guide/essentials/template-refs' },
190190
{
191191
text: 'أساسيات المكونات',
192192
link: '/guide/essentials/component-basics'
193+
},
194+
{
195+
text: 'خطافات دورة الحياة',
196+
link: '/guide/essentials/lifecycle'
193197
}
194198
]
195199
},
@@ -376,6 +380,10 @@ export const sidebar: ThemeConfig['sidebar'] = {
376380
{
377381
text: 'حقن الإعتمادية',
378382
link: '/api/composition-api-dependency-injection'
383+
},
384+
{
385+
text: 'Helpers',
386+
link: '/api/composition-api-helpers'
379387
}
380388
]
381389
},
@@ -425,10 +433,12 @@ export const sidebar: ThemeConfig['sidebar'] = {
425433
{
426434
text: 'الواجهة البرمجية المتقدمة',
427435
items: [
428-
{ text: 'دالة التصيير', link: '/api/render-function' },
429-
{ text: 'التصيير من الخادم', link: '/api/ssr' },
436+
{ text: 'العناصر المخصصة', link: '/api/custom-elements' },
437+
{ text: 'دالة التشكيل', link: '/api/render-function' },
438+
{ text: 'التشكيل من الخادم', link: '/api/ssr' },
430439
{ text: 'الأنواع المساعدة (Typescript)', link: '/api/utility-types' },
431-
{ text: 'مصير مخصص', link: '/api/custom-renderer' }
440+
{ text: 'مشكل مخصص', link: '/api/custom-renderer' },
441+
{ text: 'شارات التشكيل', link: '/api/compile-time-flags' }
432442
]
433443
}
434444
],
@@ -570,8 +580,11 @@ export const sidebar: ThemeConfig['sidebar'] = {
570580
export default defineConfigWithTheme<ThemeConfig>({
571581
extends: baseConfig,
572582

583+
sitemap: {
584+
hostname: 'https://vuejs.org'
585+
},
586+
573587
lang: 'ar',
574-
dir:'rtl',
575588
title: 'Vue.js إطار',
576589
description: ' الإطار التقدمي للـJavascript -Vue.js',
577590
srcDir: 'src',
@@ -613,6 +626,14 @@ export default defineConfigWithTheme<ThemeConfig>({
613626
'utf-8'
614627
)
615628
],
629+
[
630+
'script',
631+
{},
632+
fs.readFileSync(
633+
path.resolve(__dirname, './inlined-scripts/uwu.js'),
634+
'utf-8'
635+
)
636+
],
616637
[
617638
'script',
618639
{
@@ -683,6 +704,26 @@ export default defineConfigWithTheme<ThemeConfig>({
683704
text: 'Italiano',
684705
repo: 'https://github.com/vuejs-translations/docs-it'
685706
},
707+
{
708+
link: 'https://fa.vuejs.org',
709+
text: 'فارسی',
710+
repo: 'https://github.com/vuejs-translations/docs-fa'
711+
},
712+
{
713+
link: 'https://ru.vuejs.org',
714+
text: 'Русский',
715+
repo: 'https://github.com/translation-gang/docs-ru'
716+
},
717+
{
718+
link: 'https://cs.vuejs.org',
719+
text: 'Čeština',
720+
repo: 'https://github.com/vuejs-translations/docs-cs'
721+
},
722+
{
723+
link: 'https://zh-hk.vuejs.org',
724+
text: '繁體中文',
725+
repo: 'https://github.com/vuejs-translations/docs-zh-hk'
726+
},
686727
{
687728
link: '/translations/',
688729
text: 'ساعدنا في الترجمة',
@@ -693,7 +734,7 @@ export default defineConfigWithTheme<ThemeConfig>({
693734
algolia: {
694735
indexName: 'vuejs',
695736
appId: 'ML0LEBN7FQ',
696-
apiKey: 'f49cbd92a74532cc55cfbffa5e5a7d01',
737+
apiKey: '21cf9df0734770a2448a9da64a700c22',
697738
searchParameters: {
698739
facetFilters: ['version:v3']
699740
}
@@ -707,7 +748,7 @@ export default defineConfigWithTheme<ThemeConfig>({
707748
socialLinks: [
708749
{ icon: 'github', link: 'https://github.com/vuejs/' },
709750
{ icon: 'twitter', link: 'https://twitter.com/vuejs' },
710-
{ icon: 'discord', link: 'https://discord.com/invite/HBherRA' }
751+
{ icon: 'discord', link: 'https://discord.com/invite/vue' }
711752
],
712753

713754
editLink: {
@@ -725,6 +766,7 @@ export default defineConfigWithTheme<ThemeConfig>({
725766
},
726767

727768
markdown: {
769+
theme: 'github-dark',
728770
config(md) {
729771
md.use(headerPlugin)
730772
// .use(textAdPlugin)
@@ -751,7 +793,6 @@ export default defineConfigWithTheme<ThemeConfig>({
751793
}
752794
},
753795
build: {
754-
minify: 'terser',
755796
chunkSizeWarningLimit: Infinity
756797
},
757798
json: {

.vitepress/inlined-scripts/uwu.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
if (location.search.includes('?uwu')) {
2+
document.documentElement.classList.add('uwu')
3+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<script setup lang="ts">
2+
withDefaults(defineProps<{
3+
title?: string
4+
description?: string
5+
link?: string
6+
linkText?: string
7+
showDivider?: boolean
8+
}>(), {
9+
showDivider: true
10+
})
11+
</script>
12+
13+
<template>
14+
<section class="cta-section">
15+
<div v-if="showDivider" class="cta-divider"></div>
16+
<div class="cta-content">
17+
<h2 v-if="title" class="cta-title">{{ title }}</h2>
18+
<p v-if="description" class="cta-description">{{ description }}</p>
19+
<a v-if="link" :href="link" target="_blank" class="cta-link">{{ linkText }}</a>
20+
<slot></slot>
21+
</div>
22+
</section>
23+
</template>
24+
25+
<style scoped>
26+
.cta-section {
27+
text-align: center;
28+
max-width: 688px;
29+
margin: 0 auto;
30+
}
31+
32+
.cta-divider {
33+
width: 100px;
34+
margin: 0 auto;
35+
border-top: 1px solid var(--vt-c-divider-light);
36+
}
37+
38+
.cta-content {
39+
padding: 28px 28px 96px;
40+
}
41+
42+
.cta-title {
43+
font-size: 34px;
44+
font-weight: 600;
45+
letter-spacing: -0.5px;
46+
line-height: 1.2;
47+
margin: 0.5em 0 1em;
48+
}
49+
50+
.cta-description {
51+
color: var(--vt-c-text-2);
52+
}
53+
54+
.cta-link {
55+
margin-top: 2em;
56+
display: inline-block;
57+
padding: 12px 24px;
58+
background-color: var(--vt-c-bg-mute);
59+
color: var(--vt-c-text-code);
60+
font-weight: 600;
61+
border-radius: 6px;
62+
text-decoration: none;
63+
transition: background-color 0.5s, color 0.5s;
64+
}
65+
66+
.cta-link:hover {
67+
background-color: var(--vt-c-gray-light-4);
68+
}
69+
70+
.dark .cta-link:hover {
71+
background-color: var(--vt-c-gray-dark-3);
72+
}
73+
</style>
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<script setup lang="ts">
2+
import { computed, onMounted, ref, shallowRef } from 'vue'
3+
4+
const props = withDefaults(
5+
defineProps<{
6+
items: Array<any>
7+
filter?: (item: any) => boolean
8+
cardComponent: any
9+
showLinkToAll?: boolean
10+
shuffleItems?: boolean
11+
browseLinkText?: string
12+
browseLinkUrl?: string
13+
splitBy?: string
14+
}>(),
15+
{
16+
showLinkToAll: false,
17+
shuffleItems: false,
18+
splitBy: 'platinum'
19+
}
20+
)
21+
22+
const isMounted = ref(false)
23+
const items = shallowRef([...props.items])
24+
25+
const filteredItems = computed(() =>
26+
props.filter ? items.value.filter(props.filter) : items.value
27+
)
28+
29+
onMounted(() => {
30+
isMounted.value = true
31+
items.value = processItems([...items.value], props.splitBy, props.shuffleItems)
32+
})
33+
34+
function processItems(items: Array<any>, splitBy: string, shouldShuffle: boolean) {
35+
const splitItems = items.filter(item => item[splitBy])
36+
const otherItems = items.filter(item => !item[splitBy])
37+
38+
if (shouldShuffle) {
39+
shuffleArray(splitItems)
40+
shuffleArray(otherItems)
41+
}
42+
43+
return [...splitItems, ...otherItems]
44+
}
45+
46+
function shuffleArray(array: Array<any>) {
47+
for (let i = array.length - 1; i > 0; i--) {
48+
const j = Math.floor(Math.random() * (i + 1)); // don't remove semicolon
49+
[array[i], array[j]] = [array[j], array[i]]
50+
}
51+
}
52+
</script>
53+
54+
<template>
55+
<div v-show="isMounted" class="card-list">
56+
<!-- to skip SSG since the partners are shuffled -->
57+
<ClientOnly>
58+
<component
59+
:is="cardComponent"
60+
v-for="item in filteredItems"
61+
:key="item.id || item.name"
62+
:data="item"
63+
/>
64+
</ClientOnly>
65+
66+
<a
67+
v-if="showLinkToAll && filteredItems.length % 2"
68+
:href="browseLinkUrl"
69+
class="browse-all-link"
70+
>
71+
{{ browseLinkText }}
72+
</a>
73+
</div>
74+
</template>
75+
76+
<style scoped>
77+
.card-list {
78+
display: flex;
79+
flex-wrap: wrap;
80+
justify-content: space-between;
81+
}
82+
83+
.browse-all-link {
84+
display: block;
85+
width: 48.5%;
86+
margin-bottom: 36px;
87+
padding-top: 240px;
88+
font-size: 1.2em;
89+
text-align: center;
90+
color: var(--vt-c-text-2);
91+
border: 1px solid var(--vt-c-divider-light);
92+
border-radius: 4px;
93+
transition: color 0.5s ease;
94+
}
95+
96+
.browse-all-link:hover {
97+
color: var(--vt-c-text-1);
98+
}
99+
100+
@media (max-width: 768px) {
101+
.browse-all-link {
102+
display: none;
103+
}
104+
}
105+
</style>

0 commit comments

Comments
 (0)