Skip to content

Commit

Permalink
Merge pull request #6 from Ampernic/main
Browse files Browse the repository at this point in the history
dynamic localizations and quick fixes
  • Loading branch information
OlegShchavelev authored Jul 14, 2024
2 parents befea40 + 3a19c0a commit bb862ca
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 106 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
.vitepress/dist
.vitepress/cache
.vitepress/cache
.vitepress/data/fullteam.json
26 changes: 20 additions & 6 deletions .tools/gitlog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as fs from 'fs'
import * as path from 'path'
import ora from 'ora'
import { cyan, gray, red } from 'colorette'
import { transliterate as tr } from 'transliteration';

/*
CLI Arguments
Expand All @@ -17,7 +18,10 @@ const args = yargs(process.argv)
})
.parse()

const authors = []
const authors = {
'root': [],
'en': []
}

/*
Net + Local Mapping
Expand Down Expand Up @@ -87,7 +91,10 @@ for await (const gitter of await contributorsRawBase().then((response) => respon
const author = {
mapByNameAliases: [gitter.author.login],
name: userMore.name,
title: 'Участник',
title: {
root: 'Участник',
en: 'Member'
},
avatar: gitter.author.avatar_url,
summary: {
commits: gitter.total,
Expand All @@ -113,23 +120,30 @@ for await (const gitter of await contributorsRawBase().then((response) => respon
author.lastMonthActive.commits += week.c
})

contributions.forEach((memberRaw) => {
contributions.root.forEach((memberRaw) => {
if (
memberRaw.name == userMore.name ||
Object.values(memberRaw.links[0])[1] == Object.values(author.links[0])[1] ||
(memberRaw.nameAliases && memberRaw.nameAliases.includes(gitter.author.login))
(memberRaw.mapByNameAliases && memberRaw.mapByNameAliases.includes(gitter.author.login))
) {
Object.keys(memberRaw).forEach((key) => {
key == 'mapByNameAliases'
? memberRaw[key].forEach((alias) => {
author[key].push(alias)
})
: (author[key] = memberRaw[key])
: key == 'title'
? author[key].root = memberRaw[key]
: (author[key] = memberRaw[key])
})
}
})

authors.push(author)
console.log(author.title)
author.title.root.includes('Разработчик') ? author.title.en = 'Developer, Member' : ''
author.name? '' : author.name = gitter.author.login

authors.en.push({...author, ...{title: author.title.en , name: tr(author.name)}})
authors.root.push({...author, ...{title: author.title.root}})
}

fs.writeFile(
Expand Down
132 changes: 75 additions & 57 deletions .vitepress/data/team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,71 +4,89 @@ import { gitflic, gitverse } from './icons'

const homeSorting = 'month, commits'
const teamSorting = 'role, commits, month'
const leader = 'Олег Щавелев'
const leader = {
'root': 'Олег Щавелев',
'en': 'Oleg Shchavelev'
}
const limit = 6
const developersSection = {
title: 'Разработчики',
description:
'Люди, которые активно участвуют не только в расширении базы знаний, но и в улучшении её функционала.'
'root': {
title: 'Разработчики',
description:
'Люди, которые активно участвуют не только в расширении базы знаний, но и в улучшении её функционала.'
},
'en': {
title: 'Developers',
description:
'People who are actively involved not only in expanding the knowledge base, but also in improving its functionality.'
}
}
const membersSection = {
title: 'Авторы',
description: 'Люди, которые участвуют в улучшении и создании новых статей.'
'root': {
title: 'Авторы',
description: 'Люди, которые участвуют в улучшении и создании новых статей.'
},
'en': {
title: 'Authors',
description: 'People who are involved in improving and creating new articles.'
}
}

export { homeSorting, teamSorting, leader, limit, membersSection, developersSection }


/* Информация об участниках */

