Skip to content

Commit

Permalink
feat: add generate openai api key button to configs
Browse files Browse the repository at this point in the history
  • Loading branch information
lokinmodar committed Aug 4, 2024
1 parent 2402274 commit 848a7a3
Show file tree
Hide file tree
Showing 25 changed files with 100 additions and 2 deletions.
1 change: 1 addition & 0 deletions Echoglossian.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ public Echoglossian()

// Disabling BattleTalk translation by default if the language is not supported by the game font while we fix the overlays
this.configuration.TranslateBattleTalk = this.configuration.OverlayOnlyLanguage ? false : true;
this.configuration.UseImGuiForBattleTalk = false;
}

/// <inheritdoc />
Expand Down
5 changes: 5 additions & 0 deletions Echoglossian.xml

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

4 changes: 4 additions & 0 deletions MultilingualResources/Echoglossian.da.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,10 @@
<source>Settings for ChatGPT</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Indstillinger for ChatGPT</target>
</trans-unit>
<trans-unit id="ChatGPTAPIKeyLink" translate="yes" xml:space="preserve">
<source>Click here to create a OpenAi API Key</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Klik her for at oprette en OpenAi API-nøgle</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions MultilingualResources/Echoglossian.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,10 @@
<source>Settings for ChatGPT</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Einstellungen für ChatGPT</target>
</trans-unit>
<trans-unit id="ChatGPTAPIKeyLink" translate="yes" xml:space="preserve">
<source>Click here to create a OpenAi API Key</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Klicken Sie hier, um einen OpenAi API-Schlüssel zu erstellen</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions MultilingualResources/Echoglossian.el.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@
<source>Settings for ChatGPT</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Ρυθμίσεις για το ChatGPT</target>
</trans-unit>
<trans-unit id="ChatGPTAPIKeyLink" translate="yes" xml:space="preserve">
<source>Click here to create a OpenAi API Key</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Κάντε κλικ εδώ για να δημιουργήσετε ένα κλειδί API OpenAi</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions MultilingualResources/Echoglossian.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,10 @@
<source>Settings for ChatGPT</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Configuración de ChatGPT</target>
</trans-unit>
<trans-unit id="ChatGPTAPIKeyLink" translate="yes" xml:space="preserve">
<source>Click here to create a OpenAi API Key</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Haga clic aquí para crear una clave API de OpenAi</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions MultilingualResources/Echoglossian.eu.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@
<source>Settings for ChatGPT</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">ChatGPTren konfigurazioa</target>
</trans-unit>
<trans-unit id="ChatGPTAPIKeyLink" translate="yes" xml:space="preserve">
<source>Click here to create a OpenAi API Key</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Egin klik hemen OpenAi-ren API klabe bat sortzeko</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions MultilingualResources/Echoglossian.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,10 @@
<source>Settings for ChatGPT</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Paramètres pour ChatGPT</target>
</trans-unit>
<trans-unit id="ChatGPTAPIKeyLink" translate="yes" xml:space="preserve">
<source>Click here to create a OpenAi API Key</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Cliquez ici pour créer une clé API OpenAi</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions MultilingualResources/Echoglossian.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@
<source>Settings for ChatGPT</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Impostazioni per ChatGPT</target>
</trans-unit>
<trans-unit id="ChatGPTAPIKeyLink" translate="yes" xml:space="preserve">
<source>Click here to create a OpenAi API Key</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Clicca qui per creare una chiave API OpenAi</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions MultilingualResources/Echoglossian.pt-BR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,10 @@
<source>Settings for ChatGPT</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Configurações para ChatGPT</target>
</trans-unit>
<trans-unit id="ChatGPTAPIKeyLink" translate="yes" xml:space="preserve">
<source>Click here to create a OpenAi API Key</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Clique aqui para criar uma chave de API OpenAi</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions MultilingualResources/Echoglossian.pt.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@
<source>Settings for ChatGPT</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Configurações para ChatGPT</target>
</trans-unit>
<trans-unit id="ChatGPTAPIKeyLink" translate="yes" xml:space="preserve">
<source>Click here to create a OpenAi API Key</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Clique aqui para criar uma chave de API OpenAi</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions MultilingualResources/Echoglossian.ru.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@
<source>Settings for ChatGPT</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Настройки для ChatGPT</target>
</trans-unit>
<trans-unit id="ChatGPTAPIKeyLink" translate="yes" xml:space="preserve">
<source>Click here to create a OpenAi API Key</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">Нажмите здесь, чтобы создать ключ API OpenAi</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
14 changes: 12 additions & 2 deletions PluginUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ private void EchoglossianConfigUi()
ref this.configuration.TranslateBattleTalk);

ImGui.BeginGroup();
if (this.configuration.OverlayOnlyLanguage)
/*if (this.configuration.OverlayOnlyLanguage)
{
this.configuration.TranslateBattleTalk = false; // had disabled so no texts are lost while we fix this
saveConfig |=
Expand All @@ -264,7 +264,7 @@ private void EchoglossianConfigUi()
saveConfig |= ImGui.Checkbox(
Resources.OverlayToggleLabel,
ref this.configuration.UseImGuiForBattleTalk);
}
}*/

saveConfig |= ImGui.Checkbox(
Resources.TranslateNpcNamesToggle,
Expand Down Expand Up @@ -585,6 +585,16 @@ private void EchoglossianConfigUi()
case 2:
ImGui.TextWrapped(Resources.SettingsForChatGptTransText);
ImGui.Spacing();
if (ImGui.Button(Resources.ChatGPTAPIKeyLink))
{
saveConfig = true;
Process.Start(new ProcessStartInfo
{
FileName = "https://platform.openai.com/settings/profile?tab=api-keys",
UseShellExecute = true,
});
this.config = false;
}

var chatGptApiKey = this.configuration.ChatGptApiKey;
if (ImGui.InputText(Resources.ChatGptApiKey, ref chatGptApiKey, 100))
Expand Down
9 changes: 9 additions & 0 deletions Properties/Resources.Designer.cs

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

3 changes: 3 additions & 0 deletions Properties/Resources.da.resx
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,7 @@
<data name="SettingsForChatGptTransText" xml:space="preserve">
<value>Indstillinger for ChatGPT</value>
</data>
<data name="ChatGPTAPIKeyLink" xml:space="preserve">
<value>Klik her for at oprette en OpenAi API-nøgle</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Properties/Resources.de.resx
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,7 @@
<data name="SettingsForChatGptTransText" xml:space="preserve">
<value>Einstellungen für ChatGPT</value>
</data>
<data name="ChatGPTAPIKeyLink" xml:space="preserve">
<value>Klicken Sie hier, um einen OpenAi API-Schlüssel zu erstellen</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Properties/Resources.el.resx
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,7 @@
<data name="SettingsForChatGptTransText" xml:space="preserve">
<value>Ρυθμίσεις για το ChatGPT</value>
</data>
<data name="ChatGPTAPIKeyLink" xml:space="preserve">
<value>Κάντε κλικ εδώ για να δημιουργήσετε ένα κλειδί API OpenAi</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Properties/Resources.es.resx
Original file line number Diff line number Diff line change
Expand Up @@ -303,4 +303,7 @@
<data name="SettingsForChatGptTransText" xml:space="preserve">
<value>Configuración de ChatGPT</value>
</data>
<data name="ChatGPTAPIKeyLink" xml:space="preserve">
<value>Haga clic aquí para crear una clave API de OpenAi</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Properties/Resources.eu.resx
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,7 @@
<data name="SettingsForChatGptTransText" xml:space="preserve">
<value>ChatGPTren konfigurazioa</value>
</data>
<data name="ChatGPTAPIKeyLink" xml:space="preserve">
<value>Egin klik hemen OpenAi-ren API klabe bat sortzeko</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Properties/Resources.fr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,7 @@
<data name="SettingsForChatGptTransText" xml:space="preserve">
<value>Paramètres pour ChatGPT</value>
</data>
<data name="ChatGPTAPIKeyLink" xml:space="preserve">
<value>Cliquez ici pour créer une clé API OpenAi</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Properties/Resources.it.resx
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,7 @@
<data name="SettingsForChatGptTransText" xml:space="preserve">
<value>Impostazioni per ChatGPT</value>
</data>
<data name="ChatGPTAPIKeyLink" xml:space="preserve">
<value>Clicca qui per creare una chiave API OpenAi</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Properties/Resources.pt-BR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -303,4 +303,7 @@
<data name="SettingsForChatGptTransText" xml:space="preserve">
<value>Configurações para ChatGPT</value>
</data>
<data name="ChatGPTAPIKeyLink" xml:space="preserve">
<value>Clique aqui para criar uma chave de API OpenAi</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Properties/Resources.pt.resx
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,7 @@
<data name="SettingsForChatGptTransText" xml:space="preserve">
<value>Configurações para ChatGPT</value>
</data>
<data name="ChatGPTAPIKeyLink" xml:space="preserve">
<value>Clique aqui para criar uma chave de API OpenAi</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -436,4 +436,7 @@
<data name="SettingsForChatGptTransText" xml:space="preserve">
<value>Settings for ChatGPT</value>
</data>
<data name="ChatGPTAPIKeyLink" xml:space="preserve">
<value>Click here to create a OpenAi API Key</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Properties/Resources.ru.resx
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,7 @@
<data name="SettingsForChatGptTransText" xml:space="preserve">
<value>Настройки для ChatGPT</value>
</data>
<data name="ChatGPTAPIKeyLink" xml:space="preserve">
<value>Нажмите здесь, чтобы создать ключ API OpenAi</value>
</data>
</root>

0 comments on commit 848a7a3

Please sign in to comment.