Skip to content
Merged
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
15 changes: 14 additions & 1 deletion Editor/PhraseProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ public partial class PhraseProvider : ScriptableObject

private PhraseClient Client => new PhraseClient(this);

void OnEnable()
{
LocalizationSettings.InitializationOperation.WaitForCompletion();
}

private string StringsAppHost
{
get
Expand Down Expand Up @@ -131,6 +136,7 @@ public IEnumerator FetchProjectsAsync()
yield return new WaitForEndOfFrame();

Client.UpdateProjectsList(Projects);
EditorUtility.SetDirty(this);
IsLoadingProjects = false;
}

Expand All @@ -151,6 +157,7 @@ public IEnumerator FetchLocalesAsync()
Client.UpdateLocalesList(m_selectedProjectId, Locales);
LocalizationSettings.InitializationOperation.WaitForCompletion();
LocaleIdsToPull.Clear();
EditorUtility.SetDirty(this);
IsLoadingLocales = false;
}

Expand Down Expand Up @@ -597,7 +604,7 @@ private void ShowLocalLocaleMissingSection()
continue;
}
UnityEngine.Localization.Locale newLocale = UnityEngine.Localization.Locale.CreateLocale(locale.code);
AssetDatabase.CreateAsset(newLocale, $"{pathToSave}/{newLocale.ToString()}.asset");
AssetDatabase.CreateAsset(newLocale, $"{pathToSave}/{newLocale}.asset");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain this change? Was it not needed at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, that's not needed, as string interpolation implicitly does ToString(). VS code gives a lot of these linting hints.

count++;
}
LocalizationSettings.InitializationOperation.WaitForCompletion();
Expand Down Expand Up @@ -801,6 +808,7 @@ private void ShowPushSection()
phraseProvider.LocaleIdsToPush.Clear();
phraseProvider.LocaleIdsToPush.AddRange(filteredLocales.Select(l => l.Identifier.Code));
selectedAllLocalesToPush = true;
EditorUtility.SetDirty(target);
}
}
else
Expand All @@ -809,6 +817,7 @@ private void ShowPushSection()
{
phraseProvider.LocaleIdsToPush.Clear();
selectedAllLocalesToPush = false;
EditorUtility.SetDirty(target);
}
}

Expand All @@ -828,6 +837,7 @@ private void ShowPushSection()
selectedAllLocalesToPush = false;
phraseProvider.LocaleIdsToPush.Remove(locale.Identifier.Code);
}
EditorUtility.SetDirty(target);
}
}
}
Expand Down Expand Up @@ -859,6 +869,7 @@ private void ShowPullSection()
phraseProvider.LocaleIdsToPull.Clear();
phraseProvider.LocaleIdsToPull.AddRange(phraseProvider.AvailableLocalesLocally().Select(l => l.id));
selectedAllLocalesToPull = true;
EditorUtility.SetDirty(target);
}
}
else
Expand All @@ -867,6 +878,7 @@ private void ShowPullSection()
{
phraseProvider.LocaleIdsToPull.Clear();
selectedAllLocalesToPull = false;
EditorUtility.SetDirty(target);
}
}

Expand All @@ -885,6 +897,7 @@ private void ShowPullSection()
selectedAllLocalesToPull = false;
phraseProvider.LocaleIdsToPull.Remove(locale.id);
}
EditorUtility.SetDirty(target);
}
}
EditorGUI.indentLevel--;
Expand Down