diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..183a511 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## 1.0.0 - 2024-09-24 + +Initial release diff --git a/CHANGELOG.md.meta b/CHANGELOG.md.meta new file mode 100644 index 0000000..082c5b2 --- /dev/null +++ b/CHANGELOG.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e6b64fb10532606d4a90a7a996b69988 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/PhraseClient.cs b/Editor/PhraseClient.cs index 3b4a1b5..de7ca6f 100644 --- a/Editor/PhraseClient.cs +++ b/Editor/PhraseClient.cs @@ -60,12 +60,12 @@ protected override async Task SendAsync( public class PhraseClient { + private readonly string Version = "1.0.0"; + private readonly PhraseProvider Provider; private string ApiUrl => Provider.m_ApiUrl; - private string AccessToken => Provider.Token; - private HttpClient Client; [Serializable] @@ -82,14 +82,14 @@ public override string ToString() } [Serializable] - public class Account + public struct Account { public string id; public string name; } [Serializable] - public class Project + public struct Project { public string id; public string name; @@ -102,7 +102,7 @@ public class Screenshot public string id; public string screenshot_url; } - + public class ScreenshotMarker { public string id; @@ -120,7 +120,7 @@ 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/1.0"); + Client.DefaultRequestHeaders.Add("User-Agent", $"Unity Plugin/{Version}"); Client.BaseAddress = new Uri(ApiUrl); } diff --git a/Editor/PhraseProvider.cs b/Editor/PhraseProvider.cs index 57f7d54..925b9a3 100644 --- a/Editor/PhraseProvider.cs +++ b/Editor/PhraseProvider.cs @@ -44,13 +44,13 @@ public partial class PhraseProvider : ScriptableObject public string m_ApiKey; - public List Projects { get; private set; } = new List(); + public List Projects = new(); - public List Locales { get; private set; } = new List(); + public List Locales = new(); - public List LocaleIdsToPull { get; private set; } = new List(); + public List LocaleIdsToPull = new(); - public List LocaleIdsToPush { get; private set; } = new List(); + public List LocaleIdsToPush = new(); public string m_selectedAccountId = null; @@ -900,6 +900,7 @@ private void TogglePhraseExtension(StringTableCollection collection, bool select collection.RemoveExtension(extension); } } + EditorUtility.SetDirty(collection); } private string GetLoadingMessage() diff --git a/README.md b/README.md index 14cec4c..0b9b078 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,9 @@ as a dependency, if not already installed. If you want to contribute, check out this project directly into `Packages` directory of your project and rename the package directory to `com.phrase.plugin`. You can also create a symlink to it instead. + +### Publishing a new release + +* Increase version number in `package.json` and `Editor/PhraseClient.cs` +* Update `CHANGELOG.md` +* Publish the release on the Asset Store