Please try the following:
1. Add the following code to the top of your snippet:
include_once( $modx->config['site_path'] . 'assets/modules/yams/class/yams.class.inc.php' );
$yams = YAMS::GetInstance();
2. Call the snippet with the parameter [tt]&langid=`(yams_id)`[/tt] to get the correct language. You could add something like this to your snippet:
/* $langid [ string ]
* This parameter is compulsory.
* The language id.
* Specified as follows: &langid=`(yams_id)`
*/
if ( ! isset($langid) || ! $yams->IsActiveLangId( $langid ) )
{
return '';
}
3. Get the full multilingual URL using [tt]$yams->ConstructResolvedURL( $langid, $id )[/tt], where [tt]$id[/tt] is the id of the document you want the URL to point to. It sounds like you’ll be pointing to the current document, so [tt]$id = $modx->documentIdentifier;[/tt] should do the trick.