Skip to content

Commit

Permalink
Merge pull request #13 from Constey/master
Browse files Browse the repository at this point in the history
german translations part2
  • Loading branch information
nbelyh committed Dec 19, 2022
2 parents dbceb4e + ff04463 commit ff5b9c7
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@
"gulp-eslint": "6.0.0",
"typescript": "~4.5.5"
}
}
}
15 changes: 8 additions & 7 deletions src/WebPart/PropertyPaneSizeFieldComponent.tsx
Original file line number Diff line number Diff line change
@@ -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+|%)?/);
Expand All @@ -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);
Expand Down
27 changes: 14 additions & 13 deletions src/WebPart/TopFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 (
<ThemeProvider className={styles.root} style={rootStyle} ref={ref}>
Expand All @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions src/WebPart/WebPart.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
24 changes: 23 additions & 1 deletion src/loc/de-de.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
});
23 changes: 22 additions & 1 deletion src/loc/en-us.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
});
22 changes: 22 additions & 0 deletions src/loc/strings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' {
Expand Down

0 comments on commit ff5b9c7

Please sign in to comment.