diff --git a/src/components/top_bar.ts b/src/components/top_bar.ts index a2e8eadbb5..d5a0f46f5b 100644 --- a/src/components/top_bar.ts +++ b/src/components/top_bar.ts @@ -5,6 +5,7 @@ import { isEqual } from "../helpers/index"; import { setFormatter, setStyle, topbarComponentRegistry } from "../registries/index"; import { topbarMenuRegistry } from "../registries/menus/topbar_menu_registry"; import { FullMenuItem } from "../registries/menu_items_registry"; +import { _lt } from "../translation"; import { Align, BorderCommand, SpreadsheetEnv, Style } from "../types/index"; import { ColorPicker } from "./color_picker"; import { Composer } from "./composer/composer"; @@ -30,14 +31,34 @@ interface State { activeTool: Tool; } +const Terms = { + Undo: _lt("Undo"), + Redo: _lt("Redo"), + PaintFormat: _lt("Paint Format"), + ClearFormat: _lt("Clear Format"), + FormatAsPercent: _lt("Format as percent"), + DecreaseDecimalPlaces: _lt("Decrease decimal places"), + IncreaseDecimalPlaces: _lt("Increase decimal places"), + MoreFormats: _lt("More formats"), + FontSize: _lt("Font Size"), + Bold: _lt("Bold"), + Italic: _lt("Italic"), + Strikethrough: _lt("Strikethrough"), + TextColor: _lt("Text Color"), + FillColor: _lt("Fill Color"), + Borders: _lt("Borders"), + MergeCells: _lt("Merge Cells"), + HorizontalAlign: _lt("Horizontal align"), +}; + const FORMATS = [ - { name: "general", text: "General (no specific format)" }, - { name: "number", text: "Number (1,000.12)", value: "#,##0.00" }, - { name: "percent", text: "Percent (10.12%)", value: "0.00%" }, - { name: "date", text: "Date (9/26/2008)", value: "m/d/yyyy" }, - { name: "time", text: "Time (10:43:00 PM)", value: "hh:mm:ss a" }, - { name: "datetime", text: "Date time (9/26/2008 22:43:00)", value: "m/d/yyyy hh:mm:ss" }, - { name: "duration", text: "Duration (27:51:38)", value: "hhhh:mm:ss" }, + { name: "general", text: _lt("General (no specific format)") }, + { name: "number", text: _lt("Number (1,000.12)"), value: "#,##0.00" }, + { name: "percent", text: _lt("Percent (10.12%)"), value: "0.00%" }, + { name: "date", text: _lt("Date (9/26/2008)"), value: "m/d/yyyy" }, + { name: "time", text: _lt("Time (10:43:00 PM)"), value: "hh:mm:ss a" }, + { name: "datetime", text: _lt("Date time (9/26/2008 22:43:00)"), value: "m/d/yyyy hh:mm:ss" }, + { name: "duration", text: _lt("Duration (27:51:38)"), value: "hhhh:mm:ss" }, ]; // ----------------------------------------------------------------------------- @@ -78,15 +99,15 @@ export class TopBar extends Component {
-
${icons.UNDO_ICON}
-
${icons.REDO_ICON}
-
${icons.PAINT_FORMAT_ICON}
-
${icons.CLEAR_FORMAT_ICON}
+
${icons.UNDO_ICON}
+
${icons.REDO_ICON}
+
${icons.PAINT_FORMAT_ICON}
+
${icons.CLEAR_FORMAT_ICON}
-
%
-
.0
-
.00
-
+
%
+
.0
+
.00
+
123${icons.TRIANGLE_DOWN_ICON}
@@ -96,7 +117,7 @@ export class TopBar extends Component {
-
+
${icons.TRIANGLE_DOWN_ICON}
@@ -105,20 +126,20 @@ export class TopBar extends Component {
-
${icons.BOLD_ICON}
-
${icons.ITALIC_ICON}
-
${icons.STRIKE_ICON}
+
${icons.BOLD_ICON}
+
${icons.ITALIC_ICON}
+
${icons.STRIKE_ICON}
- ${icons.TEXT_COLOR_ICON} + ${icons.TEXT_COLOR_ICON}
- ${icons.FILL_COLOR_ICON} + ${icons.FILL_COLOR_ICON}
- ${icons.BORDERS_ICON} + ${icons.BORDERS_ICON}
${icons.BORDERS_ICON} @@ -136,9 +157,9 @@ export class TopBar extends Component {
-
${icons.MERGE_CELL_ICON}
+
${icons.MERGE_CELL_ICON}
-
+
${icons.ALIGN_RIGHT_ICON} ${icons.ALIGN_CENTER_ICON}