Internationalization of RPM spec -
a single rpm spec file has support multiple locale of linux [en & ja]. suppose checks java existing, if not throws exception, "error: java not installed". on japanese machine japanese message should shown. in spec file java_err_msg declared macro. want know how localize below 'java_err_msg' behave summary, group, description, etc.
%define java_err_msg "error: java not installed"
so, spec file picks corresponding message based on locale of pc. looking solution in summary, group, description case based on system locale rpm display appropriate message. below;
summary: appname
summary(ja): appname[in japanese]
group: xyz group
group(ja): xyz group[in japanese]
please let me know better solution.
i assume testing java existence in rpm %pre script let.
if have single message in 2 locales, can test lc_all envvar , hardcode both en , ja messages emitting appropriate.
slightly better write program proper locale handling invoked in %pre script, , emits localized message stderr appropriate.
there no means include i18n error message in rpm header rpm.spec file: i18n tags summary:, group:, , %description.
i'm not sure how throw exception if java not exist. rpm c, not c++, program, , there no exceptions in c.
Comments
Post a Comment