March 2025
Intermediate to advanced
472 pages
12h 10m
English
Now it’s time to begin providing the translated text. Let’s start with the layout since it’s pretty visible. We replace any text that needs to be translated with calls to I18n.translate. Not only is this method conveniently aliased as I18n.t, but a helper named t is provided.
The parameter to the translate function is a unique dot-qualified name. We can choose any name we like, but if we use the t helper function provided, names that start with a dot will first be expanded using the name of the template.
So, let’s do that:
| | <!DOCTYPE html> |
| | <html> |
| | <head> |
| | <title>Pragprog Books Online Store</title> |
| | <meta name="viewport" content="width=device-width,initial-scale=1" ... |
Read now
Unlock full access