diff --git a/package.json b/package.json index b2d597b..563d01c 100644 --- a/package.json +++ b/package.json @@ -46,4 +46,4 @@ "gulp-eslint": "6.0.0", "typescript": "~4.5.5" } -} +} \ No newline at end of file diff --git a/src/WebPart/PropertyPaneSizeFieldComponent.tsx b/src/WebPart/PropertyPaneSizeFieldComponent.tsx index e8c4c4d..a85f4aa 100644 --- a/src/WebPart/PropertyPaneSizeFieldComponent.tsx +++ b/src/WebPart/PropertyPaneSizeFieldComponent.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import { Dropdown, IDropdownOption, Stack, TextField, Text } from '@fluentui/react'; +import * as strings from 'WebPartStrings'; const makeSplitValue = (value: string) => { const matches = value?.match(/(\d+)\s*(\w+|%)?/); @@ -21,13 +22,13 @@ export function PropertyPaneSizeFieldComponent(props: { const screen = `v${props.screenUnits}`; const unitsOptions: IDropdownOption[] = [ - { key: screen, text: "% of the screen" }, - { key: '%', text: "% of the frame" }, - { key: 'cm', text: "centimeters" }, - { key: 'in', text: "inches" }, - { key: 'mm', text: "millimeters" }, - { key: 'pt', text: "points" }, - { key: 'px', text: "pixels" }, + { key: screen, text: strings.percOfScreen }, // % of the Screen + { key: '%', text: strings.percOfFrame }, // % of the Frame + { key: 'cm', text: strings.centimeters }, + { key: 'in', text: strings.inches }, + { key: 'mm', text: strings.millimeters }, + { key: 'pt', text: strings.points }, + { key: 'px', text: strings.pixels }, ]; const splitValue = makeSplitValue(props.value); diff --git a/src/WebPart/TopFrame.tsx b/src/WebPart/TopFrame.tsx index d7b2bab..d066b9e 100644 --- a/src/WebPart/TopFrame.tsx +++ b/src/WebPart/TopFrame.tsx @@ -5,6 +5,7 @@ import { IWebPartProps } from './WebPart'; import { SPHttpClient } from "@microsoft/sp-http"; import { Placeholder } from '../min-sp-controls-react/controls/placeholder'; import { MessageBar, MessageBarType, ThemeProvider } from '@fluentui/react'; +import * as strings from 'WebPartStrings'; interface ITopFrameProps extends IWebPartProps { context: WebPartContext; @@ -102,17 +103,17 @@ export function TopFrame(props: ITopFrameProps) { if (!oneDriveWopiFrameResult || !oneDriveWopiFrameResult.ok) { if (oneDriveWopiFrameResult.status === 404) { - throw new Error(`The Visio file this web part is connected to is not found at the URL ${fileUrl}. Was the file deleted?`); + throw new Error(`${strings.messageVisioFileNotFound} ${fileUrl} ${strings.messageWasTheFileDeleted}`); } if (oneDriveWopiFrameResult.status === 403) { - throw new Error(`The Visio file this web part is connected to cannot be accessed at the URL ${fileUrl}. Are some permissions missing?`); + throw new Error(`${strings.messageVisioFileCannotAccessed} ${fileUrl} ${strings.messageArePermissionsMissing}`); // "The Visio file this web part is connected to cannot be accessed at the URL" // "Are some permissions missing?", } - throw new Error(`Something went wrong when resolving file URL: ${fileUrl}. Status='${oneDriveWopiFrameResult.status}'`); + throw new Error(`${strings.messageSomethingWentWrongResolveURL} ${fileUrl}. Status='${oneDriveWopiFrameResult.status}'`); // "Something went wrong when resolving file URL:", } const oneDriveWopiFrameData = await oneDriveWopiFrameResult.json(); if (!oneDriveWopiFrameData || !oneDriveWopiFrameData.value) { - throw new Error(`Cannot resolve file URL: ${fileUrl}`); + throw new Error(`${strings.messageCannotResolveFileURL} ${fileUrl}`); } const result = oneDriveWopiFrameData.value @@ -146,21 +147,21 @@ export function TopFrame(props: ITopFrameProps) { const showPlaceholder = !props.url || loadError; const placeholderIconName = loadError - ? "Error" - : "Edit"; + ? strings.Error // "Error" + : strings.Edit // "Edit"; const placeholderIconText = loadError - ? "Unable to show this Visio diagram" - : "Visio diagram not selected"; + ? strings.placeholderIconTextUnableShowVisio // "Unable to show this Visio diagram" + : strings.placeholderIconTextVisioNotSelected // "Visio diagram not selected"; const placeholderDescription = props.isPropertyPaneOpen - ? `Please click 'Browse...' Button on configuration panel to select the diagram.` + ? strings.placeholderIconTextPleaseclickBrowse //`Please click 'Browse...' Button on configuration panel to select the diagram.` : props.isReadOnly ? (props.isTeams - ? `Please click 'Settings' menu on the Tab to reconfigure this web part.` - : `Please click 'Edit' to start page editing to reconfigure this web part.` + ? strings.placeholderIconTextPleaseclickSettings //`Please click 'Settings' menu on the Tab to reconfigure this web part.` + : strings.placeholderIconTextPleaseclickEdit // `Please click 'Edit' to start page editing to reconfigure this web part.` ) - : `Click 'Configure' button to reconfigure this web part.`; + : strings.placeholderIconTextPleaseclickConfigure //`Click 'Configure' button to reconfigure this web part.`; return ( @@ -169,7 +170,7 @@ export function TopFrame(props: ITopFrameProps) { iconName={placeholderIconName} iconText={placeholderIconText} description={placeholderDescription} - buttonLabel={"Configure"} + buttonLabel={strings.FieldConfigureLabel} // Configure onConfigure={() => props.onConfigure()} hideButton={props.isReadOnly} disableButton={props.isPropertyPaneOpen} diff --git a/src/WebPart/WebPart.manifest.json b/src/WebPart/WebPart.manifest.json index e897928..9248370 100644 --- a/src/WebPart/WebPart.manifest.json +++ b/src/WebPart/WebPart.manifest.json @@ -19,10 +19,10 @@ "default": "Other" }, "title": { - "default": "Diagram Frame" + "default": "Diagram Frame", "de-de": "Diagramm Frame" }, "description": { - "default": "The web part is a specialized widget to display a Microsoft Visio diagram in a modern SharePoint page. Similar to the 'Visio Web Access' web part in 'classic' SharePoint. Enables default zoom, page, chrome, and interactivity settings." + "default": "The web part is a specialized widget to display a Microsoft Visio diagram in a modern SharePoint page. Similar to the 'Visio Web Access' web part in 'classic' SharePoint. Enables default zoom, page, chrome, and interactivity settings.", "de-de": "Dieses Web Part ist ein erweitertes Widgket um Microsoft Visio Diagramme in Modernen Sharepoint Seiten anzuzeigen. (Ähnlich des 'Visio Web Access' Web Part im klassischen SharePoint.) Ermöglicht Standardzoom und Seite einzustellen sowie weitere Interaktionsmöglichkeiten." }, "fullPageAppIconImageUrl": "https://unmanagedvisio.com/upload/spfx/diagram-frame-icon-11.svg", "iconImageUrl": "https://unmanagedvisio.com/upload/spfx/diagram-frame-icon-11.svg", diff --git a/src/loc/de-de.js b/src/loc/de-de.js index 6a3e6de..87fad92 100644 --- a/src/loc/de-de.js +++ b/src/loc/de-de.js @@ -22,6 +22,28 @@ define([], function () { "FieldHeightDescription": "Specify height value and units", "FieldWidthDescription": "Specify width value and units", "FieldStartPageDescription": "Gibt die Seite (Name) an, die beim Start geladen wird.", - "FieldZoomDescription": "Gibt die Zoom Stärke (%) beim laden der Grafik an." + "FieldZoomDescription": "Gibt die Zoom Stärke (%) beim laden der Grafik an.", + "FieldConfigureLabel": "Konfigurieren", + "Error": "Fehler", + "Edit": "Editieren", + "placeholderIconTextUnableShowVisio": "Kann das Visio Diagramm nicht anzeigen.", + "placeholderIconTextVisioNotSelected": "Noch kein Visio Diagramm ausgewählt.", + "placeholderIconTextPleaseclickBrowse": "Bitte klick auf die 'Öffnen...' Schaltfläche im Konfigurationspanel um das Diagramm auszuwählen.", + "placeholderIconTextPleaseclickSettings": "Bitte klick auf 'Einstellungen' im Tab um dieses Web Part zu konfigurieren.", + "placeholderIconTextPleaseclickEdit": "Bitte klick 'Editieren' und starte das Bearbeiten der Seite um den Web Part zu konfigurieren.", + "placeholderIconTextPleaseclickConfigure": "Klicke auf die 'Konfigurieren' Schaltfläche um dieses Web Part zu konfigurieren.", + "messageWasTheFileDeleted": "Wurde die Datei gelöscht?", + "messageArePermissionsMissing": "Fehlen Berechtigungen zum Öffnen?", + "messageSomethingWentWrongResolveURL": "Irgendetwas ist schief gelaufen beim Auflösen der URL:", + "messageCannotResolveFileURL": "Kann die Datei URL nicht auflösen:", + "messageVisioFileNotFound": "Die mit diesem Web Part verknüpfte Visio Datei wurde nicht gefunden.", + "messageVisioFileCannotAccessed": "Auf die mit diesem Web Part verknüpfte Visio Datei kann nicht zugegriffen werden.", + "percOfScreen": "% vom Bildschirm", + "percOfFrame": "% vom Widgetbereich", + "centimeters": "Zentimeter", + "inches": "Inch", + "millimeters": "Millimeter", + "points": "Punkte", + "pixels": "Pixel" } }); diff --git a/src/loc/en-us.js b/src/loc/en-us.js index 512a7ce..47e6b8a 100644 --- a/src/loc/en-us.js +++ b/src/loc/en-us.js @@ -22,6 +22,27 @@ define([], function () { "FieldHeightDescription": "Specify height value and units", "FieldWidthDescription": "Specify width value and units", "FieldStartPageDescription": "Page (name) to activate on load", - "FieldZoomDescription": "Zoom level (percents) to set on load" + "FieldZoomDescription": "Zoom level (percents) to set on load", + "Error": "Error", + "Edit": "Edit", + "placeholderIconTextUnableShowVisio": "Unable to show this Visio diagram", + "placeholderIconTextVisioNotSelected": "Visio diagram not selected", + "placeholderIconTextPleaseclickBrowse": "Please click 'Browse...' Button on configuration panel to select the diagram.", + "placeholderIconTextPleaseclickSettings": "Please click 'Settings' menu on the Tab to reconfigure this web part.", + "placeholderIconTextPleaseclickEdit": "Please click 'Edit' to start page editing to reconfigure this web part.", + "placeholderIconTextPleaseclickConfigure": "Click 'Configure' button to reconfigure this web part.", + "messageWasTheFileDeleted": "Was the file deleted?", + "messageArePermissionsMissing": "Are some permissions missing?", + "messageSomethingWentWrongResolveURL": "Something went wrong when resolving file URL:", + "messageCannotResolveFileURL": "Cannot resolve file URL:", + "messageVisioFileNotFound": "The Visio file this web part is connected to is not found at the URL", + "messageVisioFileCannotAccessed": "The Visio file this web part is connected to cannot be accessed at the URL", + "percOfScreen": "% of the screen", + "percOfFrame": "% of the frame", + "centimeters": "centimeters", + "inches": "inches", + "millimeters": "millimeters", + "points": "points", + "pixels": "pixels" } }); diff --git a/src/loc/strings.d.ts b/src/loc/strings.d.ts index 958af20..c8eb1bb 100644 --- a/src/loc/strings.d.ts +++ b/src/loc/strings.d.ts @@ -22,6 +22,28 @@ declare interface IWebPartStrings { FieldWidthDescription: string; FieldStartPageDescription: string; FieldZoomDescription: string; + FieldConfigureLabel: string; + Error: string; + Edit: string; + placeholderIconTextUnableShowVisio: string; + placeholderIconTextVisioNotSelected: string; + placeholderIconTextPleaseclickBrowse: string; + placeholderIconTextPleaseclickSettings: string; + placeholderIconTextPleaseclickEdit: string; + placeholderIconTextPleaseclickConfigure: string; + messageWasTheFileDeleted: string; + messageArePermissionsMissing: string; + messageCannotResolveFileURL: string; + messageSomethingWentWrongResolveURL: string; + messageVisioFileNotFound: string; + messageVisioFileCannotAccessed: string; + percOfScreen: string; + percOfFrame: string; + centimeters: string; + inches: string; + millimeters: string; + points: string; + pixels: string; } declare module 'WebPartStrings' {