Skip to content

Commit e6bce8b

Browse files
authored
Use locale name when pushing to Phrase (#28)
1 parent 2a269c1 commit e6bce8b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Editor/PhraseClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public async void UpdateProjectsList(List<Project> projects)
173173
} while (currentBatch.Count == 100); // Continue if a full batch is returned
174174
}
175175

176-
public async void UploadFile(string path, string projectID, string localeID, string localeCode, bool autoTranslate, string tag)
176+
public async void UploadFile(string path, string projectID, string localeID, string localeName, bool autoTranslate, string tag)
177177
{
178178
string url = string.Format("projects/{0}/uploads", projectID);
179179
NameValueCollection nvc = new NameValueCollection
@@ -182,7 +182,7 @@ public async void UploadFile(string path, string projectID, string localeID, str
182182
{ "file_format", "csv" },
183183
{ "update_descriptions", "true" },
184184
{ "update_translations", "true" },
185-
{ $"locale_mapping[{localeCode}]", "4" },
185+
{ $"locale_mapping[{localeName}]", "4" },
186186
{ "format_options[key_index]", "1" },
187187
{ "format_options[comment_index]", "2" },
188188
{ "format_options[max_characters_allowed_column]", "3" },

Editor/PhraseProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public IEnumerator PushAll(List<StringTableCollection> collections)
275275
string keyPrefix = phraseExtension.m_identifierType == TableIdentifierType.KeyPrefix ? phraseExtension.m_identifier : null;
276276
Csv.Export(stream, collection, ColumnMappings(locale, keyPrefix));
277277
}
278-
Client.UploadFile(path, m_selectedProjectId, locale.id, locale.code, false, tag);
278+
Client.UploadFile(path, m_selectedProjectId, locale.id, locale.name, false, tag);
279279
if (File.Exists(path)) File.Delete(path);
280280
}
281281
}
@@ -299,7 +299,7 @@ private List<CsvColumns> ColumnMappings(Locale locale, string keyPrefix)
299299
},
300300
new LocaleColumns {
301301
LocaleIdentifier = locale.code,
302-
FieldName = locale.code
302+
FieldName = locale.name
303303
},
304304
};
305305
}

0 commit comments

Comments
 (0)