export const contributions = [
{
avatar: 'https://github.com/OlegShchavelev.png',
name: 'Олег Щавелев',
mapByNameAliases: ['OlegShchavelev', 'Oleg Shchavelev', 'Олег Щавелев'],
title: 'Разработчик, Участник',
links: [
{ icon: 'github', link: 'https://github.com/OlegShchavelev' },
{
icon: {
svg: gitflic
},
link: 'https://gitflic.ru/user/olegshchavelev'
}
]
},
{
avatar: 'https://avatars.githubusercontent.com/u/44705058?v=4',
name: 'Антон Политов',
mapByNameAliases: ['Ampernic', 'Антон Политов', 'Anton Politov', 'ampernic'],
title: 'Разработчик, Участник',
links: [{ icon: 'github', link: 'https://github.com/Ampernic' }]
},
{
avatar: 'https://avatars.githubusercontent.com/u/57626821?v=4',
name: 'Семен Фомченков',
mapByNameAliases: ['Semen Fomchenkov', 'Armatik', 'armatik'],
title: 'Участник',
links: [
{ icon: 'github', link: 'https://github.com/Armatik' },
{
icon: {
svg: gitflic
},
link: 'https://gitflic.ru/user/armatik'
}
]
},
{
name: 'Владимир Васьков',
mapByNameAliases: ['Rirusha', 'Vladimir Vaskov'],
avatar: 'https://github.com/Rirusha.png',
links: [{ icon: 'github', link: 'https://github.com/Rirusha'}]
},
{
name: 'Артем Быстров',
mapByNameAliases: ['Ubuntigroid'],
avatar: 'https://github.com/Ubuntigroid.png',
links: [{ icon: 'github', link: 'https://github.com/Ubuntigroid'}]
}
]
export const contributions = {
'root': [
{
avatar: 'https://github.com/OlegShchavelev.png',
name: 'Олег Щавелев',
mapByNameAliases: ['OlegShchavelev', 'Oleg Shchavelev', 'Олег Щавелев'],
title: 'Разработчик, Участник',
links: [
{ icon: 'github', link: 'https://github.com/OlegShchavelev' },
{
icon: {
svg: gitflic
},
link: 'https://gitflic.ru/user/olegshchavelev'
}
]
},
{
avatar: 'https://avatars.githubusercontent.com/u/44705058?v=4',
name: 'Антон Политов',
mapByNameAliases: ['Ampernic', 'Антон Политов', 'Anton Politov', 'ampernic'],
title: 'Разработчик, Участник',
links: [{ icon: 'github', link: 'https://github.com/Ampernic' }]
},
{
avatar: 'https://avatars.githubusercontent.com/u/57626821?v=4',
name: 'Семён Фомченков',
mapByNameAliases: ['Semen Fomchenkov', 'Armatik', 'armatik'],
title: 'Участник',
links: [
{ icon: 'github', link: 'https://github.com/Armatik' },
{
icon: {
svg: gitflic
},
link: 'https://gitflic.ru/user/armatik'
}
]
},
{
name: 'Владимир Васьков',
mapByNameAliases: ['Rirusha', 'Vladimir Vaskov'],
avatar: 'https://github.com/Rirusha.png',
links: [{ icon: 'github', link: 'https://github.com/Rirusha'}]
},
{
name: 'Артём Быстров',
mapByNameAliases: ['Ubuntigroid'],
avatar: 'https://github.com/Ubuntigroid.png',
links: [{ icon: 'github', link: 'https://github.com/Ubuntigroid'}]
}
]
}
8 changes: 4 additions & 4 deletions .vitepress/theme/components/AMWHomeTeam.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { computed } from 'vue'
import { useData } from 'vitepress'
import { VPTeamPage, VPTeamPageTitle, VPButton, VPTeamMembers } from 'vitepress/theme'
import { sortMembers } from '../composables/sorters.ts'
import { homeSorting, limit } from '../../data/team.ts'
import { sortMembers } from '../composables/sorters'
import { homeSorting, limit } from '../../data/team'
import { data as team } from '../loaders/gitlogDataLoader.data'
const { frontmatter } = useData()
const { frontmatter, localeIndex } = useData()
const props = computed(() => frontmatter.value.teams ?? {})
</script>
Expand All @@ -19,7 +19,7 @@ const props = computed(() => frontmatter.value.teams ?? {})
<VPTeamPageTitle>
<template #title v-if="props.title">{{ props.title }}</template>
</VPTeamPageTitle>
<VPTeamMembers :members="sortMembers(team, homeSorting).slice(0, limit)" />
<VPTeamMembers :members="sortMembers(team[localeIndex], homeSorting).slice(0, limit)" />
<div class="teamButton" v-if="props.moreLink">
<VPButton :text="props.moreText" class="button" size="big" :href="props.moreLink" />
</div>
Expand Down
19 changes: 9 additions & 10 deletions .vitepress/theme/components/AMWTeamPage.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<script setup lang="ts">
import { computed } from 'vue'
import { useData } from 'vitepress'
import { VPTeamPage, VPTeamPageTitle, VPTeamPageSection, VPTeamMembers } from 'vitepress/theme'
import { data as team } from '../loaders/gitlogDataLoader.data'
import { developersSection, membersSection, teamSorting } from '../../data/team.ts'
import { sortMembers } from '../composables/sorters.ts'
import { developersSection, membersSection, teamSorting } from '../../data/team'
import { sortMembers } from '../composables/sorters'
const { frontmatter } = useData()
const { frontmatter, localeIndex } = useData()
</script>

