Skip to content

Commit

Permalink
Add localization keys.
Browse files Browse the repository at this point in the history
No actual localization yet...
  • Loading branch information
Caraxi committed May 26, 2020
1 parent c720807 commit 84216f7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
15 changes: 8 additions & 7 deletions ItemSearchPlugin/ItemSearchPluginConfig.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dalamud.Configuration;
using CheapLoc;
using Dalamud.Configuration;
using Dalamud.Plugin;
using ImGuiNET;
using Newtonsoft.Json;
Expand Down Expand Up @@ -76,37 +77,37 @@ public bool DrawConfigUI() {

bool closeOnChoose = CloseOnChoose;

if (ImGui.Checkbox("Close window after linking item", ref closeOnChoose)){
if (ImGui.Checkbox(Loc.Localize("ItemSearchConfigCloseAfterLink", "Close window after linking item"), ref closeOnChoose)){
CloseOnChoose = closeOnChoose;
Save();
}

bool showItemId = ShowItemID;
if (ImGui.Checkbox("Show Item IDs", ref showItemId)){
if (ImGui.Checkbox(Loc.Localize("ItemSearchConfigShowItemId", "Show Item IDs"), ref showItemId)){
ShowItemID = showItemId;
Save();
}

bool extraFilters = ExtraFilters;
if (ImGui.Checkbox("Enable Extra Filters", ref extraFilters)){
if (ImGui.Checkbox(Loc.Localize("ItemSearchConfigExtraFilters", "Enable Extra Filters"), ref extraFilters)){
ExtraFilters = extraFilters;
Save();
}

bool mbpIntegration = MarketBoardPluginIntegration;
if (ImGui.Checkbox("Market Board Plugin Integration", ref mbpIntegration)){
if (ImGui.Checkbox(Loc.Localize("ItemSearchConfigEnableMarketBoard", "Market Board Plugin Integration"), ref mbpIntegration)){
MarketBoardPluginIntegration = mbpIntegration;
Save();
}

bool showTryOn = ShowTryOn;
if (ImGui.Checkbox("Enable Try On Feature", ref showTryOn)){
if (ImGui.Checkbox(Loc.Localize("ItemSearchConfigEnableTryOn", "Enable Try On Feature"), ref showTryOn)){
ShowTryOn = showTryOn;
Save();
}

int dataSiteIndex = Array.IndexOf(ItemSearchPlugin.DataSites, this.SelectedDataSite);
if (ImGui.Combo("External Data Site", ref dataSiteIndex, ItemSearchPlugin.DataSites.Select(t => t.Name + (string.IsNullOrEmpty(t.Note) ? "":"*")).ToArray(), ItemSearchPlugin.DataSites.Length)) {
if (ImGui.Combo(Loc.Localize("ItemSearchConfigExternalDataSite", "External Data Site"), ref dataSiteIndex, ItemSearchPlugin.DataSites.Select(t => Loc.Localize(t.NameTranslationKey, t.Name) + (string.IsNullOrEmpty(t.Note) ? "":"*")).ToArray(), ItemSearchPlugin.DataSites.Length)) {
this.DataSite = ItemSearchPlugin.DataSites[dataSiteIndex].Name;
Save();
}
Expand Down
7 changes: 3 additions & 4 deletions ItemSearchPlugin/ItemSearchWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using CheapLoc;
using Dalamud.Data;
using Dalamud.Data.LuminaExtensions;
using Dalamud.Hooking;
using Dalamud.Interface;
using Dalamud.Plugin;
using ImGuiNET;
Expand Down Expand Up @@ -262,7 +261,7 @@ public bool Draw() {

if (pluginConfig.MarketBoardPluginIntegration && marketBoardResponsed && this.selectedItemIndex >= 0 && this.searchTask.Result[this.selectedItemIndex].ItemSearchCategory > 0){
ImGui.SameLine();
if (ImGui.Button("Market")){
if (ImGui.Button(Loc.Localize("ItemSearchMarketButton", "Market"))){
OnMarketboardOpen?.Invoke(this, this.searchTask.Result[this.selectedItemIndex]);
}
}
Expand All @@ -271,7 +270,7 @@ public bool Draw() {
if (pluginConfig.SelectedDataSite != null) {
ImGui.SameLine();
ImGui.PushStyleVar(ImGuiStyleVar.Alpha, this.selectedItemIndex < 0 ? 0.25f : 1);
if (ImGui.Button($"View on {pluginConfig.SelectedDataSite.Name}")) {
if (ImGui.Button(string.Format(Loc.Localize("ItemSearchDataSiteViewButton", "View on {0}"), Loc.Localize(pluginConfig.SelectedDataSite.NameTranslationKey, pluginConfig.SelectedDataSite.Name)))) {
if (this.selectedItemIndex >= 0) {
pluginConfig.SelectedDataSite.OpenItem(this.searchTask.Result[this.selectedItemIndex]);
}
Expand All @@ -295,7 +294,7 @@ public bool Draw() {

if (pluginConfig.ShowTryOn) {
ImGui.SameLine();
ImGui.Checkbox("Try On", ref autoTryOn);
ImGui.Checkbox(Loc.Localize("ItemSearchTryOnButton", "Try On"), ref autoTryOn);
}
string configText = Loc.Localize("ItemSearchConfigButton", "Config");
ImGui.SameLine(ImGui.GetWindowWidth() - (ImGui.CalcTextSize(configText).X + ImGui.GetStyle().ItemSpacing.X * 2));
Expand Down

0 comments on commit 84216f7

Please sign in to comment.