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

title attributes in anchor tags

parent 3b7672d8
No related branches found
No related tags found
1 merge request!755Note about title attributes in anchor tags
......@@ -99,7 +99,29 @@ The general rules for avoiding errors may be summed up like this:
```smarty
<p>{ts}Hello, world!{/ts}</p>
```
For `title` attributes in `<a>` links, within CiviCRM these usually only appear in links that aren't within a larger block of text or where there is no clickable text, such as a datepicker icon. In this situation, the title text needs to be translated:
!!! failure "Bad"
```smarty
{ts}<a href="https://www.example.org/civicrm/something?reset=1" title="List participants for this event (all statuses)">Participants</a>{/ts}
```
!!! failure "Less bad"
```smarty
<a href="https://www.example.org/civicrm/something?reset=1" title="{ts}List participants for this event (all statuses){/ts}">{ts}Participants{/ts}</a>
```
If there is no clickable text, just translate the title attribute:
!!! success "Good"
```smarty
<a title="{ts}Select Date{/ts}"><i class="crm-i fa-calendar"></i></a>
```
### 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