mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
Fixed language codes for build process.
This commit is contained in:
@@ -219,8 +219,8 @@ var vscodeLanguages = [
|
||||
'ita'
|
||||
];
|
||||
var iso639_3_to_2 = {
|
||||
'chs': 'zh-hans',
|
||||
'cht': 'zh-hant',
|
||||
'chs': 'zh-cn',
|
||||
'cht': 'zh-tw',
|
||||
'csy': 'cs-cz',
|
||||
'deu': 'de',
|
||||
'enu': 'en',
|
||||
@@ -238,6 +238,9 @@ var iso639_3_to_2 = {
|
||||
'sve': 'sv-se',
|
||||
'trk': 'tr'
|
||||
};
|
||||
/**
|
||||
* Used to map Transifex to VS Code language code representation.
|
||||
*/
|
||||
var iso639_2_to_3 = {
|
||||
'zh-hans': 'chs',
|
||||
'zh-hant': 'cht',
|
||||
@@ -878,7 +881,7 @@ function retrieveResource(language, resource, apiHostname, credentials) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
var slug = resource.name.replace(/\//g, '_');
|
||||
var project = resource.project;
|
||||
var iso639 = iso639_3_to_2[language];
|
||||
var iso639 = language.toLowerCase();
|
||||
var options = {
|
||||
hostname: apiHostname,
|
||||
path: "/api/2/project/" + project + "/resource/" + slug + "/translation/" + iso639 + "?file&mode=onlyreviewed",
|
||||
@@ -890,7 +893,7 @@ function retrieveResource(language, resource, apiHostname, credentials) {
|
||||
res.on('data', function (data) { return xlfBuffer += data; });
|
||||
res.on('end', function () {
|
||||
if (res.statusCode === 200) {
|
||||
resolve(new File({ contents: new Buffer(xlfBuffer), path: project + "/" + language + "/" + slug + ".xlf" }));
|
||||
resolve(new File({ contents: new Buffer(xlfBuffer), path: project + "/" + iso639_2_to_3[language] + "/" + slug + ".xlf" }));
|
||||
}
|
||||
reject(slug + " in " + project + " returned no data. Response code: " + res.statusCode + ".");
|
||||
});
|
||||
@@ -909,7 +912,7 @@ function prepareJsonFiles() {
|
||||
var messages = file.messages, translatedFile;
|
||||
// ISL file path always starts with 'build/'
|
||||
if (file.originalFilePath.startsWith('build/')) {
|
||||
var defaultLanguages = { 'zh-cn': true, 'zh-tw': true, 'ko': true };
|
||||
var defaultLanguages = { 'zh-hans': true, 'zh-hant': true, 'ko': true };
|
||||
if (path.basename(file.originalFilePath) === 'Default' && !defaultLanguages[file.language]) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user