Fine Uploader and i18n - internationalization

while most strings which fineuploader sends to end users (not the developer fixing bugs in embedding fine uploader) come from the template, and are hereby easily translateable on the serverside creating that template, I've found some places which don't seem to have this origin?
the place which came to me during using:
confirmMessage: "Are you sure you want to delete {filename}?",
a couple of other strings can be found when grepping through fineuploader-4.2.1.js:
qq.status = {
SUBMITTING: "submitting",
SUBMITTED: "submitted",
REJECTED: "rejected",
QUEUED: "queued",
CANCELED: "canceled",
PAUSED: "paused",
UPLOADING: "uploading",
UPLOAD_RETRYING: "retrying upload",
UPLOAD_SUCCESSFUL: "upload successful",
UPLOAD_FAILED: "upload failed",
DELETE_FAILED: "delete failed",
DELETING: "deleting",
DELETED: "deleted"
return new qq.Promise().failure(imgOrCanvas, "File or URL not found.");
"due to CORS on a user agent that does not support pre-flighting.", "warn");
this._options.callbacks.onError(id, name, "Delete request failed", xhrOrXdr);
this._options.callbacks.onError(id, name, "Delete request failed with response code " + xhrOrXdr.status, xhrOrXdr);
this._options.callbacks.onError(id, name, "XHR returned response code " + xhr.status, xhr);
typeError: "{file} has an invalid extension. Valid extension(s): {extensions}.",
sizeError: "{file} is too large, maximum file size is {sizeLimit}.",
minSizeError: "{file} is too small, minimum file size is {minSizeLimit}.",
emptyError: "{file} is empty, please select files again without it.",
noFilesError: "No files to upload.",
tooManyItemsError: "Too many items ({netItems}) would be uploaded. Item limit is {itemLimit}.",
maxHeightImageError: "Image is too tall.",
maxWidthImageError: "Image is too wide.",
minHeightImageError: "Image is not tall enough.",
minWidthImageError: "Image is not wide enough.",
retryFailTooManyItems: "Retry failed - you have reached your file limit.",
onLeave: "The files are being uploaded, if you leave now the upload will be canceled."
responseProperty: "error",
tooManyFilesError: "You may only drop one file",
unsupportedBrowser: "Unrecoverable error - this browser does not permit file uploading of any kind."
autoRetryNote: "Retrying {retryNum}/{maxAuto}..."
confirmMessage: "Are you sure you want to delete {filename}?",
deletingStatusText: "Deleting...",
deletingFailedText: "Delete failed"
namePromptMessage: "Please name this image"
throw new Error("file with passed id was not added, or already uploaded or canceled");
promise.failure(img, "Problem drawing thumbnail!");
drawPreview.failure(container, "Browser cannot render image!");
drawPreview.failure(container, "Not previewable");
thePromise.failure("No EXIF header to be found!");
did I miss something in the documentation here?
THIA - Cheers,
Willi

The confirm message you mentioned above can be changed in the Fine Uploader UI mode deleteFile options.
Many of the other items listed in your question are easily customizable via options defined in the documentation. For example, see the core messages option and the additional messages option for UI mode. Also, a number of the items listed above are not messages at all, and/or are not passed along directly to the user, such as responseProperty, all of the qq.status items, etc. If there are specific text items that you must override but either cannot due to an oversight in the library, please open up a feature request.

Related

How do I error handle a datasource Access Denied error in PowerQuery?

