Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
fixing more i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry de Graaff committed Jan 26, 2021
1 parent 8736694 commit 008591f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 36 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ This Zimlet offers support for Seafile. Read more https://github.com/Zimbra-Comm
3. Running a WebDAV server behind and NGINX reverse proxy (from CentOS or Debian) won't work, it will work when proper options are enabled (as for example with zimbra-proxy, also based on NGINX).
4. Delay of 30 seconds in response from Nextcloud, the brute force login protection has kicked in. Configure X-Forwarded-For see above! Or and this is not recommended: set in your Nextcloud the preference `'auth.bruteforce.protection.enabled' => false,` and issue `truncate table bruteforce_attempts;`
5. Download menu option does not work on Safari on iPad, solution: disable pop-up blocker
6. Public link sharing does not work. Install the `File sharing` app on Nextcloud and disable Password Policy (if needed). Also you must have (re)sharing rights in Nextcloud for public link share to work.

See:
https://github.com/Zimbra-Community/owncloud-zimlet/wiki/Troubleshooting
Expand Down
26 changes: 11 additions & 15 deletions zimlet/OwnCloudListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,37 +430,33 @@ OwnCloudListView.prototype._sendFileListener = function(ev) {
if(owncloud_zimlet_disable_ocs_public_link_shares != 'true')
{
html += '<tr><td><input type="radio" checked name="ownCloudZimletShareTypeSelector" id="ownCloudZimletShareTypeSelectorPublic" value="public"></td><td>'
+(zimletInstance.getMessage('publicLinkFileFolder') != '' ?
zimletInstance.getMessage('publicLinkFileFolder')
: ZmMsg.shareWithPublic)
+(zimletInstance.getMessage('publicLinkFileFolder').indexOf('???') == 0 ?
ZmMsg.shareWithPublic :zimletInstance.getMessage('publicLinkFileFolder')
)
+'</td></tr>';
var passwordPlaceholder = '';
if (tk_barrydegraaff_owncloud_zimlet_HandlerObject.settings['owncloud_zimlet_link_enforce_password'] == 'true')
{
passwordPlaceholder = zimletInstance.getMessage('requiredPassword') != '' ?
zimletInstance.getMessage('requiredPassword')
: (ZmMsg.requiredLabel).toLowerCase() + ' ' + (ZmMsg.password).toLowerCase();
passwordPlaceholder = zimletInstance.getMessage('requiredPassword').indexOf('???') == 0 ?
(ZmMsg.requiredLabel).toLowerCase() + ' ' + (ZmMsg.password).toLowerCase() : zimletInstance.getMessage('requiredPassword');
}
else
{
passwordPlaceholder = zimletInstance.getMessage('optionalPassword') != '' ?
zimletInstance.getMessage('optionalPassword')
: (ZmMsg.optionalInvitees).toLowerCase() + ' ' + (ZmMsg.password).toLowerCase();
passwordPlaceholder = zimletInstance.getMessage('optionalPassword').indexOf('???') == 0 ?
(ZmMsg.optionalInvitees).toLowerCase() + ' ' + (ZmMsg.password).toLowerCase() : zimletInstance.getMessage('optionalPassword');
}
html += '<tr><td></td><td><input placeholder="'+passwordPlaceholder+'" id="tk_barrydegraaff_owncloud_zimlet-sharedLinkPass" type="sharePassword"></td></tr>';

var expiryDateLabel = '';
if (tk_barrydegraaff_owncloud_zimlet_HandlerObject.settings['owncloud_zimlet_link_enforce_date'] == 'true')
{
expiryDateLabel = zimletInstance.getMessage('requiredExpiryDate') != '' ?
zimletInstance.getMessage('requiredExpiryDate')
: zimletInstance.getMessage('expiryDate') + " ("+ZmMsg.requiredLabel.toLowerCase().replace(":","")+")";
expiryDateLabel = zimletInstance.getMessage('requiredExpiryDate').indexOf('???') == 0 ?
zimletInstance.getMessage('expiryDate') + " ("+ZmMsg.requiredLabel.toLowerCase().replace(":","")+")" : zimletInstance.getMessage('requiredExpiryDate');
}
else
{
expiryDateLabel = zimletInstance.getMessage('optionalExpiryDate') != '' ?
zimletInstance.getMessage('optionalExpiryDate')
: zimletInstance.getMessage('expiryDate') + " ("+ZmMsg.optionalLabel.toLowerCase().replace(":","")+")";
expiryDateLabel = zimletInstance.getMessage('optionalExpiryDate').indexOf('???') == 0 ?
zimletInstance.getMessage('expiryDate') + " ("+ZmMsg.optionalLabel.toLowerCase().replace(":","")+")" : zimletInstance.getMessage('optionalExpiryDate');
}

//prevent selection of day in the past
Expand Down
28 changes: 12 additions & 16 deletions zimlet/OwnCloudTabView.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ function OwnCloudTabView(parent, zimletCtxt, davConnector, ownCloudConnector, oc
checked: true,
name: 'ownCloudZimletShareTypeSelector'
});
this._checkboxf.setText(zimletInstance.getMessage('attachFileFolder') != '' ?
zimletInstance.getMessage('attachFileFolder')
: ZmMsg.attach.charAt(0).toUpperCase() + ZmMsg.attach.slice(1) + " " + (ZmMsg.file).toLowerCase() + "/" + (ZmMsg.folder).toLowerCase());
this._checkboxf.setText(zimletInstance.getMessage('attachFileFolder').indexOf('???') == 0 ?
ZmMsg.attach.charAt(0).toUpperCase() + ZmMsg.attach.slice(1) + " " + (ZmMsg.file).toLowerCase() + "/" + (ZmMsg.folder).toLowerCase() : zimletInstance.getMessage('attachFileFolder'));

this._tree = new DwtTree({
parent: this,
Expand All @@ -53,9 +52,9 @@ function OwnCloudTabView(parent, zimletCtxt, davConnector, ownCloudConnector, oc
style: DwtCheckbox.TEXT_RIGHT,
name: 'ownCloudZimletShareTypeSelector'
});
this._checkbox.setText(zimletInstance.getMessage('publicLinkFileFolder') != '' ?
zimletInstance.getMessage('publicLinkFileFolder') :
ZmMsg.shareWithPublic + " " + (ZmMsg.linkTo).toLowerCase() + " " + (ZmMsg.file).toLowerCase() + "/" + (ZmMsg.folder).toLowerCase());
this._checkbox.setText(zimletInstance.getMessage('publicLinkFileFolder').indexOf('???') == 0 ?
ZmMsg.shareWithPublic + " " + (ZmMsg.linkTo).toLowerCase() + " " + (ZmMsg.file).toLowerCase() + "/" + (ZmMsg.folder).toLowerCase() : zimletInstance.getMessage('publicLinkFileFolder'));


this._sharePasswordTxt = new DwtText({
parent: this,
Expand All @@ -73,23 +72,20 @@ function OwnCloudTabView(parent, zimletCtxt, davConnector, ownCloudConnector, oc
}
else
{
this._sharePassword._inputField.placeholder = zimletInstance.getMessage('optionalPassword') != '' ?
zimletInstance.getMessage('optionalPassword')
: (ZmMsg.optionalInvitees).toLowerCase() + " " + (ZmMsg.password).toLowerCase();
this._sharePassword._inputField.placeholder = zimletInstance.getMessage('optionalPassword').indexOf('???') == 0 ?
(ZmMsg.optionalInvitees).toLowerCase() + " " + (ZmMsg.password).toLowerCase() : zimletInstance.getMessage('optionalPassword');
}

var expiryDateLabel = '';
if (tk_barrydegraaff_owncloud_zimlet_HandlerObject.settings['owncloud_zimlet_link_enforce_date'] == 'true')
{
expiryDateLabel = zimletInstance.getMessage('requiredExpiryDate') != '' ?
zimletInstance.getMessage('requiredExpiryDate')
: zimletInstance.getMessage('expiryDate') + " ("+ZmMsg.requiredLabel.toLowerCase().replace(":","")+")";
expiryDateLabel = zimletInstance.getMessage('requiredExpiryDate').indexOf('???') == 0 ?
zimletInstance.getMessage('expiryDate') + " ("+ZmMsg.requiredLabel.toLowerCase().replace(":","")+")" : zimletInstance.getMessage('requiredExpiryDate');
}
else
{
expiryDateLabel = zimletInstance.getMessage('optionalExpiryDate') != '' ?
zimletInstance.getMessage('optionalExpiryDate')
: zimletInstance.getMessage('expiryDate') + " ("+ZmMsg.optionalLabel.toLowerCase().replace(":","")+")";
expiryDateLabel = zimletInstance.getMessage('optionalExpiryDate').indexOf('???') == 0 ?
zimletInstance.getMessage('expiryDate') + " ("+ZmMsg.optionalLabel.toLowerCase().replace(":","")+")" : zimletInstance.getMessage('optionalExpiryDate');
}

this._shareExpiryDate = new DwtInputField({
Expand All @@ -100,7 +96,7 @@ function OwnCloudTabView(parent, zimletCtxt, davConnector, ownCloudConnector, oc
//Internet Explorer 11 does not like `.type = 'date'`, if
//we drop support for IE11, we can enable a date picker here
//this._shareExpiryDate._inputField.type = 'date';
this._shareExpiryDate._inputField.placeholder = zimletInstance.getMessage('datePlaceholder');
this._shareExpiryDate._inputField.placeholder = zimletInstance.getMessage('datePlaceholder').indexOf('???') == 0 ? "YYYY-MM-DD" : zimletInstance.getMessage('datePlaceholder');

var expiryDays = '';
if (tk_barrydegraaff_owncloud_zimlet_HandlerObject.settings['owncloud_zimlet_link_expiry_days'] != '')
Expand Down
7 changes: 2 additions & 5 deletions zimlet/tk_barrydegraaff_owncloud_zimlet.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the Zimbra ownCloud Zimlet project.
Copyright (C) 2015-2021 Barry de Graaff
Copyright (C) 2015-2019 Barry de Graaff
Bugs and feedback: https://github.com/barrydegraaff/owncloud-zimlet/issues
Expand Down Expand Up @@ -761,10 +761,7 @@ ownCloudZimlet.prototype.showAttachmentDialog =
function() {
var attachDialog = this._attachDialog = appCtxt.getAttachDialog();
var zimletInstance = appCtxt._zimletMgr.getZimletByName('tk_barrydegraaff_owncloud_zimlet').handlerObject;
attachDialog.setTitle(zimletInstance.getMessage('attachFrom') != '' ?
AjxMessageFormat.format(zimletInstance.getMessage('attachFrom'),
[zimletInstance._zimletContext.getConfig("owncloud_zimlet_app_title")])
: ZmMsg.attach + ' ' + (ZmMsg.from).toLowerCase() + ' ' + zimletInstance._zimletContext.getConfig("owncloud_zimlet_app_title"));
attachDialog.setTitle(zimletInstance._zimletContext.getConfig("owncloud_zimlet_app_title"));
this.removePrevAttDialogContent(attachDialog._getContentDiv().firstChild);

if (!this.AttachContactsView || !this.AttachContactsView.attachDialog){
Expand Down

0 comments on commit 008591f

Please sign in to comment.