When a language already exists on the site, it’s very easy to contribute by translating individual articles. Just follow this procedure.
Note: If you don’t see the language in the “Translations” list at the top of the page, then you need to add the language; see Adding a new language for instructions.
Procedure
To create a new translated page from an existing English page:
- Copy the file from
pages/en/lb2
(orlb3
if it’s for LoopBack version 3.0) to the directory for your language; for example if you were translating filepages/en/lb2/Foo.html
to French, copy it topages/fr/lb2/Foo.html
- Edit the front matter (see example below) and make the following changes:
- Change
layout
frompage
totranslation
- Change
sidebar
fromlb2_sidebar
toxx_lb2_sidebar
wherexx
is the ISO code for your language. - Change
permalink
from/doc/en/lb2/Foo.html
to/doc/xx/lb2/Foo.html
. - Add
lang
attribute with the appropriate value.
- Change
- Start translating the content!
- Make sure your navigation sidebar
_data/sidebars/xx_lb_sidebar.yml
contains a link to your article somewhere (ideally in a logical location). - Add the
translated: true
property for the article in the sidebar file.
Front matter example
When you’re done, the page front matter should look like this:
---
title: "<<Translate the article's title from English>>"
layout: translation
trans_complete: false
sidebar: xx_lb2_sidebar
lang: ja
tags:
permalink: /doc/xx/lb2/Foo.html
summary: <<Translate or add a summary in the target language>>
---
In the example above, xx
is the ISO language code for your language (for example fr
for French, and so on).
The trans_complete
property indicates whether the page has been fully translated. If there is any untranslated (English) content remaining on the page, set this property to false
to display a notification to that effect; otherwise, omit the property.