Select Contact Card dynamic language text

This commit is contained in:
Cüneyt Şentürk
2020-12-29 11:54:36 +03:00
parent 50b6385ed4
commit 8eb020211f
6 changed files with 87 additions and 33 deletions

View File

@ -42,7 +42,7 @@ class SelectContactCard extends Component
*/
public function __construct(
$type, $contact = false, $contacts = [], $search_route = '', $create_route = '',
string $textAddContact = '', string $textCreateNewContact = '', string $textEditContact = '', string $textContactInfo = '', string $textChooseDifferentContact = ''
$textAddContact = '', $textCreateNewContact = '', $textEditContact = '', $textContactInfo = '', $textChooseDifferentContact = ''
)
{
$this->type = $type;
@ -107,10 +107,16 @@ class SelectContactCard extends Component
case 'bill':
case 'expense':
case 'purchase':
$textAddContact = 'vendor';
$textAddContact = [
'general.form.add',
'general.vendors'
];
break;
default:
$textAddContact = 'customer';
$textAddContact = [
'general.form.add',
'general.customers'
];
break;
}
@ -127,10 +133,16 @@ class SelectContactCard extends Component
case 'bill':
case 'expense':
case 'purchase':
$textCreateNewContact = 'vendor';
$textCreateNewContact = [
'general.form.add_new',
'general.vendors'
];
break;
default:
$textCreateNewContact = 'customer';
$textCreateNewContact = [
'general.form.add_new',
'general.customers'
];
break;
}
@ -147,10 +159,16 @@ class SelectContactCard extends Component
case 'bill':
case 'expense':
case 'purchase':
$textEditContact = 'vendor';
$textEditContact = [
'general.form.contact_edit',
'general.vendors'
];
break;
default:
$textEditContact = 'customer';
$textEditContact = [
'general.form.contact_edit',
'general.customers'
];
break;
}
@ -167,10 +185,10 @@ class SelectContactCard extends Component
case 'bill':
case 'expense':
case 'purchase':
$textContactInfo = 'vendor';
$textContactInfo = 'bills.bill_from';
break;
default:
$textContactInfo = 'customer';
$textContactInfo = 'invoices.bill_to';
break;
}
@ -187,10 +205,16 @@ class SelectContactCard extends Component
case 'bill':
case 'expense':
case 'purchase':
$textChooseDifferentContact = 'vendor';
$textChooseDifferentContact = [
'general.form.choose_different',
'general.vendors'
];
break;
default:
$textChooseDifferentContact = 'customer';
$textChooseDifferentContact = [
'general.form.choose_different',
'general.customers'
];
break;
}