mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-18 06:29:44 +08:00
[FancyZones] Localize names of predefined layotus (#7973)
* Localize strings in Settings.cs * Add comment to resource variable
This commit is contained in:
parent
48cf167a3c
commit
db61c6b643
@ -59,20 +59,6 @@ namespace FancyZonesEditor
|
||||
|
||||
private const int MaxNegativeSpacing = -10;
|
||||
|
||||
// Localizable strings
|
||||
private const string ErrorMessageBoxTitle = "FancyZones Editor Error";
|
||||
private const string ErrorParsingDeviceInfo = "Error parsing device info data.";
|
||||
private const string ErrorInvalidArgs = "FancyZones Editor arguments are invalid.";
|
||||
private const string ErrorNonStandaloneApp = "FancyZones Editor should not be run as standalone application.";
|
||||
|
||||
// Displayed layout names are localizable strings, but their underlying json tags are not.
|
||||
private const string FocusLayoutID = "Focus";
|
||||
private const string ColumnsLayoutID = "Columns";
|
||||
private const string RowsLayoutID = "Rows";
|
||||
private const string GridLayoutID = "Grid";
|
||||
private const string PriorityGridLayoutID = "Priority Grid";
|
||||
private const string CreateNewCustomLabel = "Create new custom";
|
||||
|
||||
// Non-localizable strings
|
||||
public static readonly string RegistryPath = "SOFTWARE\\SuperFancyZones";
|
||||
public static readonly string FullRegistryPath = "HKEY_CURRENT_USER\\" + RegistryPath;
|
||||
@ -153,30 +139,30 @@ namespace FancyZonesEditor
|
||||
|
||||
// Initialize the five default layout models: Focus, Columns, Rows, Grid, and PriorityGrid
|
||||
DefaultModels = new List<LayoutModel>(5);
|
||||
_focusModel = new CanvasLayoutModel(FocusLayoutID, LayoutType.Focus);
|
||||
_focusModel = new CanvasLayoutModel(Properties.Resources.Template_Layout_Focus, LayoutType.Focus);
|
||||
DefaultModels.Add(_focusModel);
|
||||
|
||||
_columnsModel = new GridLayoutModel(ColumnsLayoutID, LayoutType.Columns)
|
||||
_columnsModel = new GridLayoutModel(Properties.Resources.Template_Layout_Columns, LayoutType.Columns)
|
||||
{
|
||||
Rows = 1,
|
||||
RowPercents = new List<int>(1) { _multiplier },
|
||||
};
|
||||
DefaultModels.Add(_columnsModel);
|
||||
|
||||
_rowsModel = new GridLayoutModel(RowsLayoutID, LayoutType.Rows)
|
||||
_rowsModel = new GridLayoutModel(Properties.Resources.Template_Layout_Rows, LayoutType.Rows)
|
||||
{
|
||||
Columns = 1,
|
||||
ColumnPercents = new List<int>(1) { _multiplier },
|
||||
};
|
||||
DefaultModels.Add(_rowsModel);
|
||||
|
||||
_gridModel = new GridLayoutModel(GridLayoutID, LayoutType.Grid);
|
||||
_gridModel = new GridLayoutModel(Properties.Resources.Template_Layout_Grid, LayoutType.Grid);
|
||||
DefaultModels.Add(_gridModel);
|
||||
|
||||
_priorityGridModel = new GridLayoutModel(PriorityGridLayoutID, LayoutType.PriorityGrid);
|
||||
_priorityGridModel = new GridLayoutModel(Properties.Resources.Template_Layout_Priority_Grid, LayoutType.PriorityGrid);
|
||||
DefaultModels.Add(_priorityGridModel);
|
||||
|
||||
_blankCustomModel = new CanvasLayoutModel(CreateNewCustomLabel, LayoutType.Blank);
|
||||
_blankCustomModel = new CanvasLayoutModel(Properties.Resources.Custom_Layout_Create_New, LayoutType.Blank);
|
||||
|
||||
UpdateLayoutModels();
|
||||
}
|
||||
@ -495,7 +481,7 @@ namespace FancyZonesEditor
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LayoutModel.ShowExceptionMessageBox(ErrorParsingDeviceInfo, ex);
|
||||
LayoutModel.ShowExceptionMessageBox(Properties.Resources.Error_Parsing_Device_Info, ex);
|
||||
}
|
||||
}
|
||||
|
||||
@ -514,7 +500,7 @@ namespace FancyZonesEditor
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show(ErrorInvalidArgs, ErrorMessageBoxTitle);
|
||||
MessageBox.Show(Properties.Resources.Error_Invalid_Arguments, Properties.Resources.Error_Message_Box_Title);
|
||||
((App)Application.Current).Shutdown();
|
||||
}
|
||||
}
|
||||
@ -526,7 +512,7 @@ namespace FancyZonesEditor
|
||||
var parsedLocation = singleMonitorString.Split('_');
|
||||
if (parsedLocation.Length != 4)
|
||||
{
|
||||
MessageBox.Show(ErrorInvalidArgs, ErrorMessageBoxTitle);
|
||||
MessageBox.Show(Properties.Resources.Error_Invalid_Arguments, Properties.Resources.Error_Message_Box_Title);
|
||||
((App)Application.Current).Shutdown();
|
||||
}
|
||||
|
||||
@ -553,7 +539,7 @@ namespace FancyZonesEditor
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show(ErrorNonStandaloneApp, ErrorMessageBoxTitle);
|
||||
MessageBox.Show(Properties.Resources.Error_Invalid_Arguments, Properties.Resources.Error_Message_Box_Title);
|
||||
((App)Application.Current).Shutdown();
|
||||
}
|
||||
}
|
||||
|
@ -132,6 +132,15 @@ namespace FancyZonesEditor.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Create new custom.
|
||||
/// </summary>
|
||||
public static string Custom_Layout_Create_New {
|
||||
get {
|
||||
return ResourceManager.GetString("Custom_Layout_Create_New", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Custom layout creator.
|
||||
/// </summary>
|
||||
@ -177,6 +186,42 @@ namespace FancyZonesEditor.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to FancyZones Editor arguments are invalid..
|
||||
/// </summary>
|
||||
public static string Error_Invalid_Arguments {
|
||||
get {
|
||||
return ResourceManager.GetString("Error_Invalid_Arguments", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to FancyZones Editor Error.
|
||||
/// </summary>
|
||||
public static string Error_Message_Box_Title {
|
||||
get {
|
||||
return ResourceManager.GetString("Error_Message_Box_Title", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to FancyZones Editor should not be run as standalone application..
|
||||
/// </summary>
|
||||
public static string Error_Not_Standalone_App {
|
||||
get {
|
||||
return ResourceManager.GetString("Error_Not_Standalone_App", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Error parsing device info data..
|
||||
/// </summary>
|
||||
public static string Error_Parsing_Device_Info {
|
||||
get {
|
||||
return ResourceManager.GetString("Error_Parsing_Device_Info", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to FancyZones Editor.
|
||||
/// </summary>
|
||||
@ -249,6 +294,51 @@ namespace FancyZonesEditor.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Columns.
|
||||
/// </summary>
|
||||
public static string Template_Layout_Columns {
|
||||
get {
|
||||
return ResourceManager.GetString("Template_Layout_Columns", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Focus.
|
||||
/// </summary>
|
||||
public static string Template_Layout_Focus {
|
||||
get {
|
||||
return ResourceManager.GetString("Template_Layout_Focus", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Grid.
|
||||
/// </summary>
|
||||
public static string Template_Layout_Grid {
|
||||
get {
|
||||
return ResourceManager.GetString("Template_Layout_Grid", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Priority Grid.
|
||||
/// </summary>
|
||||
public static string Template_Layout_Priority_Grid {
|
||||
get {
|
||||
return ResourceManager.GetString("Template_Layout_Priority_Grid", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Rows.
|
||||
/// </summary>
|
||||
public static string Template_Layout_Rows {
|
||||
get {
|
||||
return ResourceManager.GetString("Template_Layout_Rows", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Templates.
|
||||
/// </summary>
|
||||
|
@ -189,4 +189,35 @@
|
||||
<data name="Custom_Layout_Delete_Button" xml:space="preserve">
|
||||
<value>Delete custom layout</value>
|
||||
</data>
|
||||
<data name="Custom_Layout_Create_New" xml:space="preserve">
|
||||
<value>Create new custom</value>
|
||||
<comment>As in Create new custom layout</comment>
|
||||
</data>
|
||||
<data name="Error_Invalid_Arguments" xml:space="preserve">
|
||||
<value>FancyZones Editor arguments are invalid.</value>
|
||||
</data>
|
||||
<data name="Error_Message_Box_Title" xml:space="preserve">
|
||||
<value>FancyZones Editor Error</value>
|
||||
</data>
|
||||
<data name="Error_Not_Standalone_App" xml:space="preserve">
|
||||
<value>FancyZones Editor should not be run as standalone application.</value>
|
||||
</data>
|
||||
<data name="Error_Parsing_Device_Info" xml:space="preserve">
|
||||
<value>Error parsing device info data.</value>
|
||||
</data>
|
||||
<data name="Template_Layout_Columns" xml:space="preserve">
|
||||
<value>Columns</value>
|
||||
</data>
|
||||
<data name="Template_Layout_Focus" xml:space="preserve">
|
||||
<value>Focus</value>
|
||||
</data>
|
||||
<data name="Template_Layout_Grid" xml:space="preserve">
|
||||
<value>Grid</value>
|
||||
</data>
|
||||
<data name="Template_Layout_Priority_Grid" xml:space="preserve">
|
||||
<value>Priority Grid</value>
|
||||
</data>
|
||||
<data name="Template_Layout_Rows" xml:space="preserve">
|
||||
<value>Rows</value>
|
||||
</data>
|
||||
</root>
|
Loading…
Reference in New Issue
Block a user