Mailinglist Archive: yast-devel (42 mails)

< Previous Next >
[yast-devel] translation method `_` produce frozen string
Hi,
I just like to warn you, that method `_` and its variants `n_` can
return frozen string[1].

short: it means that you cannot call instance modifying methods on
result like sub!,gsub! or `<<` otherwise frozen string modification
exception is raised.

long explanation: Gettext for english return what it gets, so it is not
affected in english, but if translation is returned it looks to its map
of translated string and to avoid copying it return frozen instance of
string ( it means you cannot modify translation ). Reason is
performance, as long strings can be quite expensive to copy.

Josef

[1] http://tmm1.net/ruby21-fstrings/
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: yast-devel+owner@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages