Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Editor/PhraseClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ public PhraseClient(PhraseProvider provider)
{
this.Provider = provider;
this.Client = new HttpClient(new RetryHandler(new HttpClientHandler(), provider));
// Client.DefaultRequestHeaders.Add("Authorization", "Bearer " + AccessToken);
Client.DefaultRequestHeaders.Add("User-Agent", $"Unity Plugin/{Version}");
Client.BaseAddress = new Uri(ApiUrl);
}
Expand Down
14 changes: 8 additions & 6 deletions Editor/PhraseProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ public IEnumerator FetchProjectsAsync()
public void FetchProjects()
{
EditorCoroutineUtility.StartCoroutineOwnerless(FetchProjectsAsync());
// FetchLocales();
}

public IEnumerator FetchLocalesAsync()
Expand Down Expand Up @@ -271,7 +270,6 @@ public IEnumerator PushAll(List<StringTableCollection> collections)
var matchingStringTable = collection.StringTables.FirstOrDefault(st => st.LocaleIdentifier.Code == locale.code);
if (matchingStringTable == null)
{
// Debug.LogError("No matching string table found for locale " + locale.code);
break;
}
const string dir = "Temp/";
Expand All @@ -289,7 +287,6 @@ public IEnumerator PushAll(List<StringTableCollection> collections)
collectionsIndex++;
}
EditorUtility.ClearProgressBar();
// EditorUtility.DisplayDialog("Push complete", $"{count} locale(s) from {collections.Count} table collection(s) pushed.", "OK");
}

public void PullAll()
Expand Down Expand Up @@ -576,7 +573,7 @@ private void ShowLocalLocaleMissingSection()
if (phraseProvider.MissingLocalesLocally().Count > 0)
{
EditorGUILayout.BeginHorizontal();
GUILayout.Label("Locales missing in Unity");
GUILayout.Label("Missing in Unity");
if(GUILayout.Button($"{selectedLocalesToCreateLocally.Count}/{phraseProvider.MissingLocalesLocally().Count} selected", GUILayout.Width(150)))
{
m_showLocalLocalesMissing = !m_showLocalLocalesMissing;
Expand Down Expand Up @@ -658,7 +655,7 @@ private void ShowRemoteLocaleMissingSection()
{
EditorGUI.indentLevel++;
EditorGUILayout.BeginHorizontal();
GUILayout.Label("Locales missing in Phrase");
GUILayout.Label("Missing in Phrase");
if(GUILayout.Button($"{selectedLocalesToCreateRemotely.Count}/{phraseProvider.MissingLocalesRemotely().Count} selected", GUILayout.Width(150)))
{
m_showRemoteLocalesMissing = !m_showRemoteLocalesMissing;
Expand Down Expand Up @@ -742,11 +739,17 @@ private void ShowConnectedTablesSection()
{
var extension = collection.Extensions.FirstOrDefault(e => e is PhraseExtension) as PhraseExtension;
bool selectedState = extension != null && extension.m_provider != null;
EditorGUILayout.BeginHorizontal();
bool newSelectedState = EditorGUILayout.ToggleLeft(collection.name, selectedState);
if (GUILayout.Button("Go to", GUILayout.Width(50)))
{
Selection.activeObject = collection;
}
if (newSelectedState != selectedState)
{
TogglePhraseExtension(collection, newSelectedState);
}
EditorGUILayout.EndHorizontal();
}
}
EditorGUI.indentLevel--;
Expand Down Expand Up @@ -793,7 +796,6 @@ private void ShowPushSection()
if (GUILayout.Button("Push to Phrase", GUILayout.Width(150)))
{
EditorCoroutineUtility.StartCoroutineOwnerless(phraseProvider.PushAll(PhraseProvider.ConnectedStringTableCollections()));
// phraseProvider.PushAll();
}

EditorGUILayout.EndHorizontal();
Expand Down