Internationalisation

As explained in the previous pages, each screen is quite customisable and configurable. When it comes to Personal details and ID details, you have noticed that the fields are wrapped within a country object by default.

On this page, we will explain how you can use a country object to have a specific customisation per country/state for different fields, which will allow you to meet different requirements for each country you want to launch for.

Country object

Countries is an array of different country objects:

AttributeDescription
countries:array of country object

And each country object starts with a country_code followed by a set of state_code:

<country_code>:{
  <state_code>:{
    ...
	},
	<state_code>:{
    ...
	},
}
AttributeDescription
country_codeThree digits country code: If not applicable, use default as the key.
state_codeState code for the specific country. If not applicable, use default as the key
`fields [ ]An array of field object

And for each state, you can have an array of data_field object. This object is a common strcuture across all the Personal and ID input fields. There are some pre-defined fields available that you can use as explained for each screen, but you can also define any custom field.

Field object

AttributeDescriptionValues
fieldType*“input”|”select”|”dob”|”address”|”phone”
name *“first_name”|”middle_name”|”last_name” | ”dob” | ”address” | ”license_number” |”card_number” | ”version_number” | “passport_number”
dataType“phone” | “email” | “individual_extra”|“document_extra” | “previous_addr” | “current_addr”
style
labeldisplayed label for the field
helperTextthe text displayed under the field for additional info
placeholderthe text displayed inside the field as a sample input
hidetrue/false

rules [not applicable to "dob" field].

AttributeDescriptionValues
required
required.valuetrue/false
required.value
minLength
minLength.valueinteger
minLength.message
maxLength
maxLength.valueinteger
regex.valuestring - regex type

/^([+-])(\d{2}):(\d{2})$/

Alphabetic → /^[A-Za-z]+$/
regex.message

options: array [applicable to "select" field]

AttributeDescriptionValues
label
value

calendar [applicable to "select" field]

AttributeDescriptionValues
calendar.type“Gregorian” | “Budhist”
local
day
day.required
month
month.required
year
year.required

age [applicable to “dob” field]

AttributeDescriptionValues
mininteger
maxinteger
message

Sample

Default countries

Default fields for all countries/states:

"countries": {
  "default": {
    "default": {
      "fields": [
          {
            "fieldType": "input"
            "name": "license_number"
            rules:{
            },
            style: {  
              ff-form-field:{} 
            }
          },
          {
            "fieldType": "input"
            "name": "card_number"
            rules:{
            },
            style: {  
              ff-form-field:{} 
            }
          }
      ],
    }
  }
}

Overwrite specific countries

Overwrite the config for specific countries/states:

"countries": {
  "AUS": {
    "VIC": {
      "fields": [
        {
          "fieldType": "input"
          "name": "license_number"
          rules:{
          },
          style: {  
            ff-form-field:{} 
          }
        },
        {
          "fieldType": "input"
          "name": "card_number"
          rules:{
          },
          style: {  
            ff-form-field:{} 
          }
        },
        {
          "fieldType": "input"
          "name": "registration_number",
          style: {  
            ff-form-field:{} 
          }
        }
      ]
    },
    "NSW": {
      "fields": [
        <data_field>
      ]
    }
  }
  "NZL": {
    "default": {
      "fields": [
        <data_field>
      ]
    }
  }
}

Use countries within documents

documents: { 
  DRIVERS_LICENSE: {
    label:
    subtitile:
    countries:{
      AUS:{
        ACT:{
          fields:[ <data_field> ],
        },
        NT:{
          fields:[ <data_field> ],
        },
        Qld:{
          fields:[ <data_field> ],
        },
        ....,
        [key in other_state]:{
          fields:[ <data_field> ],
        }
      },
      NZL:{
        default: {
          fields:[ <data_field> ],
        }
      }
    },
  },
  PASSPORT:{...},
  MEDICARE: {...},
}