Skip to content

Commit 703c254

Browse files
committed
Merge branch 'main' of github.com:strapi/documentation
2 parents 5467e37 + 32b73ee commit 703c254

File tree

18 files changed

+332
-19
lines changed

18 files changed

+332
-19
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
<!--
2-
Hello 👋 Thank you for submitting a pull request.
2+
Hello 👋 Thank you for submitting a pull request!
33
4-
To help us merge your PR, make sure to follow the instructions below:
4+
To help us merge your PR, make sure to follow the instructions detailed in the Contributing Guide:
5+
https://github.com/strapi/documentation/blob/main/CONTRIBUTING.md
56
6-
- Create or update the documentation. (Should be made against the `main` branch)
7-
- Create or update the tests.
8-
- Refer to the issue you are closing in the PR description - fix #issue
9-
- Specify if the PR is in WIP (work in progress) state or ready to be merged
7+
Note that all documentation updates should be made against the `main` branch.
8+
Keep your PR in Draft mode until it's ready to be reviewed and merged.
109
11-
Please ensure you read through the Contributing Guide:
12-
https://github.com/strapi/documentation/blob/main/CONTRIBUTING.md
13-
-->
1410
15-
### What does it do?
11+
As part of the Docs Contribution Program, all external contribution PRs are labeled `contribution`.
12+
Feel free to read more details on the Contribution Program in the dedicated guide:
13+
https://strapi.notion.site/Documentation-Contribution-Program-1d08f359807480d480fdde68bb7a5a71
1614
17-
Describe the technical changes you did.
15+
Let us know if you do not wish to take part in the Docs Contribution Program, and remove the `contribution` label.
16+
-->
1817

19-
### Why is it needed?
18+
### Description
2019

21-
Describe the issue you are solving.
20+
Describe the changes you did: What does it do? Why is it needed?
2221

2322
### Related issue(s)/PR(s)
2423

25-
Let us know if this is related to any issue/pull request
24+
Let us know if this is related to any issue/pull request or contribution idea suggested by the Docs team.

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Contributing to the Strapi documentation implies 2 steps:
1717

1818
2. [Submit a pull request](#-pull-requests) for review.
1919

20+
By default, all external contributions are automatically labeled `contribution` to be apart of the [Docs Contribution Program](https://strapi.notion.site/Documentation-Contribution-Program-1d08f359807480d480fdde68bb7a5a71), which rewards contributors with points (based on the amount of updates in the pull request) that can then be used in the Strapi Shop to get Strapi goodies. If you do not wish to take part in the program, let the Strapi Documentation team know and the `contribution` label will be removed from your pull request.
21+
2022
## 🦖 Docusaurus
2123

2224
Strapi’s documentation is built with the React- and Markdown-based [Docusaurus](https://docusaurus.io) framework.
@@ -98,6 +100,7 @@ To submit your contribution for review:
98100

99101
That’s it! 🥳 Once the pull request is [reviewed and approved](#review-and-management-of-pull-requests), the Strapi Documentation team will merge it, and the content will be live on [docs.strapi.io](http://docs.strapi.io) a few minutes later. 🚀
100102

103+
If your contribution takes part in the [Docs Contribution Program](https://strapi.notion.site/Documentation-Contribution-Program-1d08f359807480d480fdde68bb7a5a71), as soon as your pull request is merged, you should receive an email with a link to the Strapi Shop where points you have earned will have been granted to your account.
101104

102105
## Review and management of pull requests
103106

docusaurus/docs/cms/features/internationalization.md

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ tags:
1111
- features
1212
---
1313

14+
import StrapiAiCredits from '/docs/snippets/strapi-ai-credits.md'
15+
1416
# Internationalization (i18n)
1517

1618
<Tldr>
@@ -83,6 +85,21 @@ It is not possible to create custom locales. Locales can only be created based o
8385
}}
8486
/>
8587

88+
#### Enabling AI-powered internationalization
89+
<GrowthBadge />
90+
91+
AI-Powered Internationalization enables automatic translations for all the locales in a project when the content in the default locale is updated. This enables content editors to have their content translated into multiple languages within a few seconds.
92+
93+
AI-powered Internationalization is disabled by default. To enable it, go to <Icon name="gear-six" /> *Settings > Global Settings > Internationalization* and set <Icon name="sparkle" /> _AI Translations_ to _Enabled_.
94+
95+
<ThemedImage
96+
alt="Internationalization settings"
97+
sources={{
98+
light: '/img/assets/settings/i18n-with-ai.png',
99+
dark: '/img/assets/settings/i18n-with-ai_DARK.png',
100+
}}
101+
/>
102+
86103
### Code-based configuration
87104

88105
A `STRAPI_PLUGIN_I18N_INIT_LOCALE_CODE` [environment variable](/cms/configurations/environment#strapi) can be configured to set the default locale for your environment. The value used for this variable should be an ISO country code from <ExternalLink to="https://github.com/strapi/strapi/blob/main/packages/plugins/i18n/server/src/constants/iso-locales.json" text="the 500+ pre-created list of locales"/>.
@@ -105,10 +122,6 @@ To translate content in another locale:
105122
2. Choose the locale in which you want to translate your content.
106123
3. Translate your content by filling up your content-type's fields.
107124

108-
:::tip
109-
Click on the <Icon name="download-simple" /> *Fill in from another locale* button, in the top right corner, for all non relational fields to be filled up with the values of another chosen locale. It can be useful if you do not remember what was the exact content in another locale.
110-
:::
111-
112125
<ThemedImage
113126
alt="Managing locales with i18n"
114127
sources={{
@@ -117,6 +130,33 @@ Click on the <Icon name="download-simple" /> *Fill in from another locale* butto
117130
}}
118131
/>
119132

133+
:::tip
134+
Click on the <Icon name="globe-hemisphere-west" /> *Fill in from another locale* button, in the top right corner, for all non relational fields to be filled up with the values of another chosen locale. It can be useful if you do not remember what was the exact content in another locale. This button is not visible if you've enabled [AI-powered internationalization](#ai-powered-internationalization) since translations are automatically handled by Strapi AI.
135+
:::
136+
137+
### AI-powered internationalization <NewBadge /> {#ai-powered-internationalization}
138+
<GrowthBadge />
139+
140+
[When enabled](#enabling-ai-powered-internationalization), AI-powered internationalization enables automatic translations for all the locales in a project when the source content is updated. This enables content editors to have their content translated into multiple languages within a few seconds. The idea behind the feature is to ensure users only manually fill in content in the default locale, and Strapi AI translates it for all other existing locales.
141+
142+
Once enabled, whenever you edit a content-type in the default locale and click **Save**, all other locales for the content-type should be translated automatically, which will be confirmed by an _All locales have been translated_ notification. Using this feature consumes Strapi AI credits.
143+
144+
<ThemedImage
145+
alt="Managing locales with AI-powered i18n"
146+
sources={{
147+
light: '/img/assets/content-manager/locale-i18n-with-ai.png',
148+
dark: '/img/assets/content-manager/locale-i18n-with-ai_DARK.png',
149+
}}
150+
/>
151+
152+
:::caution
153+
AI-powered internationalization only works one way, keeping the default locale content as the unique source of truth. Consequently, once the feature is enabled:
154+
- Editing and saving content for any locale othen than the default one will not trigger automatic translations.
155+
- When editing the content for the default locale, the manual modifications made to other locales will be overwritten.
156+
:::
157+
158+
<StrapiAiCredits />
159+
120160
### Usage with APIs
121161

122162
Localized content can be requested, created, updated, and deleted for a given locale through the various front-end APIs accessible from [Strapi's Content API](/cms/api/content-api):

docusaurus/docs/release-notes.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,52 @@ New versions (minor or patch) are generally released weekly, on Wednesdays.
2828
</details>
2929

3030

31+
## 6.10.0
32+
33+
<br />
34+
### <Icon name='sparkle' /> New content
35+
36+
<br />
37+
38+
#### Repository
39+
- [Replace Algolia search with MeiliSearch](https://github.com/strapi/documentation/pull/2783)
40+
- [Add a "News Ticker" to homepage](https://github.com/strapi/documentation/pull/2766)
41+
42+
### <Icon name='pen-nib' /> Updated content
43+
44+
<br />
45+
46+
#### CMS
47+
- [Add rate limiting documentation for users-permissions plugin](https://github.com/strapi/documentation/pull/2782)
48+
49+
#### Repository
50+
- [Add contribution program links to footer and top nav](https://github.com/strapi/documentation/pull/2781)
51+
52+
### <Icon name='broom' /> Chore, fixes, typos, and other improvements
53+
54+
<br />
55+
56+
#### Repository
57+
- [Fix S key in Ask AI modal triggering the MeiliSearch modal](https://github.com/strapi/documentation/pull/2786)
58+
- [Docs Contribution Program: updates in PR template & contribution guide](https://github.com/strapi/documentation/pull/2784)
59+
60+
***
61+
This release was made possible thanks to the following contributors. Thank you! 🫶
62+
<div>
63+
<a href="https://github.com/crasite" target="_blank">
64+
<img className="no-zoom" src="https://avatars.githubusercontent.com/u/9783406?v=4" width="40" height="40" style={{borderRadius: '50%'}} alt="crasite"/>
65+
</a>
66+
<a href="https://github.com/meganelacheny" target="_blank">
67+
<img className="no-zoom" src="https://avatars.githubusercontent.com/u/19183360?v=4" width="40" height="40" style={{borderRadius: '50%'}} alt="meganelacheny"/>
68+
</a>
69+
<a href="https://github.com/pwizla" target="_blank">
70+
<img className="no-zoom" src="https://avatars.githubusercontent.com/u/4233866?v=4" width="40" height="40" style={{borderRadius: '50%'}} alt="pwizla"/>
71+
</a>
72+
</div>
73+
<br/>
74+
<br/>
75+
76+
3177
## 6.9.5
3278

3379
<br />

docusaurus/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "strapi-docs",
3-
"version": "6.9.5",
3+
"version": "6.10.0",
44
"private": true,
55
"scripts": {
66
"docusaurus": "docusaurus",

docusaurus/sidebars.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ const sidebars = {
9090
type: 'doc',
9191
label: 'Internationalization (i18n)',
9292
id: 'cms/features/internationalization',
93+
customProps: {
94+
updated: true,
95+
},
9396
},
9497
{
9598
type: 'doc',
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import React, { useState, useEffect } from 'react';
2+
import styles from './styles.module.scss';
3+
import clsx from 'clsx';
4+
import Icon from '@site/src/components/Icon';
5+
6+
const NewsTicker = ({ newsItems, interval = 5000 }) => {
7+
const [currentIndex, setCurrentIndex] = useState(0);
8+
const [isFading, setIsFading] = useState(false);
9+
const [isPaused, setIsPaused] = useState(false);
10+
11+
const handleNavigation = (newIndex) => {
12+
const isWrapping =
13+
(currentIndex === newsItems.length - 1 && newIndex === 0) ||
14+
(currentIndex === 0 && newIndex === newsItems.length - 1);
15+
16+
if (isWrapping) {
17+
setIsFading(true);
18+
setTimeout(() => {
19+
setCurrentIndex(newIndex);
20+
setIsFading(false);
21+
}, 250); // Half of the fade animation duration
22+
} else {
23+
setCurrentIndex(newIndex);
24+
}
25+
};
26+
27+
// Auto-rotation effect
28+
useEffect(() => {
29+
if (isPaused || newsItems.length <= 1) {
30+
return; // Do nothing if paused or not enough items
31+
}
32+
33+
const timer = setInterval(() => {
34+
handleNavigation((currentIndex + 1) % newsItems.length);
35+
}, interval);
36+
37+
return () => clearInterval(timer);
38+
}, [isPaused, currentIndex, newsItems, interval]);
39+
40+
if (!newsItems || newsItems.length === 0) {
41+
return null;
42+
}
43+
44+
return (
45+
<div
46+
className={clsx(styles.newsTicker, 'news-ticker-container', isFading && styles.isFading)}
47+
onMouseEnter={() => setIsPaused(true)}
48+
onMouseLeave={() => setIsPaused(false)}
49+
>
50+
<div className={styles.contentViewport}>
51+
<div className={styles.filmStrip} style={{ transform: `translateX(-${currentIndex * 100}%)` }}>
52+
{newsItems.map((item, index) => (
53+
<div key={index} className={styles.newsItem}>
54+
<a href={item.link} target="_blank" rel="noopener noreferrer">
55+
{item.icon && <Icon name={item.icon} classes="ph-fill" />}
56+
<span>{item.text}</span>
57+
</a>
58+
</div>
59+
))}
60+
</div>
61+
</div>
62+
63+
{newsItems.length > 1 && (
64+
<div className={styles.dotsContainer}>
65+
{newsItems.map((_, index) => (
66+
<button
67+
key={index}
68+
className={clsx(styles.dot, { [styles.active]: currentIndex === index })}
69+
onClick={() => handleNavigation(index)}
70+
aria-label={`Go to news item ${index + 1}`}
71+
/>
72+
))}
73+
</div>
74+
)}
75+
</div>
76+
);
77+
};
78+
79+
export default NewsTicker;
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
.newsTicker {
2+
background-color: var(--ifm-background-color);
3+
padding: 1.25rem 2rem;
4+
display: flex;
5+
align-items: center;
6+
width: 100%;
7+
gap: 1.5rem;
8+
transition: opacity 0.25s ease-in-out;
9+
10+
&.isFading {
11+
opacity: 0;
12+
}
13+
}
14+
15+
.contentViewport {
16+
flex-grow: 1;
17+
min-width: 0;
18+
overflow: hidden;
19+
}
20+
21+
.filmStrip {
22+
display: flex;
23+
transition: transform 0.5s ease-in-out;
24+
}
25+
26+
.newsItem {
27+
flex: 0 0 100%;
28+
display: flex;
29+
justify-content: center;
30+
align-items: center;
31+
32+
a {
33+
display: flex;
34+
align-items: center;
35+
gap: 0.75rem;
36+
font-weight: 500;
37+
color: var(--ifm-font-color-base);
38+
text-decoration: none;
39+
white-space: normal;
40+
text-align: left;
41+
transition: color 0.3s ease;
42+
43+
i {
44+
font-size: 1.25rem;
45+
color: var(--ifm-font-color-base);
46+
flex-shrink: 0;
47+
transition: color 0.3s ease;
48+
}
49+
50+
&:hover,
51+
&:hover i {
52+
color: var(--news-ticker-hover-color);
53+
}
54+
}
55+
}
56+
57+
.dotsContainer {
58+
display: flex;
59+
gap: 0.5rem;
60+
flex-shrink: 0;
61+
}
62+
63+
.dot {
64+
width: 8px;
65+
height: 8px;
66+
border-radius: 50%;
67+
background-color: var(--ifm-color-emphasis-300);
68+
border: none;
69+
padding: 0;
70+
cursor: pointer;
71+
transition: background-color 0.3s ease;
72+
73+
&.active {
74+
background-color: var(--news-ticker-active-dot-color);
75+
}
76+
}
77+
78+
// Mobile-specific adjustments
79+
@media (max-width: 996px) {
80+
.newsTicker {
81+
padding-left: 1rem;
82+
padding-right: 1rem;
83+
gap: 1rem;
84+
}
85+
86+
.newsItem {
87+
justify-content: flex-start;
88+
}
89+
}

docusaurus/src/pages/home/Home.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
HeroTitle,
1919
HomepageAIButton,
2020
} from '../../components';
21+
import NewsTicker from '@site/src/components/NewsTicker';
2122
import Icon from '../../components/Icon';
2223
import content from './_home.content';
2324

@@ -136,6 +137,7 @@ export default function PageHome() {
136137
}}
137138
/>
138139
<main className={clsx(styles.home, isDarkTheme ? styles.homeDark : '')}>
140+
<NewsTicker newsItems={content.newsTicker} />
139141
<Hero id="homeHero" className={isDarkTheme ? styles.heroDark : ''}>
140142
<Container>
141143
<HeroTitle className="heroTitle">

0 commit comments

Comments
 (0)