trufont icon indicating copy to clipboard operation
trufont copied to clipboard

Internationalisation

Open pathumego opened this issue 9 years ago • 17 comments

Do we have room for translation of UI later. This could be modules or extensions that is added as langauge packs.

pathumego avatar Jan 17 '16 10:01 pathumego

I think translation files are small enough to just be bundled with the main installer/archive? I'm sure Qt provides all necessary facilities.

madig avatar Jan 27 '16 20:01 madig

I would prefer all translations are bundled

davelab6 avatar Jan 27 '16 20:01 davelab6

I prefer that if it's small files. Having the sytem in place early on would be easier :)

pathumego avatar Jan 27 '16 23:01 pathumego

It was a nightmare running FontForge workshops in Sweden... :)

davelab6 avatar Jan 27 '16 23:01 davelab6

Qt has a good i18n story, it should be a few hours worth of work to get everything in place.

khaledhosny avatar Jan 28 '16 05:01 khaledhosny

@adrientetar is there a specific reason you built the UI by hand? I'm looking at helping out with i18n here to learn PyQt5 and wonder if it can be done solely by using Qt Designer and Linguist.

madig avatar Jan 29 '16 13:01 madig

http://pyqt.sourceforge.net/Docs/PyQt5/i18n.html

madig avatar Jan 29 '16 20:01 madig

is there a specific reason you built the UI by hand?

Well a choice is made somewhere, it's like choosing bw using a CMS and programming your own website I imagine.

adrientetar avatar Jan 29 '16 21:01 adrientetar

I speculate that the specific reason is that this ensures scripting the application is the same as developing its core.

davelab6 avatar Jan 29 '16 21:01 davelab6

No need to justify yourself, I was just wondering if the choice was based on whim or deliberation. I was thinking about redoing the UI in Designer to separate UI construction from implementation, but maybe that's unnecessary busy work. Maybe later ;)

Currently looking into setting up translations.

madig avatar Jan 29 '16 21:01 madig

There's no upside to doing that, and I think explicit programming is preferrable to a WYSIWYG output. Now if you want to separate UI you may want to work on a QtQuick UI. That would be interesting and QtQuick/QML is newer and faster. Using the OpenGL SceneGraph for thr glyphView in particular may be a thing.

/ot

adrientetar avatar Jan 29 '16 22:01 adrientetar

The upside is decluttering the source code, iterating through UI changes faster and getting user-visible text marked for translation automatically. pyuic5 generates plain Python source. Will put QtQuick on my "Maybe" list :)

Have a look at https://github.com/madig/trufont :) There are several things in the font info dialog that I did not mark for translation because they seem to be technical terms. I also did not translate stuff in QComboBoxes because it might break stuff if you read .text and expect English words. Not sure what to do about them.

Oh, and translations will only work if you do the python3 -m defconQt thing, as I haven't found a way yet to get at the translations when invoking trufont. Compile translations into the resource file the icons are in?

madig avatar Jan 30 '16 20:01 madig

Any user visible string should be translatable IMO, technical or not, it is up to each localiser to decide if it makes sense to localise the string for the target language or not.

khaledhosny avatar Jan 30 '16 21:01 khaledhosny

@khaledhosny alright, commited.

@adrientetar how did you package the icons into a resource file? I want to put the translations inside. Also, can I safely mark the items at fontInfo.py:290, 553 and 917?

madig avatar Jan 31 '16 12:01 madig

We have room for translation now :) I'd hold off for now though, the UI still seems volatile.

madig avatar Feb 01 '16 22:02 madig

@madig Ok cool Thanks!!! Can you document How to add a new translation? Maybe to README? or a new doc?

pathumego avatar Feb 01 '16 23:02 pathumego

https://github.com/trufont/trufont/blob/master/Lib/defconQt/translations.pro

:grin:

Hm. Maybe that file should go to the top level?

madig avatar Feb 01 '16 23:02 madig