Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.
Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.

VIDEO – Fully Automatic Page Translation with SPO, Azure Fn, PNP, and Cognitive Services

Wanted to share video demo of the configuration, testing, and debug for ASPX Page Translation of “flat” text modern content leveraging SharePoint Online (SPO), Azure Functions (Fn), PowerShell PNP, and Azure Cognitive Services.

Now users create Modern SPO pages with embedded text and simply click Microsoft “convert” to languages button. Background job handles Translation API for text updates.

Key technical design components are:

  1. SPO Modern page source text
  2. SPO site settings > Enable multi-language
  3. Azure Translation API
  4. Azure Function PowerShell
  5. MS Flow to automatically execute Azure Function

Comments and suggestions always welcome. Cheers.

VIDEO

SCREENSHOT

CODE

AZURE FUNCTION KUDU

# This file enables modules to be automatically managed by the Functions service.
# See https://aka.ms/functionsmanageddependency for additional information.
#
@{
    # For latest supported version, go to 'https://www.powershellgallery.com/packages/Az'. 
    # To use the Az module in your function app, please uncomment the line below.
    # 'Az' = '7.*'
    
    'PNP.PowerShell' = '1.*'
}

MS FLOW COMPOSE

replace(replace(triggerBody()?['{Path}'], 'SitePages',''),'/','')

MS FLOW COMPOSE2

{
  "siteURL": "https://spjeff.sharepoint.com/sites/portal",
  "language": "@{outputs('Compose')}",
  "pageTitle": "@{triggerOutputs()?['body/{Name}']}"
}

REFERENCES

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