Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
titleParameters


Section
titlekeys

The comma-separated list of I18N keys.

If no key is provided the service returns with a BAD REQUEST (HTTP code 400).


Section
titlelocale

The optional locale to use. If not provided, the context of the call defines the locale.

Typically the value is not provided so that the locale provided of the user's context is used. In case a user needs to fetch localized information by a locale that is different from its default, supply a locale of the format accepted by toLocale(String).

If a locale is specified, but invalid, the service returns with a BAD REQUEST (HTTP code 400).

Default value: The locale specified by the calling user as default.


Section
titlestrict

The boolean flag allows to control whether or not the keys must be translated literally.

If this flag is set to false, the keys may be short versions where the prefix projectdoc.doctype.common. is missing for readability.

Note Box

Users may only want to set this flag to true in case they need to actually access a label by a key that contains no dot.

Default value: false



Section
titleExamples


Section
titleJavaScript script

A typical usage scenario from a JavaScript script, where baseUrl points to the Confluence server hosting the REST service. The example assumes that jQuery is available in the context of this call.

Code Block
languagejs
titleFetch resource bundle
var i18nResult = $.ajax({
  url: baseURL + "/rest/projectdoc/1/i18n/map.json?keys=title,spaceKey,name,shortDescription,tinyUrl",
  async: false,
  contentType: 'application/json'
}).responseText;

const i18n = JSON.parse(i18nResult);

Then access the localized labels like this:

Code Block
languagejs
titleAccess resource bundle
const shortDescriptionLabel = i18n.shortDescription;



Section
titleBookmarklet

The Bookmarklets Extension provides a JavaScript function to create a synchronous call.

Code Block
languagejs
titleUsing the Bookmarklets API
const i18n = PDBMLS.fetchI18n(baseUrl, ["spaceKey", "title", "doctype", "name", "shortDescription", "absoluteUrl", "projectdoc.imageUrl", "description", "projectdoc.doctype.resource.source", "projectdoc.address.website", "projectdoc.address.twitter"]);




Section
ignore-template-buttonstrue
titleSubordinate App Components


Hide From Reader

Create from template
blueprintModuleCompleteKeyde.smartics.atlassian.confluence.smartics-doctype-addon-app:projectdoc-blueprint-doctype-app-component
buttonLabelCreate App Component

Display Table
doctypeapp-component
render-no-hits-as-blanktrue
render-modedefinition
selectName, Short Description
restrict-to-immediate-childrentrue
sort-bySort Key, Name

...