elviswolcott / remark-admonitions

Add admonitions support to Remarkable
MIT License
110 stars 19 forks source link

Translate admonition keyword #35

Closed slorber closed 2 years ago

slorber commented 3 years ago

Hi, Docusaurus maintainer here.

As we now support i18n, we need to be able to localize the keywords.

:::caution 

Must lead to "Attention" for the fr locale.

We don't necessarily want Docusaurus users to add an explicit title, nor to localize the admonition keyword (ie not :::attention), just being able to localize the default title.

See also https://github.com/facebook/docusaurus/issues/4542#issuecomment-832898463

Was also wondering if you'd be interested to move this package to a new docusaurus org, as I think it's only used with Docusaurus (according to npm stats) and that would help for maintenance.

elviswolcott commented 3 years ago

I'd definitely be willing to transfer this repo to the docusaurus org. I unfortunately don't have much time to do OSS stuff right now due to classes, so that would be a much better arrangement!

slorber commented 3 years ago

Thanks, FYI we are likely to create a docusaurus org or at least a separate community repo, will let you know when that happens

ahreenah commented 2 years ago

Hi! Has anybody came up with solution on how to properly translate admonition title now?

xiaogaozi commented 2 years ago

So far, you could use an explicit title:

:::caution Some title
Test test test
:::

The rendering result is:

image

slorber commented 2 years ago

For Docusaurus users, we have moved to a different admonition setup, always using our own theme component instead of hardcoded JSX markup, which gives us more flexibility: https://github.com/facebook/docusaurus/pull/7152

This allows translating admonitions in our theme component directly: https://github.com/facebook/docusaurus/pull/7556

Going to close, assuming most users reporting here are using Docusaurus