Skip to content

Commit 1d3e71e

Browse files
authored
feat(l10n): save translations to nuxt/translations through a GitHub App (#2589)
1 parent 880e636 commit 1d3e71e

57 files changed

Lines changed: 5600 additions & 1420 deletions

Some content is hidden

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

‎.env.example‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,21 @@ NUXT_GITHUB_TOKEN=
129129
# secret. Generate with: openssl rand -hex 32
130130
CRON_SECRET=
131131

132+
# ----------------------------------------------------------------------------
133+
# Translations (optional: /fr/docs, the translation editor and /translations)
134+
# ----------------------------------------------------------------------------
135+
# Path to a local clone of github.com/nuxt/translations, read instead of GitHub
136+
NUXT_TRANSLATIONS_PATH=
137+
# The nuxt-translations GitHub App, which commits translators' saves to
138+
# nuxt/translations. Without it, saves are dry runs that return the would-be
139+
# commit, and admins act as translators. Production only. The App needs
140+
# Contents and Pull requests (write) on nuxt/translations, and Members (read)
141+
# on the organisation.
142+
NUXT_GITHUB_APP_ID=
143+
NUXT_GITHUB_APP_PRIVATE_KEY=
144+
# Looked up from nuxt/translations when empty
145+
NUXT_GITHUB_APP_INSTALLATION_ID=
146+
132147
# ----------------------------------------------------------------------------
133148
# Nuxters (optional — /nuxters and /nuxters/<username>)
134149
# ----------------------------------------------------------------------------

‎app/assets/css/main.css‎

Lines changed: 66 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,79 @@ html.dark .shiki span {
5454
text-decoration: var(--shiki-dark-text-decoration) !important;
5555
}
5656

57+
/* Shades with at least 3:1 against the page background in each mode. */
58+
:root {
59+
--l10n-warning: var(--ui-color-warning-700);
60+
--l10n-info: var(--ui-color-info-600);
61+
--l10n-success: var(--ui-color-success-700);
62+
--l10n-error: var(--ui-color-error-600);
63+
}
64+
65+
.dark {
66+
--l10n-warning: var(--ui-warning);
67+
--l10n-info: var(--ui-info);
68+
--l10n-success: var(--ui-success);
69+
--l10n-error: var(--ui-error);
70+
}
71+
5772
[data-l10n-show] [data-l10n]::before,
5873
[data-l10n="pending-review"]::before {
5974
content: '';
6075
display: inline-block;
61-
inline-size: 6px;
62-
block-size: 6px;
63-
border-radius: 9999px;
76+
inline-size: 0.5rem;
77+
block-size: 0.5rem;
6478
margin-inline-end: 0.375rem;
6579
vertical-align: middle;
6680
background-color: var(--l10n-dot, transparent);
6781
box-shadow: var(--l10n-ring, none);
82+
border-radius: var(--l10n-radius, 0);
83+
clip-path: var(--l10n-shape, none);
84+
}
85+
86+
[data-l10n="untranslated"] { --l10n-ring: inset 0 0 0 1.5px var(--ui-text-muted); --l10n-radius: 9999px; }
87+
[data-l10n="machine"] { --l10n-dot: var(--l10n-warning); --l10n-radius: 9999px; }
88+
[data-l10n="pending-review"] { --l10n-dot: var(--l10n-warning); --l10n-shape: polygon(50% 0, 100% 100%, 0 100%); }
89+
[data-l10n="edited"] { --l10n-dot: var(--l10n-info); --l10n-radius: 1px; }
90+
[data-l10n="verified"] { --l10n-dot: var(--l10n-success); --l10n-shape: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%); }
91+
[data-l10n="rejected"] { --l10n-dot: var(--l10n-error); --l10n-shape: polygon(20% 0, 50% 30%, 80% 0, 100% 20%, 70% 50%, 100% 80%, 80% 100%, 50% 70%, 20% 100%, 0 80%, 30% 50%, 0 20%); }
92+
93+
[data-l10n-show] [data-l10n-hash] {
94+
cursor: pointer;
95+
border-radius: 0.25rem;
96+
outline-offset: 2px;
97+
}
98+
99+
[data-l10n-show] [data-l10n-hash]:hover {
100+
outline: 1px solid var(--ui-border-accented);
68101
}
69102

70-
[data-l10n="machine"] { --l10n-dot: var(--ui-warning); }
71-
[data-l10n="pending-review"] { --l10n-dot: var(--ui-warning); --l10n-ring: 0 0 0 2px color-mix(in oklab, var(--ui-warning) 35%, transparent); }
72-
[data-l10n="edited"] { --l10n-dot: var(--ui-info); }
73-
[data-l10n="verified"] { --l10n-dot: var(--ui-success); }
74-
[data-l10n="untranslated"] { --l10n-ring: inset 0 0 0 1px var(--ui-text-dimmed); }
75-
[data-l10n="rejected"] { --l10n-dot: var(--ui-error); }
103+
[data-l10n-staged] {
104+
outline: 2px dashed var(--l10n-info);
105+
outline-offset: 2px;
106+
border-radius: 0.25rem;
107+
}
108+
109+
[data-l10n-staged="verify"] { outline-style: solid; outline-color: var(--l10n-success); }
110+
[data-l10n-staged="reject"] { outline-style: dotted; outline-color: var(--l10n-error); }
111+
112+
[data-l10n-show] [data-l10n-hash]:focus-visible {
113+
outline: 2px solid var(--ui-border-inverted);
114+
outline-offset: 2px;
115+
}
116+
117+
[data-l10n-active] {
118+
border-radius: 0.25rem;
119+
background-color: color-mix(in oklab, var(--ui-primary) 10%, transparent);
120+
box-shadow: 0 0 0 0.25rem color-mix(in oklab, var(--ui-primary) 10%, transparent);
121+
}
122+
123+
[data-l10n-suggested]::after {
124+
content: '';
125+
display: inline-block;
126+
inline-size: 0.5rem;
127+
block-size: 0.5rem;
128+
border-radius: 9999px;
129+
margin-inline-start: 0.375rem;
130+
vertical-align: middle;
131+
background-color: var(--l10n-info);
132+
}

‎app/components/AppFooter.vue‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<script setup lang="ts">
22
const { footerLinks } = useFooterLinks()
3+
const locale = useDocsLocale()
34
</script>
45

56
<template>
67
<USeparator icon="i-simple-icons-nuxtdotjs" class="h-px" />
78

8-
<UFooter :ui="{ top: 'border-b border-default' }">
9+
<UFooter :lang="locale ? 'en' : undefined" :ui="{ top: 'border-b border-default' }">
910
<template #top>
1011
<UContainer>
1112
<UFooterColumns :columns="footerLinks">

0 commit comments

Comments
 (0)