The user should be able to customize all patterns, including those that come with the module. Yet we must give third-party module developers the confidence that the patterns they use will be available.
To do that, we should allow per-field patterns. Something like this:
$form['ip'] = [
'#type' => 'textfield',
'#title' => t('IP address'),
'#mask' => [
'value' => '099.099.099.099',
'reverse' => FALSE,
'selectonfocus' => FALSE,
'clearifnotmatch' => TRUE,
'translation' => [
'0' => [
'pattern' => '\d',
],
'9' => [
'pattern' => '\d',
'optional' => TRUE,
],
],
],
];
These settings would overwrite the module's global settings for that field.
However, having to write all these translation patterns every time is tedious. So we should provide some method to provide the translation patterns just once per module.
Active
2.1
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.