Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate localisation config #906

Merged
merged 12 commits into from
Aug 3, 2023
2 changes: 1 addition & 1 deletion src/content-handlers/iiif/IIIFContentHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ export default class IIIFContentHandler extends BaseContentHandler<IIIFData>
}

// import the config file
let config = await (extension as any).loadConfig(data.locales[0].name);
let config = await (extension as any).loadConfig(data.locales[0].name, extension?.type.name);

data.config = await that.configure(config);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { IIIFResourceType } from "@iiif/vocabulary/dist-commonjs/";
import { Bools, Strings } from "@edsilv/utils";
import { Thumb, TreeNode, Range } from "manifesto.js";
import "./theme/theme.less";
import defaultConfig from "./config/en-GB.json";
import defaultConfig from "./config/config.json";

export default class Extension extends BaseExtension implements IAVExtension {
$downloadDialogue: JQuery;
Expand All @@ -32,11 +32,7 @@ export default class Extension extends BaseExtension implements IAVExtension {
shareDialogue: ShareDialogue;
defaultConfig: any = defaultConfig;
locales = {
"en-GB": defaultConfig,
"cy-GB": () => import("./config/cy-GB.json"),
"fr-FR": () => import("./config/fr-FR.json"),
"pl-PL": () => import("./config/pl-PL.json"),
"sv-SE": () => import("./config/sv-SE.json"),
"en-GB": defaultConfig
};
lastAvCanvasIndex?: number;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,323 @@
{
"options": {
"allowStealFocus": false,
"authAPIVersion": 1,
"bookmarkThumbHeight": 150,
"bookmarkThumbWidth": 90,
"dropEnabled": true,
"footerPanelEnabled": true,
"headerPanelEnabled": true,
"leftPanelEnabled": true,
"limitLocales": false,
"metrics": [
{
"type": "sm",
"minWidth": 0
},
{
"type": "md",
"minWidth": 768
},
{
"type": "lg",
"minWidth": 1024
},
{
"type": "xl",
"minWidth": 1280
}
],
"multiSelectionMimeType": "application/zip",
"navigatorEnabled": true,
"openTemplate": "http://universalviewer.io?manifest={0}",
"overrideFullScreen": false,
"pagingEnabled": true,
"pagingOptionEnabled": true,
"pessimisticAccessControl": false,
"preserveViewport": false,
"rightPanelEnabled": true,
"saveUserSettings": false,
"clickToZoomEnabled": true,
"searchWithinEnabled": true,
"termsOfUseEnabled": false,
"theme": "uv-en-GB-theme",
"tokenStorage": "session",
"useArrowKeysToNavigate": false,
"zoomToSearchResultEnabled": true
},
"modules": {
"contentLeftPanel": {
"options": {
"autoExpandTreeEnabled": true,
"autoExpandTreeIfFewerThan": 20,
"branchNodesExpandOnClick": false,
"branchNodesSelectable": true,
"defaultToTreeEnabled": false,
"defaultToTreeIfGreaterThan": 0,
"elideCount": 40,
"expandFullEnabled": true,
"galleryThumbChunkedResizingThreshold": 400,
"galleryThumbHeight": 320,
"galleryThumbLoadPadding": 3,
"galleryThumbWidth": 200,
"oneColThumbHeight": 320,
"oneColThumbWidth": 200,
"pageModeEnabled": true,
"panelAnimationDuration": 250,
"panelCollapsedWidth": 30,
"panelExpandedWidth": 255,
"panelOpen": true,
"tabOrder": "",
"thumbsEnabled": true,
"thumbsExtraHeight": 8,
"thumbsImageFadeInDuration": 300,
"thumbsLoadRange": 15,
"treeEnabled": true,
"twoColThumbHeight": 150,
"twoColThumbWidth": 90
},
"content": {
"collapse": "$collapse",
"collapseFull": "$collapseFull",
"date": "$date",
"expand": "$expandContents",
"expandFull": "$expandGallery",
"index": "$index",
"manifestRanges": "$manifestRanges",
"searchResult": "$searchResult",
"searchResults": "$searchResults",
"sortBy": "$sortBy",
"thumbnails": "$thumbnails",
"title": "$contents",
"volume": "$volume"
}
},
"dialogue": {
"topCloseButtonEnabled": false,
"content": {
"close": "$close"
}
},
"footerPanel": {
"options": {
"bookmarkEnabled": false,
"downloadEnabled": true,
"embedEnabled": false,
"feedbackEnabled": false,
"fullscreenEnabled": true,
"minimiseButtons": true,
"moreInfoEnabled": true,
"openEnabled": false,
"printEnabled": false,
"shareEnabled": true
},
"content": {
"bookmark": "$add_to_bookmarks",
"download": "$download",
"embed": "$embed",
"exitFullScreen": "$exitFullScreen",
"feedback": "$feedback",
"fullScreen": "$fullScreen",
"moreInfo": "$moreInfo",
"open": "$open",
"share": "$share"
}
},
"genericDialogue": {
"content": {
"emptyValue": "$emptyValue",
"invalidNumber": "$invalidNumber",
"noMatches": "$noMatches",
"ok": "$ok",
"pageNotFound": "$pageNotFound",
"refresh": "$refresh"
}
},
"headerPanel": {
"options": {
"localeToggleEnabled": false,
"settingsButtonEnabled": true
},
"content": {
"settings": "$settings"
}
},
"helpDialogue": {
"content": {
"text": "$placeholder_text",
"title": "$help"
}
},
"moreInfoRightPanel": {
"options": {
"canvasDisplayOrder": "",
"canvasExclude": "",
"copyToClipboardEnabled": false,
"manifestDisplayOrder": "",
"manifestExclude": "",
"panelAnimationDuration": 250,
"panelCollapsedWidth": 30,
"panelExpandedWidth": 255,
"panelOpen": false,
"rtlLanguageCodes": "ar, ara, dv, div, he, heb, ur, urd",
"showAllLanguages": false,
"textLimit": 4,
"textLimitType": "lines",
"limitToRange": false
},
"content": {
"attribution": "$attribution",
"collapse": "collapseInformation",
"collapseFull": "$collapseGallery",
"description": "$description",
"expand": "$expandInformation",
"expandFull": "$expandGallery",
"holdingText": "$moduleGoesHere",
"less": "$less",
"license": "$license",
"logo": "$logo",
"more": "$more",
"noData": "$noDataToDispla",
"page": "$page",
"title": "$moreInformation",
"manifestHeader": "$aboutTheItem",
"canvasHeader": "$aboutTheImage",
"copyToClipboard": "$copyToClipboard",
"copiedToClipboard": "$copiedToClipboard"
}
},
"avCenterPanel": {
"options": {
"autoPlay": false,
"includeParentInTitleEnabled": false,
"posterImageRatio": 0.3,
"subtitleMetadataField": "contributor",
"titleEnabled": true,
"subtitleEnabled": true
},
"content": {
"attribution": "$attribution",
"currentTime": "$currentTime",
"delimiter": " - ",
"duration": "$duration",
"mute": "$mute",
"next": "$next",
"pause": "$pause",
"play": "$play",
"previous": "$previous"
}
},
"settingsDialogue": {
"content": {
"locale": "$locale",
"navigatorEnabled": "$navigatorEnabled",
"clickToZoomEnabled": "$clickToZoomEnabled",
"pagingEnabled": "$twoPageView",
"reducedMotion": "$reducedMotion",
"preserveViewport": "$preserveViewport",
"title": "$settings",
"website": "$uvWebsite"
}
},
"shareDialogue": {
"options": {
"embedTemplate": "<iframe src=\"{0}\" width=\"{1}\" height=\"{2}\" allowfullscreen frameborder=\"0\"></iframe>",
"instructionsEnabled": false,
"shareFrameEnabled": true
},
"content": {
"customSize": "$custom",
"embed": "$embed",
"embedInstructions": "$embedInstructions",
"height": "$height",
"iiif": "$iiifManifest",
"share": "$share",
"shareInstructions": "$shareInstructions",
"size": "$size",
"width": "$width"
}
},
"authDialogue": {
"content": {
"cancel": "$cancel",
"confirm": "$confirm"
}
},
"clickThroughDialogue": {
"content": {
"viewTerms": "$viewTerms"
}
},
"downloadDialogue": {
"content": {
"currentViewAsJpg": "$currentViewAsJpg",
"currentViewAsJpgExplanation": "$openNewWindow",
"download": "$download",
"downloadSelection": "$downloadSelection",
"downloadSelectionExplanation": "$downloadSelectionExplanation",
"editSettings": "$editSettings",
"entireDocument": "$entireDocument",
"entireFileAsOriginal": "$entireFile",
"entireFileAsOriginalWithFormat": "$entireFileX",
"noneAvailable": "$noDownloadOptionsAvailable",
"pagingNote": "$pagingNote",
"preview": "$preview",
"title": "$download",
"wholeImageHighRes": "$wholeImageHighRes",
"wholeImageHighResExplanation": "$wholeImageHighResExplanation",
"wholeImagesHighRes": "$wholeImagesHighRes",
"wholeImagesHighResExplanation": "$wholeImagesHighResExplanation",
"wholeImageLowResAsJpg": "$wholeImageLowResAsJpg",
"wholeImageLowResAsJpgExplanation": "$wholeImageLowResAsJpgExplanation"
}
},
"loginDialogue": {
"content": {
"login": "$login",
"logout": "$logout",
"cancel": "$cancel"
}
},
"restrictedDialogue": {
"content": {
"cancel": "$cancel"
}
}
},
"localisation": {
"label": "English (GB)",
"locales": [
{
"name": "cy-GB",
"label": "Cymraeg"
},
{
"name": "en-GB",
"label": "English (GB)"
},
{
"name": "fr-FR",
"label": "Français (FR)"
},
{
"name": "pl-PL",
"label": "Polski"
},
{
"name": "sv-SE",
"label": "Svenska"
}
]
},
"content": {
"authCORSError": "$authCORSError",
"authorisationFailedMessage": "$authorisationFailedMessage",
"canvasIndexOutOfRange": "$canvasIndexOutOfRange",
"fallbackDegradedLabel": "$fallbackDegradedLabel",
"fallbackDegradedMessage": "$fallbackDegradedMessage",
"forbiddenResourceMessage": "$forbiddenResourceMessage",
"termsOfUse": "$termsOfUse",
"mediaViewer": "$mediaViewer",
"skipToDownload": "$skipToDownload"
}
}
Loading