September 2016
Intermediate to advanced
488 pages
12h 21m
English
Now it’s time to begin providing the translated text. Let’s start with the layout, because 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> |
| | <%= csrf_meta_tags %> |
| | |
| | <%= csrf_meta_tags ... |
Read now
Unlock full access