Skip to content

i18n(fr): add plugins pages#36

Merged
dreyfus92 merged 2 commits into
withstudiocms:mainfrom
ArmandPhilippot:i18n/fr-add-plugins
Apr 1, 2025
Merged

i18n(fr): add plugins pages#36
dreyfus92 merged 2 commits into
withstudiocms:mainfrom
ArmandPhilippot:i18n/fr-add-plugins

Conversation

@ArmandPhilippot
Copy link
Copy Markdown
Member

@ArmandPhilippot ArmandPhilippot commented Apr 1, 2025

Description

Adds the French translation of the plugins pages.

Summary by CodeRabbit

  • Documentation
    • Introduced comprehensive guides for creating and integrating extension modules within StudioCMS.
    • Detailed instructions cover module configuration, dynamic navigation, and integration with external systems.
    • Practical examples assist developers in extending and customizing their StudioCMS experience.

@ArmandPhilippot ArmandPhilippot requested a review from a team as a code owner April 1, 2025 14:31
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 1, 2025

Walkthrough

This pull request adds two new French documentation files for StudioCMS extension modules. The documentation covers module creation, directory structure, TypeScript examples, Astro integration, dynamic routes, grid items, and navigation links. Additionally, new public entities are introduced: a function and interface in the code along with a module declaration for custom configuration.

Changes

File(s) Summary
src/content/docs/fr/plugins/extended.mdx, src/content/docs/fr/plugins/index.mdx Added comprehensive French documentation for StudioCMS extension modules. The docs detail module creation with file structure, TypeScript examples, Astro integration, dynamic routes, grid items, navigation links, and include a new StudioCMSPlugin type definition.
src/index.ts, src/routes/[...slug].astro Introduced new public entities: added the function studioCMSPageInjector(options: Options), the Options interface in src/index.ts, and the module declaration declare module 'myplugin:config' in src/routes/[...slug].astro for supporting extension module configuration.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant CMS as StudioCMS Core
    participant Ext as Extension Module
    participant Astro as Astro Integration

    Dev->>CMS: Register extension module (using StudioCMSPlugin)
    CMS->>Ext: Invoke studioCMSPageInjector(options)
    Ext->>Astro: Setup configuration and hooks
    Astro->>CMS: Return dynamic routing & navigation details
Loading

Suggested labels

i18n

Suggested reviewers

  • Adammatthiesen
  • dreyfus92

Poem

Hoppin’ through docs with a cheerful beat,
I penned these changes with a code-savvy feat.
New modules sprout like carrots in a row,
Astro lights the path where our routes now flow.
From my bunny heart, I share this playful cheer—
May our StudioCMS journey thrive this year!


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@studiocms-no-reply
Copy link
Copy Markdown
Member

studiocms-no-reply commented Apr 1, 2025

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
fr/plugins/extended.mdx Localization added, will be marked as complete.
fr/plugins/index.mdx Localization added, will be marked as complete.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (6)
src/content/docs/fr/plugins/index.mdx (3)

11-18: Introduction and Comparative Language
The introductory paragraphs clearly describe the purpose of extension modules. One minor suggestion: the phrase “sont similaires aux intégrations Astro” (line 17) might be refined for clarity (e.g. “sont analogues aux intégrations Astro”) since the adjective “similaires” is noted by some style guides to be used in an absolute form.

🧰 Tools
🪛 LanguageTool

[style] ~17-~17: L’adjectif « similaires » s’emploie uniquement de façon absolue (sans « à »).
Context: ...s modules d’extension de StudioCMS sont similaires aux intégrations Astro, mais ils intègrent ...

(SIMILAIRE)


285-291: Explanation Readability and Typography
The explanatory text following the code example (lines 285–291) is informative but could be split into shorter sentences to improve clarity. Additionally, please review the punctuation and spacing (especially around colons and apostrophes) to ensure consistency with typographical standards.


287-290: Link Section Formatting
The <ReadMore> component and the subsequent links block are well structured. A minor suggestion is to add a terminating punctuation (e.g. a period) at the end of the explanatory sentence to enhance readability, and ensure that spacing before colons complies with French typographic rules.

src/content/docs/fr/plugins/extended.mdx (3)

120-122: Module Extension Explanation Readability
The brief explanation (lines 120–122) summarizing the module extension example is clear. Consider splitting any lengthy sentences to further improve readability.

🧰 Tools
🪛 LanguageTool

[style] ~121-~121: Une autre structure peut sembler plus percutante.
Context: ...it un module d’extension pour StudioCMS incluant une intégration Astro et permettant de ...

(INCLUANT_EXCLUANT)


222-312: Navigation Component Integration and Anchor Attribute Syntax
The Navigation component example (lines 222–312) provides a comprehensive implementation for frontend navigation using StudioCMS helpers. One point to verify: the anchor tags are written using the shorthand {href} (e.g. <a {href}>). Consider confirming whether this syntax is fully supported in your Astro setup—standard practice is usually to use href={href}.

🧰 Tools
🪛 LanguageTool

[typographical] ~224-~224: Caractère d’apostrophe incorrect.
Context: ...nière que le fait le module d’extension @studiocms/blog, vous pouvez créer un composant `Naviga...

(APOS_INCORRECT)


1-32: General Editorial Suggestions
A few static analysis hints recommend reviewing the document’s overall typography and style. In particular, verify that apostrophes, spaces before colons, and punctuation (including the termination of sentences) adhere to French typographical standards. This will further enhance the document’s professionalism.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~24-~24: Cette abréviation peut sembler familière dans un contexte formel.
Context: ...leTree> - package.json - src - index.ts - routes - [...slug].astro - da...

(DET_ABREGE)


[typographical] ~26-~26: Le caractère « points de suspension » est suivi par une espace.
Context: ...- src - index.ts - routes - [...slug].astro - dashboard-grid-items - M...

(POINTS_SUSPENSIONS_SPACE)


[style] ~27-~27: Alternatives possibles pour cet anglicisme :
Context: ...ts - routes - [...slug].astro - dashboard-grid-items - MyPluginGridItem.astro...

(FR_SIMPLE_REPLACE_ANGLICISM_PREMIUM_DASHBOARD)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4cfefea and 8b80997.

📒 Files selected for processing (2)
  • src/content/docs/fr/plugins/extended.mdx (1 hunks)
  • src/content/docs/fr/plugins/index.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/content/docs/fr/plugins/extended.mdx

[uncategorized] ~24-~24: Cette abréviation peut sembler familière dans un contexte formel.
Context: ...leTree> - package.json - src - index.ts - routes - [...slug].astro - da...

(DET_ABREGE)


[typographical] ~26-~26: Le caractère « points de suspension » est suivi par une espace.
Context: ...- src - index.ts - routes - [...slug].astro - dashboard-grid-items - M...

(POINTS_SUSPENSIONS_SPACE)


[style] ~27-~27: Alternatives possibles pour cet anglicisme :
Context: ...ts - routes - [...slug].astro - dashboard-grid-items - MyPluginGridItem.astro...

(FR_SIMPLE_REPLACE_ANGLICISM_PREMIUM_DASHBOARD)


[typographical] ~34-~34: Caractère d’apostrophe incorrect.
Context: ... d’extension Dans le fichier principal src/index.ts, vous définirez le module d’extension p...

(APOS_INCORRECT)


[style] ~34-~34: Une autre structure peut sembler plus percutante.
Context: ... d’un module d’extension pour StudioCMS incluant une intégration Astro pour créer un blo...

(INCLUANT_EXCLUANT)


[style] ~121-~121: Une autre structure peut sembler plus percutante.
Context: ...it un module d’extension pour StudioCMS incluant une intégration Astro et permettant de ...

(INCLUANT_EXCLUANT)


[typographical] ~127-~127: Caractère d’apostrophe incorrect.
Context: ...> ## Exemple de route Dans le fichier src/routes/[...slug].astro, vous définirez la route du module d’ex...

(APOS_INCORRECT)


[typographical] ~127-~127: Caractère d’apostrophe incorrect.
Context: ...est le frontmatter (entre les barrières ---), et la seconde est le modèle HTML plac...

(APOS_INCORRECT)


[typographical] ~127-~127: Caractère d’apostrophe incorrect.
Context: ...èle HTML placé sous la seconde barrière ---. ```ts twoslash title="Frontmatter" //...

(APOS_INCORRECT)


[uncategorized] ~182-~182: Cette conjonction ne s’élide pas dans ce cas précis.
Context: ...ui affiche une liste d’articles de blog lorsqu’aucun slug n’est fourni et affiche le contenu...

(CONJONCTIONS)


[style] ~186-~186: Alternatives possibles pour cet anglicisme :
Context: ...le d’élément de grille Dans le fichier src/dashboard-grid-items/MyPluginGridItem.astro, vou...

(FR_SIMPLE_REPLACE_ANGLICISM_PREMIUM_DASHBOARD)


[style] ~220-~220: Cette structure peut être allégée.
Context: ...5 pages les plus récemment mises à jour au cours des 30 derniers jours. Cet élément inclut u...

(AU_COURS_DE1)


[typographical] ~224-~224: Caractère d’apostrophe incorrect.
Context: ...nière que le fait le module d’extension @studiocms/blog, vous pouvez créer un composant `Naviga...

(APOS_INCORRECT)

src/content/docs/fr/plugins/index.mdx

[style] ~17-~17: L’adjectif « similaires » s’emploie uniquement de façon absolue (sans « à »).
Context: ...s modules d’extension de StudioCMS sont similaires aux intégrations Astro, mais ils intègrent ...

(SIMILAIRE)


[typographical] ~257-~257: Caractère d’apostrophe incorrect.
Context: ...s devez créer un objet conforme au type StudioCMSPlugin. Cet objet doit ressembler à l’exemple ...

(APOS_INCORRECT)


[uncategorized] ~293-~293: Une phrase longue peut apporter une perte de sens pour le lecteur. Celle-ci peut donc être divisée afin d’apporter de la clarté et du rythme.
Context: ...odule d’extension pour StudioCMS appelé Mon module d’extension qui nécessite la ve...

(POINT_DET)


[typographical] ~293-~293: Une espace est requise.
Context: ...sage dans la console lorsque le crochet astro:config:setup est appelé. Pour plus ...

(DEUX_POINTS_ESPACE)


[uncategorized] ~295-~295: Un point est requis pour indiquer la fin de cette phrase.
Context: ...les d’extension utiles][extended-plugins] {/* Links */} [extended-plu...

(POINT)


[style] ~297-~297: Alternatives possibles pour cet anglicisme :
Context: ...iles][extended-plugins] {/* Links */} [extended-plugins]: /fr/plugins/ext...

(FR_SIMPLE_REPLACE_ANGLICISM_PREMIUM_LINKS)


[uncategorized] ~298-~298: Les deux-points sont précédés d’une espace insécable.
Context: ...adMore> {/* Links */} [extended-plugins]: /fr/plugins/extended/

(FRENCH_WHITESPACE)

🔇 Additional comments (13)
src/content/docs/fr/plugins/index.mdx (4)

1-7: Metadata Block Verification
The frontmatter (lines 1–7) correctly sets the translation flag, title, description, and sidebar order.


9-9: Import Statement Verification
The import of the ReadMore component is correct. Just ensure the path is resolved correctly in your build configuration.


19-247: Type Definition Completeness
The StudioCMSPlugin type is comprehensive and well-documented. All required and optional properties are clearly described, which will help developers adhere to the expected interface.


257-283: Module Extension Example – Code Implementation
The code example demonstrating the creation of a StudioCMS extension module via definePlugin is clear and concise. Verify that the integration process (via monIntegration) meets your evolving project requirements.

🧰 Tools
🪛 LanguageTool

[typographical] ~257-~257: Caractère d’apostrophe incorrect.
Context: ...s devez créer un objet conforme au type StudioCMSPlugin. Cet objet doit ressembler à l’exemple ...

(APOS_INCORRECT)

src/content/docs/fr/plugins/extended.mdx (9)

1-7: Frontmatter Block Validation
The metadata block (lines 1–7) appropriately configures the page for i18n and sets the sidebar order.


9-10: Import Statements Verification
Both ReadMore and FileTree components are imported correctly. Ensure that the FileTree component displays the file structure as intended in your documentation theme.


12-14: Introduction Text Evaluation
The "Présentation" section clearly introduces the concept of extension modules with a concise description.


16-30: File Structure Demonstration
The FileTree block (lines 16–30) effectively outlines the recommended directory structure for a module extension. This visual aid is a helpful addition for users.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~24-~24: Cette abréviation peut sembler familière dans un contexte formel.
Context: ...leTree> - package.json - src - index.ts - routes - [...slug].astro - da...

(DET_ABREGE)


[typographical] ~26-~26: Le caractère « points de suspension » est suivi par une espace.
Context: ...- src - index.ts - routes - [...slug].astro - dashboard-grid-items - M...

(POINTS_SUSPENSIONS_SPACE)


[style] ~27-~27: Alternatives possibles pour cet anglicisme :
Context: ...ts - routes - [...slug].astro - dashboard-grid-items - MyPluginGridItem.astro...

(FR_SIMPLE_REPLACE_ANGLICISM_PREMIUM_DASHBOARD)


36-119: Module Extension Implementation Example
The code sample (lines 36–119) that defines the function studioCMSPageInjector and sets up an Astro integration is well implemented. The integration logic—including the dynamic route injection and virtual imports—is clear and aligns with the intended functionality.


124-153: Dynamic Route Example Verification
The "Exemple de route" section (lines 124–153) effectively demonstrates how to declare a dynamic route with frontmatter and accompanying TypeScript configuration. Verify that the usage of Astro.params and the routing logic meets your application’s requirements.

🧰 Tools
🪛 LanguageTool

[typographical] ~127-~127: Caractère d’apostrophe incorrect.
Context: ...> ## Exemple de route Dans le fichier src/routes/[...slug].astro, vous définirez la route du module d’ex...

(APOS_INCORRECT)


[typographical] ~127-~127: Caractère d’apostrophe incorrect.
Context: ...est le frontmatter (entre les barrières ---), et la seconde est le modèle HTML plac...

(APOS_INCORRECT)


[typographical] ~127-~127: Caractère d’apostrophe incorrect.
Context: ...èle HTML placé sous la seconde barrière ---. ```ts twoslash title="Frontmatter" //...

(APOS_INCORRECT)


160-179: Template Example Evaluation
The Astro template provided (lines 160–179) correctly handles both cases—displaying an individual page when a slug is present and a list of pages when it isn’t. The conditional rendering is clear and maintains consistency with standard Astro practices.


182-182: Route Example Summary
The summary sentence (line 182) succinctly explains the behavior of the dynamic route; it is clear and accurate.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~182-~182: Cette conjonction ne s’élide pas dans ce cas précis.
Context: ...ui affiche une liste d’articles de blog lorsqu’aucun slug n’est fourni et affiche le contenu...

(CONJONCTIONS)


184-218: Dashboard Grid Item Example
The example in the "Exemple d’élément de grille" section (lines 184–218) is well structured. The logic to filter, sort, and slice the list of pages is correctly implemented. Confirm that the 30-day window and the limit of 5 items meet your dashboard requirements.

🧰 Tools
🪛 LanguageTool

[style] ~186-~186: Alternatives possibles pour cet anglicisme :
Context: ...le d’élément de grille Dans le fichier src/dashboard-grid-items/MyPluginGridItem.astro, vou...

(FR_SIMPLE_REPLACE_ANGLICISM_PREMIUM_DASHBOARD)

Copy link
Copy Markdown
Member

@dreyfus92 dreyfus92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

@dreyfus92 dreyfus92 merged commit 83e197b into withstudiocms:main Apr 1, 2025
@ArmandPhilippot ArmandPhilippot deleted the i18n/fr-add-plugins branch April 1, 2025 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants