Skip to content

A Swiss Army knife for developers.

Simplified the process for contributing to translation (#53)

Etienne Baudouxf8227bfe7030
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 402676dda..03d855b6f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -21,17 +21,12 @@ You can contribute to DevToys app by:
# Internationalization and localization
-* After following `How to Build and Run DevToys from source`, open `src/DevToys.sln` with Visual Studio.
-* Copy the folder `dev/impl/DevToys/Strings/en` and rename the copied folder with the language indication of your choice. For example, "fr-FR" for French (France).
-* Open each `.resw` files and translate the text.
-* Open `dev/impl/DevToys/LanguageManager.tt`.
-* [Copy the following block](https://github.com/veler/DevToys/blob/6c7e6ca48ea8fe2a313a917528e7751f6ec61be5/src/dev/impl/DevToys/LanguageManager.tt#L91-L96) and add it to the line below:
-* Change the `Identifier`, `DisplayName` and `Culture` to match your language.
-* Save the file. Visual Studio will ask you to confirm. Click Yes.
+* After following `How to Build and Run DevToys from source`, close Visual Studio, if any instance is running.
+* In File Explorer, copy the folder `dev/impl/DevToys/Strings/en-US` and rename the copied folder with the language indication of your choice. For example, "fr-FR" for French (France).
+* Open `src/DevToys.sln` with Visual Studio.
+* Open each `.resw` files from the language folder you created and translate the text.
* Build and Run the app and test your changes.
-// TODO: We should seriously consider a solution where contributors don't need to change LanguageManager.tt
-
# Coding
## Main architecture
diff --git a/src/dev/DevToys.Startup/DevToys.Startup.wapproj b/src/dev/DevToys.Startup/DevToys.Startup.wapproj
index a3bcead59..ed1af1840 100644
--- a/src/dev/DevToys.Startup/DevToys.Startup.wapproj
+++ b/src/dev/DevToys.Startup/DevToys.Startup.wapproj
@@ -34,7 +34,7 @@
<ProjectGuid>361db7bc-be7b-41a2-a29a-978a9e3b4aa7</ProjectGuid>
<TargetPlatformVersion>$(Windows10SDKVersion)</TargetPlatformVersion>
<TargetPlatformMinVersion>$(Windows10MinSDKVersion)</TargetPlatformMinVersion>
- <DefaultLanguage>en</DefaultLanguage>
+ <DefaultLanguage>en-US</DefaultLanguage>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<AppxSymbolPackageEnabled>True</AppxSymbolPackageEnabled>
diff --git a/src/dev/impl/DevToys.MonacoEditor/DevToys.MonacoEditor.csproj b/src/dev/impl/DevToys.MonacoEditor/DevToys.MonacoEditor.csproj
index 9de4185b1..af2ee5033 100644
--- a/src/dev/impl/DevToys.MonacoEditor/DevToys.MonacoEditor.csproj
+++ b/src/dev/impl/DevToys.MonacoEditor/DevToys.MonacoEditor.csproj
@@ -7,7 +7,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DevToys.MonacoEditor</RootNamespace>
<AssemblyName>DevToys.MonacoEditor</AssemblyName>
- <DefaultLanguage>en</DefaultLanguage>
+ <DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">$(Windows10SDKVersion)</TargetPlatformVersion>
<TargetPlatformMinVersion>$(Windows10MinSDKVersion)</TargetPlatformMinVersion>
diff --git a/src/dev/impl/DevToys/App.xaml.cs b/src/dev/impl/DevToys/App.xaml.cs
index 978e3f433..1db529217 100644
--- a/src/dev/impl/DevToys/App.xaml.cs
+++ b/src/dev/impl/DevToys/App.xaml.cs
@@ -44,7 +44,7 @@ namespace DevToys
{
// Set the language of the app for startup. By default, it's the same than Windows, or english.
// The language defined by the user will be applied later, once MEF is loaded, but before the UI shows up.
- LanguageManager.Instance.SetCurrentCulture(CultureInfo.InstalledUICulture);
+ LanguageManager.Instance.SetCurrentCulture(LanguageManager.Instance.AvailableLanguages[0]);
// Initialize MEF
_mefComposer
@@ -205,8 +205,10 @@ namespace DevToys
// Set the user-defined language.
string languageIdentifier = (await _mefComposer).ExportProvider.GetExport<ISettingsProvider>().GetSetting(PredefinedSettings.Language);
- LanguageDefinition languageDefinition = LanguageManager.Instance.AvailableLanguages.First(l => string.Equals(l.Identifier, languageIdentifier));
- LanguageManager.Instance.SetCurrentCulture(languageDefinition.Culture);
+ LanguageDefinition languageDefinition
+ = LanguageManager.Instance.AvailableLanguages.FirstOrDefault(l => string.Equals(l.InternalName, languageIdentifier))
+ ?? LanguageManager.Instance.AvailableLanguages[0];
+ LanguageManager.Instance.SetCurrentCulture(languageDefinition);
// Apply the app color theme.
(await _themeListener.Value).ApplyDesiredColorTheme();
diff --git a/src/dev/impl/DevToys/DevToys.csproj b/src/dev/impl/DevToys/DevToys.csproj
index 044fbcde2..972d02bf1 100644
--- a/src/dev/impl/DevToys/DevToys.csproj
+++ b/src/dev/impl/DevToys/DevToys.csproj
@@ -7,7 +7,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DevToys</RootNamespace>
<AssemblyName>DevToys</AssemblyName>
- <DefaultLanguage>en</DefaultLanguage>
+ <DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">$(Windows10SDKVersion)</TargetPlatformVersion>
<TargetPlatformMinVersion>$(Windows10MinSDKVersion)</TargetPlatformMinVersion>
@@ -334,18 +334,6 @@
<Link>Package.appxmanifest</Link>
<SubType>Designer</SubType>
</AppxManifest>
- <PRIResource Include="Strings\cs\TextDiff.resw" />
- <PRIResource Include="Strings\cs\StringUtilities.resw" />
- <PRIResource Include="Strings\cs\Settings.resw" />
- <PRIResource Include="Strings\cs\RegEx.resw" />
- <PRIResource Include="Strings\cs\MarkdownPreview.resw" />
- <PRIResource Include="Strings\cs\MainPage.resw" />
- <PRIResource Include="Strings\cs\JwtDecoderEncoder.resw" />
- <PRIResource Include="Strings\cs\JsonYaml.resw" />
- <PRIResource Include="Strings\cs\JsonFormatter.resw" />
- <PRIResource Include="Strings\cs\HashGenerator.resw" />
- <PRIResource Include="Strings\cs\Common.resw" />
- <PRIResource Include="Strings\cs\Base64EncoderDecoder.resw" />
<Page Include="Themes\Custom.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
diff --git a/src/dev/impl/DevToys/LanguageDefinition.cs b/src/dev/impl/DevToys/LanguageDefinition.cs
index 13788a30d..96daf99a8 100644
--- a/src/dev/impl/DevToys/LanguageDefinition.cs
+++ b/src/dev/impl/DevToys/LanguageDefinition.cs
@@ -7,21 +7,49 @@ namespace DevToys
/// <summary>
/// Represents un language supported by the app.
/// </summary>
- public struct LanguageDefinition
+ public class LanguageDefinition
{
+ /// <summary>
+ /// Unique internal name.
+ /// </summary>
+ public string InternalName { get; }
+
/// <summary>
/// Unique internal ID used to identify the language.
/// </summary>
- public string Identifier { get; set; }
+ public string Identifier { get; }
/// <summary>
/// The name of the language displayed to the user.
/// </summary>
- public string DisplayName { get; set; }
+ public string DisplayName { get; }
/// <summary>
/// The culture to apply.
/// </summary>
- public CultureInfo Culture { get; set; }
+ public CultureInfo Culture { get; }
+
+ public LanguageDefinition()
+ : this(null)
+ {
+ }
+
+ public LanguageDefinition(string? identifier)
+ {
+ if (!string.IsNullOrEmpty(identifier))
+ {
+ Culture = new CultureInfo(identifier!);
+ DisplayName = Culture.NativeName;
+ InternalName = Culture.Name;
+ }
+ else
+ {
+ Culture = CultureInfo.InstalledUICulture;
+ DisplayName = new SettingsStrings().DefaultLanguage;
+ InternalName = "default";
+ }
+
+ Identifier = Culture.Name;
+ }
}
}
diff --git a/src/dev/impl/DevToys/LanguageManager.cs b/src/dev/impl/DevToys/LanguageManager.cs
index 165a4a0c5..a5e1bc532 100644
--- a/src/dev/impl/DevToys/LanguageManager.cs
+++ b/src/dev/impl/DevToys/LanguageManager.cs
@@ -110,40 +110,18 @@ namespace DevToys
/// <summary>
/// Gets the list of available languages in the app.
/// </summary>
- public List<LanguageDefinition> AvailableLanguages
- => new List<LanguageDefinition>
+ public List<LanguageDefinition> AvailableLanguages { get; }
+
+ public LanguageManager()
+ {
+ AvailableLanguages = new List<LanguageDefinition>();
+ AvailableLanguages.Add(new LanguageDefinition()); // default language
+ IReadOnlyList<string> supportedLanguageIdentifiers = ApplicationLanguages.ManifestLanguages;
+ for (int i = 0; i < supportedLanguageIdentifiers.Count; i++)
{
- new LanguageDefinition
- {
- Identifier = "default",
- DisplayName = Settings.DefaultLanguage,
- Culture = CultureInfo.InstalledUICulture
- },
- new LanguageDefinition
- {
- Identifier = "english",
- DisplayName = "English",
- Culture = new CultureInfo("en")
- },
- new LanguageDefinition
- {
- Identifier = "russian",
- DisplayName = "Русский",
- Culture = new CultureInfo("ru")
- },
- new LanguageDefinition
- {
- Identifier = "french",
- DisplayName = "français",
- Culture = new CultureInfo("fr")
- },
- new LanguageDefinition
- {
- Identifier = "czech",
- DisplayName = "Czech",
- Culture = new CultureInfo("cs")
- }
- };
+ AvailableLanguages.Add(new LanguageDefinition(supportedLanguageIdentifiers[i]));
+ }
+ }
/// <summary>
/// Retrieves the current culture.
@@ -156,13 +134,13 @@ namespace DevToys
/// <summary>
/// Change the current culture of the application
/// </summary>
- public void SetCurrentCulture(CultureInfo culture)
+ public void SetCurrentCulture(LanguageDefinition language)
{
- CultureInfo.DefaultThreadCurrentCulture = culture;
- CultureInfo.DefaultThreadCurrentUICulture = culture;
- ApplicationLanguages.PrimaryLanguageOverride = culture.TextInfo.CultureName;
+ CultureInfo.DefaultThreadCurrentCulture = language.Culture;
+ CultureInfo.DefaultThreadCurrentUICulture = language.Culture;
+ ApplicationLanguages.PrimaryLanguageOverride = language.Identifier;
- if (culture.TextInfo.IsRightToLeft)
+ if (language.Culture.TextInfo.IsRightToLeft)
{
FlowDirection = FlowDirection.RightToLeft;
}
diff --git a/src/dev/impl/DevToys/LanguageManager.tt b/src/dev/impl/DevToys/LanguageManager.tt
index 5f26d1beb..44a537fd9 100644
--- a/src/dev/impl/DevToys/LanguageManager.tt
+++ b/src/dev/impl/DevToys/LanguageManager.tt
@@ -20,7 +20,7 @@
<#@ import namespace="Microsoft.VisualStudio.TextTemplating" #>
<#
- var stringsFolder = Host.ResolvePath(@"Strings/en");
+ var stringsFolder = Host.ResolvePath(@"Strings/en-US");
#>
//------------------------------------------------------------------------------
// <auto-generated>
@@ -85,40 +85,18 @@ namespace DevToys
/// <summary>
/// Gets the list of available languages in the app.
/// </summary>
- public List<LanguageDefinition> AvailableLanguages
- => new List<LanguageDefinition>
+ public List<LanguageDefinition> AvailableLanguages { get; }
+
+ public LanguageManager()
+ {
+ AvailableLanguages = new List<LanguageDefinition>();
+ AvailableLanguages.Add(new LanguageDefinition()); // default language
+ IReadOnlyList<string> supportedLanguageIdentifiers = ApplicationLanguages.ManifestLanguages;
+ for (int i = 0; i < supportedLanguageIdentifiers.Count; i++)
{
- new LanguageDefinition
- {
- Identifier = "default",
- DisplayName = Settings.DefaultLanguage,
- Culture = CultureInfo.InstalledUICulture
- },
- new LanguageDefinition
- {
- Identifier = "english",
- DisplayName = "English",
- Culture = new CultureInfo("en")
- },
- new LanguageDefinition
- {
- Identifier = "russian",
- DisplayName = "Русский",
- Culture = new CultureInfo("ru")
- },
- new LanguageDefinition
- {
- Identifier = "french",
- DisplayName = "français",
- Culture = new CultureInfo("fr")
- },
- new LanguageDefinition
- {
- Identifier = "czech",
- DisplayName = "Czech",
- Culture = new CultureInfo("cs")
- }
- };
+ AvailableLanguages.Add(new LanguageDefinition(supportedLanguageIdentifiers[i]));
+ }
+ }
/// <summary>
/// Retrieves the current culture.
@@ -131,13 +109,13 @@ namespace DevToys
/// <summary>
/// Change the current culture of the application
/// </summary>
- public void SetCurrentCulture(CultureInfo culture)
+ public void SetCurrentCulture(LanguageDefinition language)
{
- CultureInfo.DefaultThreadCurrentCulture = culture;
- CultureInfo.DefaultThreadCurrentUICulture = culture;
- ApplicationLanguages.PrimaryLanguageOverride = culture.TextInfo.CultureName;
+ CultureInfo.DefaultThreadCurrentCulture = language.Culture;
+ CultureInfo.DefaultThreadCurrentUICulture = language.Culture;
+ ApplicationLanguages.PrimaryLanguageOverride = language.Identifier;
- if (culture.TextInfo.IsRightToLeft)
+ if (language.Culture.TextInfo.IsRightToLeft)
{
FlowDirection = FlowDirection.RightToLeft;
}
diff --git a/src/dev/impl/DevToys/Strings/cs/Base64EncoderDecoder.resw b/src/dev/impl/DevToys/Strings/cs-CZ/Base64EncoderDecoder.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/cs/Base64EncoderDecoder.resw
rename to src/dev/impl/DevToys/Strings/cs-CZ/Base64EncoderDecoder.resw
diff --git a/src/dev/impl/DevToys/Strings/cs/Common.resw b/src/dev/impl/DevToys/Strings/cs-CZ/Common.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/cs/Common.resw
rename to src/dev/impl/DevToys/Strings/cs-CZ/Common.resw
diff --git a/src/dev/impl/DevToys/Strings/cs/HashGenerator.resw b/src/dev/impl/DevToys/Strings/cs-CZ/HashGenerator.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/cs/HashGenerator.resw
rename to src/dev/impl/DevToys/Strings/cs-CZ/HashGenerator.resw
diff --git a/src/dev/impl/DevToys/Strings/cs/JsonFormatter.resw b/src/dev/impl/DevToys/Strings/cs-CZ/JsonFormatter.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/cs/JsonFormatter.resw
rename to src/dev/impl/DevToys/Strings/cs-CZ/JsonFormatter.resw
diff --git a/src/dev/impl/DevToys/Strings/cs/JsonYaml.resw b/src/dev/impl/DevToys/Strings/cs-CZ/JsonYaml.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/cs/JsonYaml.resw
rename to src/dev/impl/DevToys/Strings/cs-CZ/JsonYaml.resw
diff --git a/src/dev/impl/DevToys/Strings/cs/JwtDecoderEncoder.resw b/src/dev/impl/DevToys/Strings/cs-CZ/JwtDecoderEncoder.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/cs/JwtDecoderEncoder.resw
rename to src/dev/impl/DevToys/Strings/cs-CZ/JwtDecoderEncoder.resw
diff --git a/src/dev/impl/DevToys/Strings/cs/MainPage.resw b/src/dev/impl/DevToys/Strings/cs-CZ/MainPage.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/cs/MainPage.resw
rename to src/dev/impl/DevToys/Strings/cs-CZ/MainPage.resw
diff --git a/src/dev/impl/DevToys/Strings/cs/MarkdownPreview.resw b/src/dev/impl/DevToys/Strings/cs-CZ/MarkdownPreview.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/cs/MarkdownPreview.resw
rename to src/dev/impl/DevToys/Strings/cs-CZ/MarkdownPreview.resw
diff --git a/src/dev/impl/DevToys/Strings/cs/RegEx.resw b/src/dev/impl/DevToys/Strings/cs-CZ/RegEx.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/cs/RegEx.resw
rename to src/dev/impl/DevToys/Strings/cs-CZ/RegEx.resw
diff --git a/src/dev/impl/DevToys/Strings/cs/Settings.resw b/src/dev/impl/DevToys/Strings/cs-CZ/Settings.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/cs/Settings.resw
rename to src/dev/impl/DevToys/Strings/cs-CZ/Settings.resw
diff --git a/src/dev/impl/DevToys/Strings/cs/StringUtilities.resw b/src/dev/impl/DevToys/Strings/cs-CZ/StringUtilities.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/cs/StringUtilities.resw
rename to src/dev/impl/DevToys/Strings/cs-CZ/StringUtilities.resw
diff --git a/src/dev/impl/DevToys/Strings/cs/TextDiff.resw b/src/dev/impl/DevToys/Strings/cs-CZ/TextDiff.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/cs/TextDiff.resw
rename to src/dev/impl/DevToys/Strings/cs-CZ/TextDiff.resw
diff --git a/src/dev/impl/DevToys/Strings/en/Base64EncoderDecoder.resw b/src/dev/impl/DevToys/Strings/en-US/Base64EncoderDecoder.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/en/Base64EncoderDecoder.resw
rename to src/dev/impl/DevToys/Strings/en-US/Base64EncoderDecoder.resw
diff --git a/src/dev/impl/DevToys/Strings/en/Common.resw b/src/dev/impl/DevToys/Strings/en-US/Common.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/en/Common.resw
rename to src/dev/impl/DevToys/Strings/en-US/Common.resw
diff --git a/src/dev/impl/DevToys/Strings/en/HashGenerator.resw b/src/dev/impl/DevToys/Strings/en-US/HashGenerator.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/en/HashGenerator.resw
rename to src/dev/impl/DevToys/Strings/en-US/HashGenerator.resw
diff --git a/src/dev/impl/DevToys/Strings/en/JsonFormatter.resw b/src/dev/impl/DevToys/Strings/en-US/JsonFormatter.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/en/JsonFormatter.resw
rename to src/dev/impl/DevToys/Strings/en-US/JsonFormatter.resw
diff --git a/src/dev/impl/DevToys/Strings/en/JsonYaml.resw b/src/dev/impl/DevToys/Strings/en-US/JsonYaml.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/en/JsonYaml.resw
rename to src/dev/impl/DevToys/Strings/en-US/JsonYaml.resw
diff --git a/src/dev/impl/DevToys/Strings/en/JwtDecoderEncoder.resw b/src/dev/impl/DevToys/Strings/en-US/JwtDecoderEncoder.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/en/JwtDecoderEncoder.resw
rename to src/dev/impl/DevToys/Strings/en-US/JwtDecoderEncoder.resw
diff --git a/src/dev/impl/DevToys/Strings/en/MainPage.resw b/src/dev/impl/DevToys/Strings/en-US/MainPage.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/en/MainPage.resw
rename to src/dev/impl/DevToys/Strings/en-US/MainPage.resw
diff --git a/src/dev/impl/DevToys/Strings/en/MarkdownPreview.resw b/src/dev/impl/DevToys/Strings/en-US/MarkdownPreview.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/en/MarkdownPreview.resw
rename to src/dev/impl/DevToys/Strings/en-US/MarkdownPreview.resw
diff --git a/src/dev/impl/DevToys/Strings/en/RegEx.resw b/src/dev/impl/DevToys/Strings/en-US/RegEx.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/en/RegEx.resw
rename to src/dev/impl/DevToys/Strings/en-US/RegEx.resw
diff --git a/src/dev/impl/DevToys/Strings/en/Settings.resw b/src/dev/impl/DevToys/Strings/en-US/Settings.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/en/Settings.resw
rename to src/dev/impl/DevToys/Strings/en-US/Settings.resw
diff --git a/src/dev/impl/DevToys/Strings/en/StringUtilities.resw b/src/dev/impl/DevToys/Strings/en-US/StringUtilities.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/en/StringUtilities.resw
rename to src/dev/impl/DevToys/Strings/en-US/StringUtilities.resw
diff --git a/src/dev/impl/DevToys/Strings/en/TextDiff.resw b/src/dev/impl/DevToys/Strings/en-US/TextDiff.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/en/TextDiff.resw
rename to src/dev/impl/DevToys/Strings/en-US/TextDiff.resw
diff --git a/src/dev/impl/DevToys/Strings/fr/Base64EncoderDecoder.resw b/src/dev/impl/DevToys/Strings/fr-FR/Base64EncoderDecoder.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/fr/Base64EncoderDecoder.resw
rename to src/dev/impl/DevToys/Strings/fr-FR/Base64EncoderDecoder.resw
diff --git a/src/dev/impl/DevToys/Strings/fr/Common.resw b/src/dev/impl/DevToys/Strings/fr-FR/Common.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/fr/Common.resw
rename to src/dev/impl/DevToys/Strings/fr-FR/Common.resw
diff --git a/src/dev/impl/DevToys/Strings/fr/HashGenerator.resw b/src/dev/impl/DevToys/Strings/fr-FR/HashGenerator.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/fr/HashGenerator.resw
rename to src/dev/impl/DevToys/Strings/fr-FR/HashGenerator.resw
diff --git a/src/dev/impl/DevToys/Strings/fr/JsonFormatter.resw b/src/dev/impl/DevToys/Strings/fr-FR/JsonFormatter.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/fr/JsonFormatter.resw
rename to src/dev/impl/DevToys/Strings/fr-FR/JsonFormatter.resw
diff --git a/src/dev/impl/DevToys/Strings/fr/JsonYaml.resw b/src/dev/impl/DevToys/Strings/fr-FR/JsonYaml.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/fr/JsonYaml.resw
rename to src/dev/impl/DevToys/Strings/fr-FR/JsonYaml.resw
diff --git a/src/dev/impl/DevToys/Strings/fr/JwtDecoderEncoder.resw b/src/dev/impl/DevToys/Strings/fr-FR/JwtDecoderEncoder.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/fr/JwtDecoderEncoder.resw
rename to src/dev/impl/DevToys/Strings/fr-FR/JwtDecoderEncoder.resw
diff --git a/src/dev/impl/DevToys/Strings/fr/MainPage.resw b/src/dev/impl/DevToys/Strings/fr-FR/MainPage.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/fr/MainPage.resw
rename to src/dev/impl/DevToys/Strings/fr-FR/MainPage.resw
diff --git a/src/dev/impl/DevToys/Strings/fr/MarkdownPreview.resw b/src/dev/impl/DevToys/Strings/fr-FR/MarkdownPreview.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/fr/MarkdownPreview.resw
rename to src/dev/impl/DevToys/Strings/fr-FR/MarkdownPreview.resw
diff --git a/src/dev/impl/DevToys/Strings/fr/RegEx.resw b/src/dev/impl/DevToys/Strings/fr-FR/RegEx.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/fr/RegEx.resw
rename to src/dev/impl/DevToys/Strings/fr-FR/RegEx.resw
diff --git a/src/dev/impl/DevToys/Strings/fr/Settings.resw b/src/dev/impl/DevToys/Strings/fr-FR/Settings.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/fr/Settings.resw
rename to src/dev/impl/DevToys/Strings/fr-FR/Settings.resw
diff --git a/src/dev/impl/DevToys/Strings/fr/StringUtilities.resw b/src/dev/impl/DevToys/Strings/fr-FR/StringUtilities.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/fr/StringUtilities.resw
rename to src/dev/impl/DevToys/Strings/fr-FR/StringUtilities.resw
diff --git a/src/dev/impl/DevToys/Strings/fr/TextDiff.resw b/src/dev/impl/DevToys/Strings/fr-FR/TextDiff.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/fr/TextDiff.resw
rename to src/dev/impl/DevToys/Strings/fr-FR/TextDiff.resw
diff --git a/src/dev/impl/DevToys/Strings/ru/Base64EncoderDecoder.resw b/src/dev/impl/DevToys/Strings/ru-RU/Base64EncoderDecoder.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/ru/Base64EncoderDecoder.resw
rename to src/dev/impl/DevToys/Strings/ru-RU/Base64EncoderDecoder.resw
diff --git a/src/dev/impl/DevToys/Strings/ru/Common.resw b/src/dev/impl/DevToys/Strings/ru-RU/Common.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/ru/Common.resw
rename to src/dev/impl/DevToys/Strings/ru-RU/Common.resw
diff --git a/src/dev/impl/DevToys/Strings/ru/HashGenerator.resw b/src/dev/impl/DevToys/Strings/ru-RU/HashGenerator.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/ru/HashGenerator.resw
rename to src/dev/impl/DevToys/Strings/ru-RU/HashGenerator.resw
diff --git a/src/dev/impl/DevToys/Strings/ru/JsonFormatter.resw b/src/dev/impl/DevToys/Strings/ru-RU/JsonFormatter.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/ru/JsonFormatter.resw
rename to src/dev/impl/DevToys/Strings/ru-RU/JsonFormatter.resw
diff --git a/src/dev/impl/DevToys/Strings/ru/JsonYaml.resw b/src/dev/impl/DevToys/Strings/ru-RU/JsonYaml.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/ru/JsonYaml.resw
rename to src/dev/impl/DevToys/Strings/ru-RU/JsonYaml.resw
diff --git a/src/dev/impl/DevToys/Strings/ru/JwtDecoderEncoder.resw b/src/dev/impl/DevToys/Strings/ru-RU/JwtDecoderEncoder.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/ru/JwtDecoderEncoder.resw
rename to src/dev/impl/DevToys/Strings/ru-RU/JwtDecoderEncoder.resw
diff --git a/src/dev/impl/DevToys/Strings/ru/MainPage.resw b/src/dev/impl/DevToys/Strings/ru-RU/MainPage.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/ru/MainPage.resw
rename to src/dev/impl/DevToys/Strings/ru-RU/MainPage.resw
diff --git a/src/dev/impl/DevToys/Strings/ru/MarkdownPreview.resw b/src/dev/impl/DevToys/Strings/ru-RU/MarkdownPreview.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/ru/MarkdownPreview.resw
rename to src/dev/impl/DevToys/Strings/ru-RU/MarkdownPreview.resw
diff --git a/src/dev/impl/DevToys/Strings/ru/RegEx.resw b/src/dev/impl/DevToys/Strings/ru-RU/RegEx.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/ru/RegEx.resw
rename to src/dev/impl/DevToys/Strings/ru-RU/RegEx.resw
diff --git a/src/dev/impl/DevToys/Strings/ru/Settings.resw b/src/dev/impl/DevToys/Strings/ru-RU/Settings.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/ru/Settings.resw
rename to src/dev/impl/DevToys/Strings/ru-RU/Settings.resw
diff --git a/src/dev/impl/DevToys/Strings/ru/StringUtilities.resw b/src/dev/impl/DevToys/Strings/ru-RU/StringUtilities.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/ru/StringUtilities.resw
rename to src/dev/impl/DevToys/Strings/ru-RU/StringUtilities.resw
diff --git a/src/dev/impl/DevToys/Strings/ru/TextDiff.resw b/src/dev/impl/DevToys/Strings/ru-RU/TextDiff.resw
similarity index 100%
rename from src/dev/impl/DevToys/Strings/ru/TextDiff.resw
rename to src/dev/impl/DevToys/Strings/ru-RU/TextDiff.resw
diff --git a/src/dev/impl/DevToys/Views/Tools/Settings/SettingsToolPage.xaml b/src/dev/impl/DevToys/Views/Tools/Settings/SettingsToolPage.xaml
index d2404d7f8..e49f5d261 100644
--- a/src/dev/impl/DevToys/Views/Tools/Settings/SettingsToolPage.xaml
+++ b/src/dev/impl/DevToys/Views/Tools/Settings/SettingsToolPage.xaml
@@ -28,7 +28,7 @@
</controls:ExpandableSettingControl.Icon>
<ComboBox
DisplayMemberPath="DisplayName"
- SelectedValuePath="Identifier"
+ SelectedValuePath="InternalName"
ItemsSource="{x:Bind ViewModel.AvailableLanguages}"
SelectedValue="{x:Bind ViewModel.Language, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
</ComboBox>
diff --git a/src/tests/DevToys.Tests/MefBaseTest.cs b/src/tests/DevToys.Tests/MefBaseTest.cs
index bef9965ec..9cf064022 100644
--- a/src/tests/DevToys.Tests/MefBaseTest.cs
+++ b/src/tests/DevToys.Tests/MefBaseTest.cs
@@ -16,7 +16,7 @@ namespace DevToys.Tests
public MefBaseTest()
{
// Do all the tests in English.
- LanguageManager.Instance.SetCurrentCulture(new CultureInfo("en"));
+ LanguageManager.Instance.SetCurrentCulture(new LanguageDefinition("en-US"));
_mefComposer
= new MefComposer(