In PowerQuery, either Excel or PowerBI, I want to trap the error that occurs when I don't have access to a data source.
Problem is that whatever I try, seems to be saying to me that "we can't authenticate you to tell you whether the data source you're trying to access exists"
let
Source = (url as any) =>
let
test = try OData.Feed(url, null, [Implementation="2.0"]),
testResult = if test[HasError] then "No list" else "list is accessible"
in
testResult
in
Source
If I try a different Source approach
test = SharePoint.Tables("https://....sharepoint.com/...)
I still have the same issue.
It's not an http error - it's an authentication issue.

Change error system message in oracle apex

I have a form page and all field is required when press save the below message appear
How i can change this message to custom message "please fill all required fields " , and how i can clear error when enter value (when value change to not null).
I can't see images at the moment.
However, one option might be to create your own validation which returns error text. Something like
if :P1_NAME is null then
return ('Name must be entered');
end if;
Messages are automatically cleared once you submit the page and there are no errors left.
I am not sure if you can change system messages but you can add custom error messages with javascript if a change happens in any item.
Add a change event to the item that runs javascript and use the following code:
var item = apex.item('P1_ITEM').getValue();
if(item == null) {
//First clear the errors
apex.message.clearErrors();
// Now show new errors
apex.message.showErrors([
{
type: "error",
location: [ "page", "inline" ],
pageItem: "P1_ITEM",
message: "Name is required!",
unsafe: false
},
{
type: "error",
location: "page",
message: "Page error has occurred!",
unsafe: false
}
]);
}
However, this will not stop the user from submitting, it only allows you to better display the messages, so you must add the corresponding validations after submit.
If you want to remove the system error message from the required items, you can disable the option of Value Required on item and add a custom validation as they told you in the other response.
If you want to explore all the apex.message options better, I recommend this documentation:
https://docs.oracle.com/database/apex-5.1/AEAPI/apex-message-namespace.htm#AEAPI-GUID-D15040D1-6B1A-4267-8DF7-B645ED1FDA46
More documentation for apex.item:
https://docs.oracle.com/cd/E71588_01/AEAPI/apex-item.htm#AEAPI29448
There are some ways for how to do such things.
Firstly you have the custom Validations you can make, these are awesome and you should really try to use them if possible.
Then there is also the Error message on the saving procedure, but this just throws a custom message on procedure fail so I never use it.
What you appear to be seeing there is that you got an error message and didnt change the fields associated with the error.
If the save procedure is custom, you can also put in an EXCEPTION block before the END, and catch errors there and throw out a custom error with a custom error message.
Another thing I really like is to actually rename some common errors so I dont have to catch them all individually. Say clients may often times try to save identical data, thus breaking the PK. Oracle will throw an error, but the message is good for the developer, but less understandable for the client whom I always assume is a 3 year old kid who can barely read and will cry over everything. So I make an error handling function, add it to apex, and so when the error occurs, it throws a nice message informing the client that they have tried to add some data that already exists.
So, an error handling function associated with APEX, to rename some normal errors.
Good luck

How to fix "unexpected alert open: {Alert text : } " error

I have a project in ruby with AngularJS and I'm currently converting tests over to Headless chrome from Phantomjs, and I keep getting an error:
Selenium::WebDriver::Error::UnhandledAlertError:
unexpected alert open: {Alert text : }
This happens throughout multiple test files..
I have tried adding
"accept_alert {} " before a command :
#from
find('.sp-advanced-configuration').click
#to
accept_alert{ find('.sp-advanced-configuration').click }
but receive
Failure/Error: accept_alert{ ... }
Capybara::ModalNotFound:
Unable to find modal dialog
as well as
Selenium::WebDriver::Error::UnhandledAlertError:
unexpected alert open: {Alert text : }
Not sure what else to try
/*********** *********/
After looking into this further, It seems the issue occurs whenever there are unsaved changes left on the test before moving onto the next test.
Is there a way where you can accept this for every test without having to add
after do
execute_script('window.onbeforeunload = undefined')
end
in every test file?
The reason you're seeing this is that Poltergesit/PhantomJS used to automatically accept unexpected system modals. The selenium driver doesn't do that because your test should actively either accept or decline it. Is find('.sp-advanced-configuration').click the action that opens the alert box? From the errors you're getting I would guess not. The block accept_alert receives needs to be the block that actually triggers the opening of the system modal. This means your code probably needs to be
accept_alert { # action that triggers the alert }
find('.sp-advanced-configuration').click

Find file that generated error CSRF TOKEN

I set up the handler file for whenever there is an error on the server, I receive an email with the details.
So today I received an email with the following error:
array (3) {["message"] => string (0) "" ["file"] => string (104)
"/var/www/infochat/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php"
["line"] => int (71)}
I know what this error is, but the problem is that I do not know what caused it, what file or code it was responsible for.
I did not find anything in the logs (I may have seen the wrong log). Is there somewhere I can check to find out?
There is absolutely no way to tell which file sent it if that's the only thing youre getting from the error stack on your email.
I'd get a cup of coffee, fire up the IDE and start doing a "Find all" for "

In JMeter, "Save Responses to a File", how can I increment the file name while attaching a custom suffix to the end of the file names

In JMeter, when using "Save Responses to a File" to store http responses, how can I increment the file name while attaching a custom suffix to the end of the file names?
Here was my scenario
Recorded http traffic of a file conversion and download from a web site using the Recording Controller and HTTP(S) Test Script Recorder.
I then moved this recorded traffic from the Recording Controller up to my main Thread Group. This allowed me to rerun what I had recorded.
Then, I add a "Save Responses to a file" to the HTTP Request sampler for the "download" action that I had recorded from the web site.
However, I had trouble with the filename incrementing at the end of the file like this:
testFile.txt1
testFile.txt2
testFile.txt3
I wanted this:
testFile1.txt
testFile2.txt
testFile3.txt
Also, if I did not uncheck "Don't add suffix", then "octet-stream" was my file type, which is not what I wanted:
testFile1.octet-stream
testFile2.octet-stream
testFile3.octet-stream
So, how can I properly increment the file name with the correct file extension?
I'd suggest using __counter() function which can be either virtual-user-specific or global as follows:
testFile${__counter(FALSE,)}.txt - for GLOBAL counter
testFile${__counter(TRUE,)}.txt - for SEPARATE counter per Virtual User
I solved this by doing the following:
Right clicked on the HTTP Request I wanted to add the counter and chose Add -> Config Element -> Counter
Set "1" for "Start" and 1 for "Increment".
Named the Counter with the "Reference Name" of "counter"
In the "Save Responses to a file" mentioned above for the "download" traffic, I put "filename${counter}.xxx" for "Filename prefix:" where xxx is the file extension
Still in the "Save Responses to a file", I also checked the boxes for both "Don't add number to prefix" and "Don't add suffix"
I forgot to mention that, for my "Thread Group", I had set "Number of Threads(users)" to "5" and "Loop Count" to 3. This would give me 15 users.
So, keeping that in mind, my files were named all correctly from:
testFile1.txt
testFile2.txt
.
.
.
testFile15.txt
Hope this helps someone as I struggled with this for a little bit :-).

Resources