OpenPrinting / system-config-printer

Graphical user interface for CUPS administration
GNU General Public License v2.0
163 stars 89 forks source link

Partial translation of printer settings dialog box #79

Closed LAfricain closed 6 years ago

LAfricain commented 6 years ago

After installing a printer, often I have strings good translated (in French for me) but others don't. I did this experience with hp: hp

With epson: epson

and with other models. I looked in the po file, and I couldn't found the words not translated. I searched a lot about this problem, how to translate this strings, but it seems that the ppd file is generated during installation. Currently I translate the ppd file just for me or my friends that don't understand english. But it can be interesting do it once and for all If I can help for translation I would do it willingly.

zdohnal commented 6 years ago

Hi, thank you for reporting this issue - would you mind telling me which strings aren't translated? I'm sorry I don't understand french.

zdohnal commented 6 years ago

Oh, I see - ok, that could be done in s-c-p.

zdohnal commented 6 years ago

Hmm, would you mind telling me which driver for which HP printer causes this issue? I think that can be even issue with ppd itself, not with system-config-printer @LAfricain

LAfricain commented 6 years ago

For the hp it is the HP LaserJet 1018 Foomatic/foo2zjs-z1 (recommended) but this problem is larger, because I meet it with multiple printers Canon, HP, Epson. Translation is quite variable, with some printers there is more translated text than others. I discussed about this already on the french Ubuntu forum (I can found the post if you need), because users wanted to help for translation. For me it was difficult to understand were is really the issue... If the issue is with the ppd how to perform it? But I think that strings as "Printing quality", Printing Density" or "Media type", are always in the printers windows, not just with my printer no?

What is strange for me, it is some are translate, others not... Because if I remember I looked in the sources for this word not translated, but I could find it.

Thanks for help :)

LAfricain commented 6 years ago

I change the title because @alainroger's is better :)

zdohnal commented 6 years ago

@LAfricain I looked into HP LaserJet ppd file and there aren't any translations for other languages. If these string should be translated, it should be in ppd file like this (e.g. from hp laserjet 6p postscript ppd):

*fr.Translation PageSize/Format de page: ""

If such strings are missing in ppd, I'm sorry, s-c-p cannot do much about it. s-c-p calls 'ppdLocalize' CUPS function, which applies strings mentioned above (if available) in ppd. So if you find any ppd, which has such strings and isn't translated in s-c-p, please reopen this issue. I'll close this issue for now, because I think it is not s-c-p fault.

LAfricain commented 6 years ago

So if you find any ppd, which has such strings and isn't translated in s-c-p, please reopen this issue

I can give you a lot of example, here you have one of an epson, and hp. Here a capture with a Canon with partial translation: canon-ir1133

And a Samsung: samsung_m267x

I'll close this issue for now, because I think it is not s-c-p fault.

This is the question who is the "fault"? I search a lot about this. And what is strange it is that some strings are translated in s-c-p other not. For this reason I think there is a way to do it because the strings translated are not taken from the ppd but from the ".mo" s-c-p file.

Example, why "Général" is well translated and "Adjustment" no. Printing Quality no and "Taille des pages" yes...

I can reopen the issue, because I don't have the button :)

zdohnal commented 6 years ago

Ah, I think I know where problem lies - as I told before, translation comes from ppd file from strings like:

*fr.Translation PageSize/Format de page: ""

, but when such line is missing in ppd file, s-c-p tries to translate them by itself - it uses ppdippstr.py, *.po files and pot file. The biggest and main downfall of s-c-p doing translation is I do not know which strings appear in all ppds which user can install (not mentioning its translation to different language than english) - that's why localization should be done in ppd file itself, not in application which use it. So there are two ways now: 1) you create patch for english strings, which you found untranslated and translate them to french and create pull request - because I do not know which english strings you encountered and I do not understand french. (Or provide me english string and translated french string at least) 2) or report this issue on package, where ppd came from - foo2zjs, foomatic, hplip, gutenprint etc. - because IMHO it is more effective to fix it in ppd then in all apps which use it.

If you'll send me a patch or english strings and their french translation, I'll reopen this issue.

LAfricain commented 6 years ago

you create patch for english strings, which you found untranslated and translate them to french and create pull request - because I do not know which english strings you encountered and I do not understand french. (Or provide me english string and translated french string at least)

Ok I can do this. I can find a certain number of lines that come back very frequently. If I create the patch, I need to add the strings in the ppdippstr.py file? I have no idea how to do, but I'm motivating to do it... (I'll do some test, and give you a feedback for checks ok)

The problem with ppd files, it is if we wait the manufacturers... We will never have this strings translated. And If we do, step by step in s-c-p. We will translate it once for all and not in all ppd.

Thank you very much for help! You can reopen the bug.

zdohnal commented 6 years ago

IIRC, english sentences needs to be added to ppdippstr.py file to ppd object (after line 163) in same way as other strings are there - then I can call intltool-update (IIRC), which finds these strings and adds them to system-config-printer.pot file and to all .po files for all languages. Then we can add translation to correct .po files. Problem with this solution is that strings will be translated only in s-c-p. If any other similar app exists, strings in there would be untranslated.

LAfricain commented 6 years ago

Ok I did some additions, I pulled request. See it and say me if it is ok. I add strings 95 to 110 (because of the place in the gui)

zdohnal commented 6 years ago

'intltool-update -r' updated .pot and .po files. It even did some translations itself - would you mind checking them, adding missing french strings and correcting incorrect ones in current commit?

LAfricain commented 6 years ago

Ok I did some tests, it is ok the strings added appear in French great! (Just the title of the windows is now in English "Printers" and not "Imprimantes" and the icon name in the parameters windows) Now I will continue to add the other strings. I have a suggestion, is it possible to use launchpad and rosetta for the translation? It is a very interesting tool to work on translation, and we are more people...

Edit: You are on transifex?

zdohnal commented 6 years ago

Ok, thank you very much for the patch! But would you mind adding english strings in one go (in one patch)? Because I need to run 'intltool-update' again for these new strings and then ask you again to add translations for these strings now. Translations of system-config-printer are on zanata https://fedora.zanata.org/iteration/view/system-config-printer/master/languages/it?dswid=4505

LAfricain commented 6 years ago

But would you mind adding english strings in one go (in one patch)?

Ok no problem!

zdohnal commented 6 years ago

Ok, .po files were regenerated again - would you mind checking+adding french translation?

LAfricain commented 6 years ago

I added still new strings! Now it will be done for a long time... We had misunderstood ... I will add and check new french po.

zdohnal commented 6 years ago

*.po files regenerated again - would you mind checking/adding french translation for these strings and #84 ?

LAfricain commented 6 years ago

Hello, Now I'm waiting new regeneration of the po files. :) But for me this issue is closed.