xrpl-dev-portal icon indicating copy to clipboard operation
xrpl-dev-portal copied to clipboard

Redocly i18n

Open tequdev opened this issue 1 year ago • 1 comments

Some pages currently use redocly's (internally i18next?) useTranslate() to translate content. This does not allow the use of html tags inside strings.

For example, in the following, the order of the two strings is fixed and does not match the order of the strings when translated into Japanese.

{translate('The Blockchain')}
<br className="until-sm" />
{translate('Built for Business')}

(Japanese word order)

{translate('Built for Business')}
<br className="until-sm" />
{translate('The Blockchain')}

If we can use react-i18next's <Trans /> instead, you can write the following, which allows you to freely change the order of strings within a single sentence.

<Trans i18nKey="home.titile">The Blockchain <br className="until-sm" /> Built for Business</Trans>

Since redocly does not seem to support Trans, we may need to consider other methods.

tequdev avatar Feb 28 '24 05:02 tequdev

Also, the following sections outside of the default function cannot be translated.

export const frontmatter = {
  seo: {
    title: 'Dev Tools',
    description: "Use these tools to explore, build, and test XRP Ledger technology.",
  }
};

tequdev avatar Mar 12 '24 03:03 tequdev