Short: How can I import .po file having dynamic variables in strings like follows
$message = t('Hi @firstname, please follow @sitelink or mail me at @email ', $var);
Indetail:
I've written a custom module to send mail notification to users. In that module $message
string has dynamic variables like follows (sample)
$var = array('@firstname' => $username, '@sitelink' => $GLOBALS['base_url'], @email => $email);
$message = t('Hi @firstname, please follow @sitelink or mail me at @email ', $var);
How can I import $message
string to my site.
I could translate all the static strings to Spanish of other custom modules like follows.
#: mycustom.module
msgid "Are you sure to approve"
msgstr "¿estás seguro de aprobar"
But how can I write the same for Dynamic variables. Right now Spanish Users are getting their mail in English?
Note: I'm just using Drupal core Locale module.