Bug 78564 - Untranslatable string due to wrong usage of gettext
Summary: Untranslatable string due to wrong usage of gettext
Status: RESOLVED FIXED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: daemon (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-11 22:09 UTC by Alexander Potashev
Modified: 2014-09-02 14:14 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Alexander Potashev 2014-05-11 22:09:18 UTC
Untranslatable string due to wrong usage of gettext here in src/daemon/main.c, line 271:
    pa_log_info(_("Successfully changed user to \"" PA_SYSTEM_USER "\"."));

Because Gettext can only extract string constants and cannot parse C preprocessor variables, it extracts only the first part - "Successfully changed user to \"". Then, because the whole string along with PA_SYSTEM_USER, etc is passed into the _() call, translation for that is not found and the string is never translated into any language.

Solution: pass PA_SYSTEM_USER as "%s", like this:
    pa_log_info(_("Successfully changed user to \"%s\"."), PA_SYSTEM_USER);
Comment 1 David Henningsson 2014-09-02 14:14:11 UTC
Fixed now:

commit 764da4260a2ab44816d4b1f4c4e709f4684b1b9a
Author: David Henningsson <david.henningsson@canonical.com>
Date:   Tue Sep 2 12:09:44 2014 +0200

    Make all debug/info level messages untranslatable


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.