<template>
Expand All @@ -22,31 +21,31 @@ const { frontmatter } = useData()
<div v-if="teamSorting.includes('role')">
<VPTeamPageSection class="team">
<template #title>
{{ developersSection.title }}
{{ developersSection[localeIndex].title }}
</template>
<template #lead>
{{ developersSection.description }}
{{ developersSection[localeIndex].description }}
</template>
<template #members>
<VPTeamMembers
:members="
sortMembers(team, teamSorting).filter((member) => member.title.includes('Разработчик'))
sortMembers(team[localeIndex], teamSorting).filter((member) => member.title.includes('Разработчик') || member.title.includes('Developer'))
"
/>
</template>
</VPTeamPageSection>

<VPTeamPageSection class="team">
<template #title>
{{ membersSection.title }}
{{ membersSection[localeIndex].title }}
</template>
<template #lead>
{{ membersSection.description }}
{{ membersSection[localeIndex].description }}
</template>
<template #members>
<VPTeamMembers
:members="
sortMembers(team, teamSorting).filter((member) => !member.title.includes('Разработчик'))
sortMembers(team[localeIndex], teamSorting).filter((member) => !member.title.includes('Разработчик') && !member.title.includes('Developer'))
"
/>
</template>
Expand Down
2 changes: 1 addition & 1 deletion docs/en/system/apps-gnome/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ All of the applications in this review are designed with the GNOME philosophy in

## Core applications

GNOME Core applications are designed to perform common tasks on the GNOME desktop. They are usually pre-installed on your ALT Regular Gnome system.
GNOME Core applications are designed to perform common tasks on the GNOME desktop. They are usually pre-installed on your ALT Mobile system.

<GnomeAppsList category="core"/>

Expand Down
2 changes: 1 addition & 1 deletion docs/system/apps-gnome/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ apps:

## Основные приложения

Приложения GNOME Core предназначены для выполнения обычных задач на рабочем столе GNOME. Они обычно предустановлены в вашей системе ALT Regular Gnome.
Приложения GNOME Core предназначены для выполнения обычных задач на рабочем столе GNOME. Они обычно предустановлены в вашей системе ALT Mobile.

<GnomeAppsList category="core"/>

Expand Down
Loading

0 comments on commit bb862ca

Please sign in to comment.