Skip to content

Get rid of intltool #1692

Open
Open

Description

@rodolforg

Intltool "used to be used" for translation instead of direct gettext, due to the latter doesn't scan some file types.

Gnome originally developed intltool, but dropped it few years ago, because gettext evolved.
Since version 0.18.3 (Aug'13), gettext supports string extraction from .glade files.
Version 0.19 (Jun'14) added support for .desktop and .gsettings files.

As we target Gtk >= 3.14, and its initial release was Sep'14, I think we should migrate from intltool to gettext :)

Gnome tell us how they did it:
https://wiki.gnome.org/MigratingFromIntltoolToGettext

Activity

  1. added this to the v1.6.0 milestone on Sep 4, 2020
  2. DhairyaBahl commented on Oct 24, 2020

    @DhairyaBahl
    Member

    @ice0 @rodolforg

    I would like to work on this issue. Kindly assign it to me. Thanks :)

  3. DhairyaBahl commented on Oct 24, 2020

    @DhairyaBahl
    Member

    @ice0 @rodolforg
    Kindly tell me if I have to remove every existance of intltools. what if it causes any problems to the code or gettext is already properly applied in the code as i can see in the .sh files.

    and please also tell me what version of gettext do i have to apply. U guys mentioned >=3.14 for gtk but the versions of gettext are like 0.2.1 something for the latest one.

    Thanks :)

  4. ice0 commented on Oct 25, 2020

    @ice0
    Collaborator

    what if it causes any problems to the code

    No problem here because all changes are reviewed and tested. If some problems will be found later - they always can be fixed.

    and please also tell me what version of gettext do i have to apply

    Since we are trying to support as many operating systems as possible, it is best to use minimal version possible.
    In your situation this is 0.19 (https://packages.ubuntu.com/xenial/gettext)

  5. DhairyaBahl commented on Oct 25, 2020

    @DhairyaBahl
    Member

    @ice0 Okay got it. Thanks :)

    PS: So I am applying 0.19.7 everywhere which you linked.

  6. DhairyaBahl commented on Oct 25, 2020

    @DhairyaBahl
    Member

    @ice0 @rodolforg

    Work Status Update:
    I am only left with "Addendum: Translate other XML formats" Should I make a pull request till now ??

    Thanks :)

  7. ice0 commented on Oct 26, 2020

    @ice0
    Collaborator

    Sure. At least we can review it, and you can check if it builds successfully on other OS.

  8. DhairyaBahl commented on Nov 7, 2020

    @DhairyaBahl
    Member

    @ice0 @rodolforg

    Work Update: I somehow managed to create the alternative for the function STUDIO_INTLTOOL_MERGE which is STUDIO_GETTEXT_MSGFMT but it is giving error that cannot locate ITS rules for xml.in files rest is working i guess. I would love to have some tips although i am referring to this.
    Thanks :)

    PS: We have to create a ITS file for the xml files, to solve this i guess !!

  9. ice0 commented on Nov 8, 2020

    @ice0
    Collaborator

    @DhairyaBahl I used this link (https://wiki.gnome.org/MigratingFromIntltoolToGettext) to understand how it work.

    but it is giving error that cannot locate ITS rules for xml.in

    Yes, because you need to use itstool instead of msgfmt to merge translations to plugin.xml files.

    Also I suggest to pause work on this issue. Just checked how it works, and in my opinion they did a step back with translating the xml with itstool. Using itstool requires some changes to our translation pipeline, so I need some time to test this.

  10. DhairyaBahl commented on Nov 8, 2020

    @DhairyaBahl
    Member

    @ice0 Okay, No Problem, i am pushing the changes i made in my local machine to this PR for later reference, kindly let me know when we will work on this issue again. :)

    PS: I already pushed those changes in the PR.

  11. DhairyaBahl commented on Nov 12, 2020

    @DhairyaBahl
    Member

    @ice0 I was having an idea, why don't we add gettext to synfig. and when it will become fully functional, then we can remove the intltool. till then let it run on intltool and by this we will keep moving forward on this issue. IDK your call.

    Thanks :)

  12. ice0 commented on Nov 12, 2020

    @ice0
    Collaborator

    @DhairyaBahl we already using gettext :) The last place where intltool is used - is merging translation for the plugin.xml files. Gnome suggest to use ITSTool instead of intltool to translate this files. So I see only CONS here:

    1. We are breaking our current translation pipeline;
    2. We don not remove extra dependency - just switch it to another;
    3. We need extra files (with rules) to do the same work;
    4. We are losing support for old-old-stable distributions.
  13. DhairyaBahl commented on Nov 12, 2020

    @DhairyaBahl
    Member

    @ice0 Okay got it Sorry. Thanks for information :)

  14. rodolforg commented on Jul 26, 2021

    @rodolforg
    ContributorAuthor

    @ice0 as for 0.19.7 version (2015-12-28), it already has native support for ITS rules: https://lists.gnu.org/archive/html/info-gnu/2015-12/msg00013.html

    The Gnome Wiki page we both mentioned says:

    Addendum: Translate other XML formats

    These instructions are outdated and need to be rewritten to use https://www.gnu.org/software/gettext/manual/html_node/Preparing-ITS-Rules.html instead of ITS Tool.

    And its last edition was:

    MigratingFromIntltoolToGettext (last edited 2017-09-11 07:23:06 by PiotrDrag)

    So I believe we could move forward soon.
    Debian Jessie wouldn't support it though https://packages.debian.org/pt-br/jessie/gettext (gettext 0.19.3)
    Debian Stretch would work fine https://packages.debian.org/pt-br/stretch/gettext (gettext 0.19.8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions