yast/y2r

YCP "textdomain" keyword not correctly translated inside functions

Closed this issue · 1 comments

The 2nd installation stage logs this error:

ycp/wfm.rb:85 Client call failed with undefined method
`include' for #<YCP::ProviderClass:0x000000026fae58> and backtrace
["/usr/share/YaST2/modules/Provider.rb:65:in `Read'" ...

The relevant YCP code from Provider.ycp

textdomain "country";
country_names = (map) eval(country_names);
textdomain "network";

is translated to

include I18n
textdomain "country"
country_names = Builtins.eval(country_names)
include I18n
textdomain "network"

After removing the include I18n statements no error is logged.

So it seems that the include is needed only at the top level at the class definition, inside methods it causes a crash.

@jreidinger Do you see any problem with just including I18n in every generated class (representing a client/module)? If not, I'd just always generate the include and avoid generating it as part of translating the textdomain statement.