Application Packaging Standard

Last updated 18-Mar-2019

Multi-Language String

The I18n APS type is used in other APS types to have some properties support translation to various languages.

The schema file: download

{
  "apsVersion": "2.0",

  "id": "http://aps-standard.org/types/core/i18n/1.0",
  "name": "I18n",

  "structures": {
    "MLString": {
      "type": "object",
      "properties": {
        "ar_AE": { "type": "string", "description": "Arabic, Standard - United Arab Emirates" },
        "bg_BG": { "type": "string", "description": "Bulgarian - Bulgaria" },
        "cs_CZ": { "type": "string", "description": "Czech - Czech Republic" },
        "da_DK": { "type": "string", "description": "Danish - Denmark" },
        "de_DE": { "type": "string", "description": "German - Germany" },
        "el_GR": { "type": "string", "description": "Greek - Greece" },
        "en_US": { "type": "string", "description": "English - United States" },
        "es_ES": { "type": "string", "description": "Spanish - Spain" },
        "fr_FR": { "type": "string", "description": "French - France" },
        "he_IL": { "type": "string", "description": "Hebrew - Israel" },
        "hr_HR": { "type": "string", "description": "Croatian - Croatia" },
        "hu_HU": { "type": "string", "description": "Hungarian - Hungary" },
		"id_ID": { "type": "string", "description": "Indonesian - Indonesia" },
        "it_IT": { "type": "string", "description": "Italian - Italy" },
        "ja_JP": { "type": "string", "description": "Japanese - Japan" },
        "ko_KR": { "type": "string", "description": "Korean - Korea" },
        "kz_KZ": { "type": "string", "description": "Kazakh - Kazakhstan" },
        "nl_NL": { "type": "string", "description": "Dutch - The Netherlands" },
        "no_NO": { "type": "string", "description": "Norwegian - Norway" },
        "pl_PL": { "type": "string", "description": "Polish - Poland" },
        "pt_BR": { "type": "string", "description": "Portuguese - Brazil" },
        "pt_PT": { "type": "string", "description": "Portuguese - Portugal" },
        "ro_RO": { "type": "string", "description": "Romanian - Romania" },
        "ru_RU": { "type": "string", "description": "Russian - Russia" },
        "sv_SE": { "type": "string", "description": "Swedish - Sweden" },
        "th_TH": { "type": "string", "description": "Thai - Thailand" },
        "tr_TR": { "type": "string", "description": "Turkish - Turkey" },
        "zh_CN": { "type": "string", "description": "Chinese, Simplified - China" },

		"xx_XA": { "type": "string", "description": "Reserved 1" },
		"xx_XB": { "type": "string", "description": "Reserved 2" },
		"xx_XC": { "type": "string", "description": "Reserved 3" },
		"xx_XD": { "type": "string", "description": "Reserved 4" },
		"xx_XE": { "type": "string", "description": "Reserved 5" },
		"xx_XF": { "type": "string", "description": "Reserved 6" },
		"xx_XG": { "type": "string", "description": "Reserved 7" },
		"xx_XH": { "type": "string", "description": "Reserved 8" },
		"xx_XI": { "type": "string", "description": "Reserved 9" },
		"xx_XJ": { "type": "string", "description": "Reserved 10" }
      }
    }
  }
}

This APS type contains only the MLString structure that is used in other APS types as a property type. In the following example, an APS type contains two properties of the MLString type:

{
   "id": "http://aps-standard.org/samples/vpscloud/vps/1.0",
   "name": "Cloud VPS",
   "properties": {
      "name": {
         "type": "http://aps-standard.org/types/core/i18n/1.0#MLString"
      },
      "description": {
         "type": "http://aps-standard.org/types/core/i18n/1.0#MLString"
      }
   }
}

To assign translated values to the VPS name and description properties declared in the above example, an actor sends respectively a POST (create a resource) or PUT (update a resource) request similar to the following:

POST /aps/2/resources/

{
   "aps": {
   "type": "http://aps-standard.org/samples/vpscloud/vps/1.0"
   },
   "name": {
      "en_US": "Developer's portal",
      "ru_RU": "Портал для разработчика"
   },
   "description": {
      "en_US": "Integration concepts, API reference, and Getting Started",
      "ru_RU": "Концепции интеграции, справочные данные и руководство для начинающих"
   }
}
DNS