Skip to content

Commit

Permalink
Update README, add CHANGELOG (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
jablan authored Sep 24, 2024
1 parent bd5bec9 commit 76298c3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 1.0.0 - 2024-09-24

Initial release
7 changes: 7 additions & 0 deletions CHANGELOG.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Editor/PhraseClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ protected override async Task<HttpResponseMessage> 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]
Expand All @@ -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;
Expand All @@ -102,7 +102,7 @@ public class Screenshot
public string id;
public string screenshot_url;
}

public class ScreenshotMarker
{
public string id;
Expand All @@ -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);
}

Expand Down
9 changes: 5 additions & 4 deletions Editor/PhraseProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ public partial class PhraseProvider : ScriptableObject

public string m_ApiKey;

public List<Project> Projects { get; private set; } = new List<Project>();
public List<Project> Projects = new();

public List<Locale> Locales { get; private set; } = new List<Locale>();
public List<Locale> Locales = new();

public List<string> LocaleIdsToPull { get; private set; } = new List<string>();
public List<string> LocaleIdsToPull = new();

public List<string> LocaleIdsToPush { get; private set; } = new List<string>();
public List<string> LocaleIdsToPush = new();

public string m_selectedAccountId = null;

Expand Down Expand Up @@ -900,6 +900,7 @@ private void TogglePhraseExtension(StringTableCollection collection, bool select
collection.RemoveExtension(extension);
}
}
EditorUtility.SetDirty(collection);
}

private string GetLoadingMessage()
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 76298c3

Please sign in to comment.