Whitespace in i18n?

Is it normal or not to use whitespace in i18n? For instance:

<%= gettext("this is my string I want to translate") %>

vs

<%= gettext("my_string1") %>

Is there any downside to using whitespaces?

There is no downside for GetText. It is actually normal that you use text as your keys. This way it’s more clear what it actually is, without needing to look up your key first. Also even if it’s not translated yet, you can see how well it renders (text length, etc)

5 Likes

The idea of gettext is to use “real” text as a translation keys, as it will make it way easier for translators to work on such files.

2 Likes