Skip to content

Translation of error/exception messages? #695

@tenzap

Description

@tenzap

There are a few error messages reported by the library when an NumberParseException is thrown. For example in

if (!static::isViablePhoneNumber($nationalNumber)) {
throw new NumberParseException(
NumberParseException::NOT_A_NUMBER,
'The string supplied did not seem to be a phone number.'
);
}

The labels I identified are:

'The string supplied was too long to parse.'
'The string supplied did not seem to be a phone number.'
'Missing or invalid default region.'
'Could not interpret numbers after plus-sign.'
'The string supplied is too short to be a phone number.'
'The string supplied is too long to be a phone number.'
'The phone-context valid is invalid.'
'Phone number had an IDD, but after this was not long enough to be a viable phone number.'
'Country calling code supplied was not recognised.'

I'm wondering how one could have translations of these and if this would be a good idea. Is it something that would have to be maintained here, or in a supplementary repo, or should each dependent software manage this itself?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions