Created
January 3, 2020 10:40
-
-
Save jacob-jonkman/eddeddb815b968c9a8e86ad8d26172d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function constructTranslationsperLanguage(project_id: string): Promise<any> { | |
const translations = {}; | |
return request(listLanguagesOptions) | |
.then(response => JSON.parse(response).result.languages.map(lang => lang['code'])) | |
.then(languages => { | |
return Promise.all(languages.map(lang => { | |
listTermsOptions.formData.language = lang; | |
listTermsOptions.formData.id = project_id; | |
return constructTranslationsForLanguage(lang, translations) | |
})) | |
}) | |
.then(() => translations) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment