Skip to content

Instantly share code, notes, and snippets.

@ncalm
Created July 20, 2024 20:10
Show Gist options
  • Save ncalm/9fd7d8797a01b3441e175e6dde00620b to your computer and use it in GitHub Desktop.
Save ncalm/9fd7d8797a01b3441e175e6dde00620b to your computer and use it in GitHub Desktop.
List of language codes for use with Azure AI Language Services and the Excel TRANSLATE function
let
Source = Web.BrowserContents("https://learn.microsoft.com/en-us/azure/ai-services/Translator/language-support"),
#"Extracted Table From Html" = Html.Table(Source, {{"Column1", "DIV.table-wrapper.has-inner-focus > TABLE.table.table-sm.margin-top-none > * > TR > :nth-child(1)"}, {"Column2", "DIV.table-wrapper.has-inner-focus > TABLE.table.table-sm.margin-top-none > * > TR > :nth-child(2)"}, {"Column3", "DIV.table-wrapper.has-inner-focus > TABLE.table.table-sm.margin-top-none > * > TR > :nth-child(3)"}, {"Column4", "DIV.table-wrapper.has-inner-focus > TABLE.table.table-sm.margin-top-none > * > TR > :nth-child(4)"}, {"Column5", "DIV.table-wrapper.has-inner-focus > TABLE.table.table-sm.margin-top-none > * > TR > :nth-child(5)"}, {"Column6", "DIV.table-wrapper.has-inner-focus > TABLE.table.table-sm.margin-top-none > * > TR > :nth-child(6)"}, {"Column7", "DIV.table-wrapper.has-inner-focus > TABLE.table.table-sm.margin-top-none > * > TR > :nth-child(7)"}}, [RowSelector="DIV.table-wrapper.has-inner-focus > TABLE.table.table-sm.margin-top-none > * > TR"]),
#"Changed Type" = Table.TransformColumnTypes(#"Extracted Table From Html",{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}}),
#"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Language", type text}, {"Language code", type text}, {"Cloud – Text Translation and Document Translation", type text}, {"Containers – Text Translation", type text}, {"Custom Translator", type text}, {"Auto Language Detection", type text}, {"Dictionary", type text}})
in
#"Changed Type1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment