Merge pull request #3750 from matrix-org/t3chguy/m_too_large
Internationalise M_TOO_LARGE error from Synapsepull/21833/head
						commit
						a13ee490e8
					
				| 
						 | 
				
			
			@ -25,7 +25,7 @@ import MatrixClientPeg from '../../MatrixClientPeg';
 | 
			
		|||
import Resend from '../../Resend';
 | 
			
		||||
import * as cryptodevices from '../../cryptodevices';
 | 
			
		||||
import dis from '../../dispatcher';
 | 
			
		||||
import { messageForResourceLimitError } from '../../utils/ErrorUtils';
 | 
			
		||||
import {messageForResourceLimitError, messageForSendError} from '../../utils/ErrorUtils';
 | 
			
		||||
 | 
			
		||||
const STATUS_BAR_HIDDEN = 0;
 | 
			
		||||
const STATUS_BAR_EXPANDED = 1;
 | 
			
		||||
| 
						 | 
				
			
			@ -272,7 +272,7 @@ module.exports = createReactClass({
 | 
			
		|||
                unsentMessages[0].error.data &&
 | 
			
		||||
                unsentMessages[0].error.data.error
 | 
			
		||||
            ) {
 | 
			
		||||
                title = unsentMessages[0].error.data.error;
 | 
			
		||||
                title = messageForSendError(unsentMessages[0].error.data) || unsentMessages[0].error.data.error;
 | 
			
		||||
            } else {
 | 
			
		||||
                title = _t('%(count)s of your messages have not been sent.', { count: unsentMessages.length });
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -301,6 +301,7 @@
 | 
			
		|||
    "No homeserver URL provided": "No homeserver URL provided",
 | 
			
		||||
    "Unexpected error resolving homeserver configuration": "Unexpected error resolving homeserver configuration",
 | 
			
		||||
    "Unexpected error resolving identity server configuration": "Unexpected error resolving identity server configuration",
 | 
			
		||||
    "The message you are trying to send is too large.": "The message you are trying to send is too large.",
 | 
			
		||||
    "This homeserver has hit its Monthly Active User limit.": "This homeserver has hit its Monthly Active User limit.",
 | 
			
		||||
    "This homeserver has exceeded one of its resource limits.": "This homeserver has exceeded one of its resource limits.",
 | 
			
		||||
    "Please <a>contact your service administrator</a> to continue using the service.": "Please <a>contact your service administrator</a> to continue using the service.",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -49,6 +49,12 @@ export function messageForResourceLimitError(limitType, adminContact, strings, e
 | 
			
		|||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function messageForSendError(errorData) {
 | 
			
		||||
    if (errorData.errcode === "M_TOO_LARGE") {
 | 
			
		||||
        return _t("The message you are trying to send is too large.");
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function messageForSyncError(err) {
 | 
			
		||||
    if (err.errcode === 'M_RESOURCE_LIMIT_EXCEEDED') {
 | 
			
		||||
        const limitError = messageForResourceLimitError(
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue