I have added custom code to show login & register (header home page) button and both have href links. In another language, the href links must translated. how to achieve the same?
For these to be translatable, the following conditions have to be met:
- The text must be wrapped in gettext calls.
-There must be a textdomain argument.
For example:
$url = __( '<em><u>hidden link</u></em>', 'my-domain' );
printf(
esc_html__( 'By clicking on "Create an account" below, you are agreeing to the %sTerms of service%s', 'my-domain' ),
'<a href="' . $url . '">',
'</a>'
);
Please check our documentation and this for further info and more examples: