Skip to content

New command: make-mo #141

Closed
Closed

Description

@slaFFik

Some 3rd party translation services/solutions can provide a .po file only.
And a lot of manual work is needed to generate .mo files out of them (imagine several plugins translated into several languages - and multiple to get the number of .mo files needed to be generated manually).
It would be helpful, if there was a wp i18n make-mo command, that should accept the directory with .po files and output generated .mo files with the same name.

Activity

  1. swissspidy commented on Feb 6, 2019

    @swissspidy
    Member

    Related: #126

  2. EvanShaw commented on May 20, 2020

    @EvanShaw

    @slaFFik You can accomplish what you're looking for with the following:

    find ./languages -name "*.po" | sed 's/\.po//g' | xargs -I % msgfmt %.po -o %.mo

    Of course, this solution assumes you're on a UNIX system, your .po files exist in a folder named languages, and you have gettext installed and in your PATH...

    It would really be nice if there was a platform agnostic make-mo command. @swissspidy Is there any plan to make one?

  3. swissspidy commented on May 20, 2020

    @swissspidy
    Member

    @EvanShaw At the moment I personally don't have much time to look into this, but contributions would be always welcome :-) Otherwise we'll get to this eventually.

  4. added a commit that references this issue on Jun 2, 2020
    2ecf5e6
  5. slaFFik commented on Jun 4, 2020

    @slaFFik
    Author

    I think README.md should be updated as well with this new command.

  6. schlessera commented on Jun 4, 2020

    @schlessera
    Member

    I think README.md should be updated as well with this new command.

    Yes, it should. I'm currently experimenting with automating this via a GitHub Actions workflow, so keeping this open for testing.

  7. added a commit that references this issue on Jan 6, 2022
    1d889f3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions