import { htmlEscape } from "./html";
const URL_CORS_DOCS = "https://labelstud.io/guide/storage.html#Troubleshoot-CORS-and-access-problems";
const URL_TAGS_DOCS = "https://labelstud.io/tags";
export default {
DONE: "Done!",
NO_COMP_LEFT: "No more annotations",
NO_NEXT_TASK: "No More Tasks Left in Queue",
NO_ACCESS: "You don't have access to this task",
CONFIRM_TO_DELETE_ALL_REGIONS: "Please confirm you want to delete all labeled regions",
// Tree validation messages
ERR_REQUIRED: ({ modelName, field }) => {
return `Attribute ${field} is required for ${modelName}`;
},
ERR_UNKNOWN_TAG: ({ modelName, field, value }) => {
return `Tag with name ${value} is not registered. Referenced by ${modelName}#${field}.`;
},
ERR_TAG_NOT_FOUND: ({ modelName, field, value }) => {
return `Tag with name ${value} does not exist in the config. Referenced by ${modelName}#${field}.`;
},
ERR_TAG_UNSUPPORTED: ({ modelName, field, value, validType }) => {
return `Invalid attribute ${field} for ${modelName}: referenced tag is ${value}, but ${modelName} can only control ${[]
.concat(validType)
.join(", ")}`;
},
ERR_PARENT_TAG_UNEXPECTED: ({ validType, value }) => {
return `Tag ${value} must be a child of one of the tags ${[].concat(validType).join(", ")}.`;
},
ERR_BAD_TYPE: ({ modelName, field, validType }) => {
return `Attribute ${field} of tag ${modelName} has invalid type. Valid types are: ${validType}.`;
},
ERR_INTERNAL: ({ value }) => {
return `Internal error. See browser console for more info. Try again or contact developers.
${value}`;
},
ERR_GENERAL: ({ value }) => {
return value;
},
// Object loading errors
URL_CORS_DOCS,
URL_TAGS_DOCS,
ERR_LOADING_AUDIO({ attr, url, error }) {
return (
Error while loading audio. Check {attr} field in task.
Technical description: {error}
URL: {htmlEscape(url)}
There was an issue loading URL from ${attr} value.
The request parameters are invalid.
If you are using S3, make sure you’ve specified the right bucket region name.
URL: ${htmlEscape(url)}
There was an issue loading URL from ${attr} value.
Most likely that's because static server has wide-open CORS.
Read more on that here.
Also check that:
URL: ${htmlEscape(url)}
There was an issue loading URL from ${attr} value
Things to look out for:
Technical description: ${error}
URL: ${htmlEscape(url)}