Open matalve opened 12 months ago
I've registered the project with an Open source license at POEditor to solve bullet 1: https://poeditor.com/join/project/P7N0JxV3wI Need to add link to page footer as well.
Added the terms and English translation with this Powershell script (solving bullet 2):
$urlBase = "https://api.poeditor.com/v2/"
$Method = "POST"
$Header = @{"Content-Type" = "application/x-www-form-urlencoded"}
$apiToken = "<tokenhex>"
$projectID = "654073"
$jsonInput = Get-Content 'C:\<path>\flagfilter\flaginfo.json' | Out-String | ConvertFrom-Json
foreach ($flag in $jsonInput) {
$termTags = $flag.shortname + "_tags"
$termName = $flag.shortname + "_name"
$termSymbolism = $flag.shortname + "_symbolism"
$termFunfacts = $flag.shortname + "_funfacts"
$tags = $flag.tags -replace "flagobject ", ""
$jsonArrayTerms = @(@{ "term" = $termTags }, @{ "term" = $termName }, @{ "term" = $termSymbolism }, @{ "term" = $termFunfacts }) | ConvertTo-Json -Compress
$Body = @{
api_token = $apiToken
id = $projectID
data = $jsonArrayTerms
}
$uri = $urlBase + "terms/add"
Invoke-WebRequest -Uri $uri -Method $Method -Headers $Header -Body $Body
Start-Sleep -Milliseconds 400
$translationTags = @{ "content" = $tags}
$translationName = @{ "content" = $flag.name}
$translationSymbolism = @{ "content" = $flag.symbolism}
$translationFunfacts = @{ "content" = $flag.funfacts}
$jsonArrayTranslate = @(@{ "term" = $termTags; "translation" = $translationTags }, @{ "term" = $termName; "translation" = $translationName }, @{ "term" = $termSymbolism; "translation" = $translationSymbolism }, @{ "term" = $termFunfacts; "translation" = $translationFunfacts }) | ConvertTo-Json -Compress
$Body = @{
api_token = $apiToken
id = $projectID
language = "en"
data = $jsonArrayTranslate
}
$uri = $urlBase + "translations/add"
Invoke-WebRequest -Uri $uri -Method $Method -Headers $Header -Body $Body
Start-Sleep -Milliseconds 400
}
This requires:
Using a Translation service, I guess crowdsourcedUploading terms to translation service