Skip to content

Commit

Permalink
Add indonesian translation
Browse files Browse the repository at this point in the history
  • Loading branch information
Fitri Rasendriya committed Jun 4, 2024
1 parent 6f49528 commit 601ada9
Show file tree
Hide file tree
Showing 8 changed files with 499 additions and 2 deletions.
1 change: 1 addition & 0 deletions Optimizer/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ internal static class Constants
internal static string BULGARIAN = "български";
internal static string VIETNAMESE = "Tiếng Việt";
internal static string URDU = "لشکری ‍زبان";
internal static string INDONESIA = "Bahasa Indonesia";

internal static string CloudflareDNS = "Cloudflare";
internal static string OpenDNS = "OpenDNS";
Expand Down
12 changes: 11 additions & 1 deletion Optimizer/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,8 @@ public MainForm(SplashForm _splashForm, bool? disableIndicium = null, bool? disa
Constants.NEPALI,
Constants.BULGARIAN,
Constants.VIETNAMESE,
Constants.URDU
Constants.URDU,
Constants.INDONESIA
});

_splashForm.LoadingStatus.Text = "checking for requirements";
Expand Down Expand Up @@ -1591,6 +1592,10 @@ private void LoadTranslation()
{
boxLang.Text = Constants.URDU;
}
if (OptionsHelper.CurrentOptions.LanguageCode == LanguageCode.ID)
{
boxLang.Text = Constants.INDONESIA;
}
}

private void GetHardwareSpecs()
Expand Down Expand Up @@ -4678,6 +4683,11 @@ private void boxLang_SelectedIndexChanged(object sender, EventArgs e)
picFlag.Image = Properties.Resources.pakistan;
OptionsHelper.CurrentOptions.LanguageCode = LanguageCode.UR;
}
else if (boxLang.Text == Constants.INDONESIA)
{
picFlag.Image = Properties.Resources.indonesia;
OptionsHelper.CurrentOptions.LanguageCode = LanguageCode.ID;
}

OptionsHelper.SaveSettings();
OptionsHelper.LoadTranslation();
Expand Down
3 changes: 2 additions & 1 deletion Optimizer/Models/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public enum LanguageCode
NE, // nepali
BG, // bulgarian
VN, // vietnamese
UR // urdu
UR, // urdu
ID // indonesia
}
}
2 changes: 2 additions & 0 deletions Optimizer/Optimizer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@
<None Include="Resources\i18n\RO.json" />
<None Include="Resources\Fonts\Poppins-Regular.ttf" />
<None Include="Resources\i18n\UA.json" />
<None Include="Resources\i18n\ID.json" />
<None Include="Resources\i18n\UR.json" />
<None Include="Resources\i18n\VN.json" />
<None Include="Resources\Scripts\AddOpenWithCMD.reg" />
Expand Down Expand Up @@ -385,6 +386,7 @@
</COMReference>
</ItemGroup>
<ItemGroup>
<None Include="Resources\Flags\indonesia.png" />
<None Include="Resources\Flags\pakistan.png" />
<None Include="Resources\Flags\vietnam.png" />
<None Include="Resources\Flags\bulgaria.png" />
Expand Down
1 change: 1 addition & 0 deletions Optimizer/OptionsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ internal static void LoadTranslation()
if (CurrentOptions.LanguageCode == LanguageCode.BG) TranslationList = JObject.Parse(Properties.Resources.BG);
if (CurrentOptions.LanguageCode == LanguageCode.VN) TranslationList = JObject.Parse(Properties.Resources.VN);
if (CurrentOptions.LanguageCode == LanguageCode.UR) TranslationList = JObject.Parse(Properties.Resources.UR);
if (CurrentOptions.LanguageCode == LanguageCode.ID) TranslationList = JObject.Parse(Properties.Resources.ID);

}
catch (Exception ex)
Expand Down
6 changes: 6 additions & 0 deletions Optimizer/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -352,4 +352,10 @@
<data name="UR" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\i18n\UR.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="indonesia" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Flags\indonesia.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ID" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\i18n\ID.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
</root>
Binary file added Optimizer/Resources/Flags/indonesia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 601ada9

Please sign in to comment.