function l10n_client_contributor_user_token in Localization client 8
Get user based semi unique token. Ensure keys are unique for each client.
2 calls to l10n_client_contributor_user_token()
- ClientApiKeyDefaultWidget::formElement in l10n_client_contributor/
src/ Plugin/ Field/ FieldWidget/ ClientApiKeyDefaultWidget.php - Returns the form for a single field widget.
- l10n_client_contributor_save_translation in l10n_client_contributor/
l10n_client_contributor.module - Save the suggested translations and it sends them to the localization server.
File
- l10n_client_contributor/
l10n_client_contributor.module, line 131 - Submits translations to a remote localization server.
Code
function l10n_client_contributor_user_token(UserInterface $account) {
$key = \Drupal::service('private_key')
->get();
return md5('l10n_client_contributor' . $account
->id() . $key);
}