Fix translations from Sane
ClosedPublic

Authored by ltoscano on Jan 15 2018, 1:25 AM.

Details

Summary

The strings from sane requires a different translation domain.
Wraps the i18n calls to a special function instead of simply
redefining TRANSLATION_DOMAIN because in some files the calls
to *i18n* with the default domain are interleaved with the
i18n calls to strings from Sane.
Remove the old (and now useless) commented porting notes about
re-adding the support for the sane-backends translation domain.

Test Plan

The strings are shown when KSaneWidget is used (for example
inside Skanlite).

Diff Detail

Repository
R382 KSane Library
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ltoscano requested review of this revision.Jan 15 2018, 1:25 AM
ltoscano created this revision.
sars accepted this revision.Jan 15 2018, 6:46 AM

Thanks! Besides the question about the conversion I think this is good to go.

src/options/ksaneoption.h
53

Why the conversion: const char* -> QLatin1String -> const char* ?

This revision is now accepted and ready to land.Jan 15 2018, 6:46 AM
ltoscano added inline comments.Jan 15 2018, 8:38 AM
src/options/ksaneoption.h
53

Because in the process of trying to find the simplest fix, I originally added the call to another place where this dance was required; or at least I did something wrong and it was not workin; and then I didn't try to simplify. It does indeed work without the double conversion; new patch incoming.

ltoscano updated this revision to Diff 25365.Jan 15 2018, 8:38 AM

Simplify sane_i18n, no need for a "string roundtrip"

sars added a comment.Jan 15 2018, 9:26 AM

Thanks for fixing the translation! :) Please commit.

This revision was automatically updated to reflect the committed changes.