Re: Gtk+3 application Internationalization
How is localisation done in the new system? In the same way you localize your application's strings For simple programs, I do not bother to do my own localization, because most of needed words are already available in localization files of GTK and its components. Thus I define: #define A_(String) g_dpgettext ("atk10", String, 0) #define L_(String) g_dpgettext ("glib20", String, 0) #define G_(String) g_dpgettext ("gtk20", String, 0) #define P_(String) g_dpgettext ("gtk20-properties", String, 0) and then I can use for example: G_("File"), P_("Image"), A_("paragraph") and so on. But of course, some of these words are not available in all versions. Another possibility is to use localization files of other programs which also use .mo files (for example GIMP). ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Gtk+3 application Internationalization
Hi; On 14 April 2016 at 17:09, Dave Howorthwrote: >>> I don't know, if I understand it well, that I must translate all >>> strings in my application (copy from Stock Items) one more time to all >>> languages just like Gtk if I want to use them ? >> >> >> It's hardly going to be an issue. > > > I don't understand. With the old method, I chose stock items and > localisation was done automatically by the system, yes? As application > author I didn't have to consider it. It's not "done by the system": GTK carries the translations under its own gettext domain. > How is localisation done in the new system? In the same way you localize your application's strings — either using gettext, or using any other tool that lets you load translated strings given an identifier. These are the developer guidelines and tools used by the GNOME project: https://wiki.gnome.org/TranslationProject/DevGuidelines Ciao, Emmanuele. -- https://www.bassi.io [@] ebassi [@gmail.com] ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Gtk+3 application Internationalization
On 2016-04-14 16:27, Emmanuele Bassi wrote: On 14 April 2016 at 08:30, Ondrej Tumawrote: because Stock Items are deprecated from Gtk+3.10, what can I use, if I want to use gtk locales in my Application. Use your own (localized) string. Better yet, use readable strings that rely on the context of the operation, instead of just random words that the tool kit itself has no way to adapt to your case. I don't know, if I understand it well, that I must translate all strings in my application (copy from Stock Items) one more time to all languages just like Gtk if I want to use them ? It's hardly going to be an issue. I don't understand. With the old method, I chose stock items and localisation was done automatically by the system, yes? As application author I didn't have to consider it. How is localisation done in the new system? I've looked at https://docs.google.com/document/d/1KCVPoYQBqMbDP11tHPpjW6uaEHrvLUmcDPqKAppCY8o/pub but I'm afraid I still don't understand. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Gtk+3 application Internationalization
Hi; On 14 April 2016 at 16:58, Murray Cummingwrote: > On Thu, 2016-04-14 at 16:27 +0100, Emmanuele Bassi wrote: >> > I don't know, if I understand it well, that I must translate all >> > strings in my application (copy from Stock Items) one more time to >> all >> > languages just like Gtk if I want to use them ? >> >> It's hardly going to be an issue. > [snip] > > There are some strings such as Cancel, Close, Quit, File, Edit, Cut, > Copy, Paste that really should be the same in each application. Except that those come with a mnemonic as well, and that's the issue. Again, if somebody is translating "File" for a menu bar, adding a string to applications is not going to be a problem for any translator. > The lack of (useful) stock items makes it harder to make them the same > in each application. It's a genuine concern. They don't always *need* to be the same; and if they need to be the same, then it should be up to the platform guidelines to specify them. The tool kit is not in the position of enforcing that on every platform, for every application, in every possible locale. Ciao, Emmanuele. -- https://www.bassi.io [@] ebassi [@gmail.com] ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Gtk+3 application Internationalization
On Thu, 2016-04-14 at 16:27 +0100, Emmanuele Bassi wrote: > > I don't know, if I understand it well, that I must translate all > > strings in my application (copy from Stock Items) one more time to > all > > languages just like Gtk if I want to use them ? > > It's hardly going to be an issue. [snip] There are some strings such as Cancel, Close, Quit, File, Edit, Cut, Copy, Paste that really should be the same in each application. The lack of (useful) stock items makes it harder to make them the same in each application. It's a genuine concern. I'm not bothered by the lack of things like OK, Yes, and No, which shouldn't be used anyway. -- Murray Cumming murr...@murrayc.com www.murrayc.com ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Gtk+3 application Internationalization
Hi; On 14 April 2016 at 08:30, Ondrej Tumawrote: > because Stock Items are deprecated from Gtk+3.10, what can I use, if I > want to use gtk locales in my Application. Use your own (localized) string. Better yet, use readable strings that rely on the context of the operation, instead of just random words that the tool kit itself has no way to adapt to your case. > I don't know, if I understand it well, that I must translate all > strings in my application (copy from Stock Items) one more time to all > languages just like Gtk if I want to use them ? It's hardly going to be an issue. > Where is benefits of this, sorry, stupid decision. Why do you apologize while simultaneously insulting the judgement of the people that maintain this project, then? You could have avoided saying "stupid" and it would have been fine. > When i use Stock > Items, i have my application base translated to all languages which Gtk > have. How can i do that without Stock Items ? I hope, that I had missed > something. Please tell me what. You missed the fact that the tool kit cannot write anything more complicated that simple words, and that it cannot handle conflicts of mnemonics for you in multiple languages. If you use the stock string for "_Save" and you have another UI element for "_Suspend", GTK cannot know which mnemonic is going to be the right one when you press Alt+S; now expand that potential for collisions to all languages and all strings. It's untenable, and unmaintainable, and one of the reasons why stock strings were deprecated. Ciao, Emmanuele. -- https://www.bassi.io [@] ebassi [@gmail.com] ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Gtk+3 application Internationalization
On Thu, 14 Apr 2016 09:30:10 +0200 Ondrej Tumawrote: > Where is benefits of this, sorry, stupid decision. When i use Stock > Items, i have my application base translated to all languages which Gtk > have. How can i do that without Stock Items ? I hope, that I had missed > something. Please tell me what. I might be wrong, but there are still standard items (they're not called Stock Items anymore). They're not called by their Stock name, but still get translated automatically. They are not in a box called Stock Items, but instead come from Icon Themes: This is the old and new way compared: Old: button = gtk_button_new_from_stock (GTK_STOCK_SAVE); New: button = gtk_button_new_with_mnemonic (_(“_Save”)); Have a look at the announcement of the 'new' way: https://docs.google.com/document/d/1KCVPoYQBqMbDP11tHPpjW6uaEHrvLUmcDPqKAppCY8o/pub John ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list