Conversation
| return <nav className="pagination-nav" aria-label="Blog list page navigation"> | ||
| <div className="pagination-nav__item pagination-nav__item--next"> | ||
| {nextPage && <Link className="pagination-nav__link" to={nextPage}> | ||
| <div className="pagination-nav__label">« مطالب قدیمی تر</div> |
| </div> | ||
| <div className="pagination-nav__item"> | ||
| {previousPage && <Link className="pagination-nav__link" to={previousPage}> | ||
| <div className="pagination-nav__label">مطالب جدید تر »</div> |
| return <nav className="pagination-nav" aria-label="Blog post page navigation"> | ||
| <div className="pagination-nav__item"> | ||
| {prevItem && <Link className="pagination-nav__link" to={prevItem.permalink}> | ||
| <div className="pagination-nav__sublabel">پست بعدی</div> |
| </div> | ||
| <div className="pagination-nav__item pagination-nav__item--next"> | ||
| {nextItem && <Link className="pagination-nav__link" to={nextItem.permalink}> | ||
| <div className="pagination-nav__sublabel">پست قبلی</div> |
| <BlogSidebar sidebar={sidebar} /> | ||
| </div> | ||
| <main className="col col--8"> | ||
| <h1>برچسب ها</h1> |
| return <nav className="pagination-nav" aria-label="Blog list page navigation"> | ||
| <div className="pagination-nav__item"> | ||
| {metadata.previous && <Link className="pagination-nav__link" to={metadata.previous.permalink}> | ||
| <div className="pagination-nav__sublabel">قبلی</div> |
| @@ -0,0 +1,150 @@ | |||
| { | |||
There was a problem hiding this comment.
Use this file to override default Docusaurus labels without swizzling the components
| import useBaseUrl from '@docusaurus/useBaseUrl'; | ||
| import Seo from '@theme/Seo'; | ||
| import styles from './styles.module.css'; | ||
| const MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; |
There was a problem hiding this comment.
FYI I "reswizzled" the component to update it to latest Docusaurus code (which is using prettier for better js code formatting now)
So most of the changes here are related to formatting and updated Docusaurus code
| @@ -58,54 +61,81 @@ function BlogPostItem(props) { | |||
| </time> | |||
There was a problem hiding this comment.
Not yet translated by Docusaurus, so kept your translated label here
| @@ -36,18 +34,29 @@ function BlogTagsPostPage(props) { | |||
| {count} پست با برچسب "{tagName} | |||
There was a problem hiding this comment.
not yet translated, so kept it in Farsi
| import BlogPostItem from '@theme/BlogPostItem'; | ||
| import Link from '@docusaurus/Link'; | ||
| import BlogSidebar from '@theme/BlogSidebar'; | ||
| import Translate from '@docusaurus/Translate'; |
There was a problem hiding this comment.
Component also reswizzled to update it and format it
| <Translate | ||
| id="theme.tags.tagsPageLink" | ||
| description="The label of the link targeting the tag list page"> | ||
| View All Tags |
There was a problem hiding this comment.
now correctly translated by docusaurus
| <Translate | ||
| id="theme.blog.post.readMore" | ||
| description="The label used in blog post item excerpts to link to full blog posts"> | ||
| Read More |
There was a problem hiding this comment.
correctly translated by docusaurus
| <Translate | ||
| id="theme.tags.tagsListLabel" | ||
| description="The label alongside a tag list"> | ||
| Tags: |
There was a problem hiding this comment.
correctly translated by docusaurus
| * LICENSE file in the root directory of this source tree. | ||
| */ | ||
| import React from 'react'; | ||
| import Head from '@docusaurus/Head'; |
| <div className="col text--right"> | ||
| <em> | ||
| <small> | ||
| {/* TODO: wait for using interpolation in translation function */} |
There was a problem hiding this comment.
not translated yet (but unused?)
|
@massoudmaboudi ready for a first review I think if you could move the DocItem CSS changes to the custom.css file using the technique I mentioned in this PR, we could delete the DocItem comp entirely? |
|
|
||
| .codeBlockContent { | ||
| direction: ltr !important; | ||
| } |
There was a problem hiding this comment.
can be removed, forced LTR by default for code blocks
|
sweet is this deployed live? |
|
@massoudmaboudi can you please talk to me on discord asap? Would like to feature your site for the i18n release tomorrow! |

Trying to remove what can be removed :)
You can override the default fa translations provided by docusaurus by editing
i18n/fa_IR/code.json.You can "regenerate" this file by running
npm run translate:fa(it may write other files to translate as well but they are not necessary in your case as your homepage has hardcoded Farsi text that you don't need to translate.Note, you can use custom.css to target css module classes (with a generated classname) without swizzling, by using this trick:
I think it's better because you won't have to duplicate/maintain the full JS version and can just provide CSS overrrides
Note: Docusaurus currently does not translate some "dynamic/interpolated strings" (will be implemented later):