Skip to content
Snippets Groups Projects
Commit cff03403 authored by DaveD's avatar DaveD
Browse files

clarify anchor links

parent b16fdcec
No related branches found
No related tags found
1 merge request!751Clarify how to use anchor links with ts
......@@ -99,7 +99,21 @@ The general rules for avoiding errors may be summed up like this:
```smarty
<p>{ts}Hello, world!{/ts}</p>
```
Hyperlinks within larger blocks of text are an exception to this rule, where you should place the `<a>` tags within the `ts`. Any link parameters should be provided as arguments to the ts. For example:
!!! failure "Bad"
```smarty
{ts}Here is a block of text with a link to the <a href="https://www.civicrm.org" target="_blank">CiviCRM Web Site</a>.{/ts}
```
!!! success "Less bad"
```smarty
{ts 1='href="https://www.civicrm.org" target="_blank"'}Here is a block of text with a link to the <a %1>CiviCRM Web Site</a>.{/ts}
```
### Avoid multi-line strings
Even if your code editor may not like it, long strings should be on a single line since a change in indentation might change where the line breaks are, which would then require re-translating the string.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment