Skip to content

Commit 96918d8

Browse files
[hotfix] Fix key translations and message to no content selected
- adjusted wrong key names for some translations - adjusted the controller to not throw errors if no content is selected while the widget is opened
1 parent ae2702b commit 96918d8

3 files changed

Lines changed: 15 additions & 8 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Gradle Project settings
22
projectName = imageshop
3-
version = 2.0.5
3+
version = 2.0.6
44

55
# XP App values
66
appDisplayName = ImageShop

src/main/resources/admin/widgets/iimage/iimage.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,21 @@ exports.get = function (req) {
1010
const contentId = req.params.contentId
1111
const sitesWithIImageAppInstalled = libs.iimage.getSitesWithIImageAppInstalled()
1212

13+
if (!contentId) {
14+
return {
15+
contentType: 'text/html',
16+
body: `<widget class="error">${libs.iimage.translate('iimage.widget.context_panel.fragments.no_content_selected')}</widget>`
17+
}
18+
}
19+
1320
if (!sitesWithIImageAppInstalled.length) {
1421
return {
1522
contentType: 'text/html',
1623
body: `<widget class="error">${libs.iimage.translate('iimage.widget.context_panel.fragments.app_not_installed')}</widget>`
1724
}
1825
}
1926

20-
if (!contentId && sitesWithIImageAppInstalled.length > 1) {
27+
if (sitesWithIImageAppInstalled.length > 1) {
2128
return {
2229
contentType: 'text/html',
2330
body: `<widget class="error">${libs.iimage.translate('iimage.widget.context_panel.fragments.app_installed_in_multiples_sites')}</widget>`

src/main/resources/i18n/phrases.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ iimage.site.iimage_document_prefix.help-text = Standard document code prefix use
1717
iimage.site.iimage_sizes = Sizes
1818
iimage.site.iimage_sizes.help-text = Format: name;size. Example: Stor 640x480;640x480
1919
iimage.site.language = Language Settings
20-
image.site.iimage_language = Language
21-
image.site.iimage_language.help-text = Standard language to ge image information (alternative text and caption) from. Example: "no", "en", "nn" etc.
22-
image.site.iimage_language_alt_label = Alt-text name
23-
image.site.iimage_language_alt_label.help-text = Alternative text name to be searched in the ImagShop response
24-
image.site.iimage_language_caption = Image caption name
25-
image.site.iimage_language_caption.help-text = Image caption name to be searched in the ImagShop response
20+
iimage.site.iimage_language = Language
21+
iimage.site.iimage_language.help-text = Standard language to ge image information (alternative text and caption) from. Example: "no", "en", "nn" etc.
22+
iimage.site.iimage_language_alt_label = Alt-text name
23+
iimage.site.iimage_language_alt_label.help-text = Alternative text name to be searched in the ImagShop response
24+
iimage.site.iimage_language_caption = Image caption name
25+
iimage.site.iimage_language_caption.help-text = Image caption name to be searched in the ImagShop response
2626

2727
iimage.x-data.callback_url = Callback URL
2828
iimage.x-data.document_id = ImageShop ID

0 commit comments

Comments
 (0)