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:
- SPO Modern page source text
- SPO site settings > Enable multi-language
- Azure Translation API
- Azure Function PowerShell
- 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
- https://tech.nicolonsky.ch/azure-functions-powershell-modules/
- https://michalsacewicz.com/automatically-translate-news-on-multilingual-sharepoint-sites/
- https://support.microsoft.com/en-us/office/create-multilingual-communication-sites-pages-and-news-2bb7d610-5453-41c6-a0e8-6f40b3ed750c
- https://docs.microsoft.com/en-us/azure/cognitive-services/translator/reference/v3-0-reference
- https://stackoverflow.com/questions/61061357/azure-tranlate-api-call-is-returning-and-40100