-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ability for JSON/XLIFF conversion and Push/Pull from Transifex #23281
Conversation
…on->xlf->json parsing.
…on->xlf->json parsing.
…on->xlf->json parsing.
…on->xlf->json parsing.
@michelkaporin, thanks for your PR! By analyzing the history of the files in this pull request, we identified @egamma and @alexandrudima to be potential reviewers. |
@michelkaporin, |
@@ -85,6 +299,26 @@ const iso639_3_to_2: Map<string> = { | |||
'trk': 'tr' | |||
}; | |||
|
|||
const iso639_2_to_3: Map<string> = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to consider using 2 letter id in the future. The reason why we have this mapping is that MS internally uses 3. If all is public we could switch over to 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created #23919 for it.
build/lib/i18n.ts
Outdated
promise = createResource(project, slug, file, apiHostname, credentials); | ||
} | ||
updateCreatePromises.push(promise); | ||
}).catch((reason) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not a gulp expert either but I think this simply logs something to the console but the gulp stream says in tact and the build will look like it passed. We have to ensure that in the cause of exceptions talking to Transifex this can be observed as a failing build from the outside.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made the pipeline to fail whenever we have any parsing or Transifex push/pull errors.
'ita': 'CP1252' | ||
}; | ||
|
||
export function createIslFile(base: string, originalFilePath: string, messages: Map<string>, language: string): File { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you consider that for the ISL we only need to push ch* and kor. For all other languages we have translations. Or is this not possible since languages are defined by a Transifex project. If so we might want to consider not pushing the Default.isl to Transifex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should consider a vscode-setup project to control better to which languages we need the Default.isl translated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vscode-setup project was created on Transifex, the code amended correspondingly, so that we now pull only ch* and kor languages.
…failures in parsing or in communication with Transifex.
…oduced language parameter for pulling XLFs.
It's ok for me to merge. |
Wrote a JSON->XLIFF parser tackling #22092, and implemented XLIFFs push/pull of translations using Transifex API for #22070