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.
To create a new translated page from an existing English page:
- Copy the file from
lb3if it’s for LoopBack version 3.0) to the directory for your language; for example if you were translating file
pages/en/lb2/Foo.htmlto French, copy it to
- Edit the front matter (see example below) and make the following changes:
xxis the ISO code for your language.
langattribute with the appropriate value.
- Start translating the content!
- Make sure your navigation sidebar
_data/sidebars/xx_lb_sidebar.ymlcontains a link to your article somewhere (ideally in a logical location).
- Add the
translated: trueproperty 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).
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.