Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translations not working. #101

Open
robert-ancell opened this issue Feb 16, 2021 · 1 comment
Open

Translations not working. #101

robert-ancell opened this issue Feb 16, 2021 · 1 comment

Comments

@robert-ancell
Copy link
Contributor

On initialization bindtextdomain needs to be called. Find a way of importing the .po files from Launchpad, or use a different translation system.

@jhenstridge
Copy link
Contributor

In the context of snapd, I had some thoughts about how to integrate Launchpad translations with a Github project, using LP as it is now. It's a bit messy, but the following should work:

To automatically import translations into Launchpad:

  1. make sure the PO template is checked into the source tree. While Launchpad has some code to try and extract a template using intltool, it probably won't work right with non-autotools projects or ones using modern gettext.
  2. On Launchpad, create a Bazaar import of your main github branch, and set the import as the branch for the "trunk" project series (or some other series if you want).
  3. Configure Launchpad to automatically extract translations from the series' development branch.

The regular code import should ensure that new translatable strings show up in Launchpad soon after they're added on Github.

To import translations back into Github, do the following:

  1. Create an empty Bazaar branch under your Launchpad project, and tell LP to commit translation changes to that branch.
  2. Create a Github Actions workflow that is triggered by a schedule. The workflow should do the following:
    • check out the Git repo
    • check out the Bazaar branch from (1)
    • copy the .po files from the Bazaar checkout to the Git checkout
    • If there are any changes on the Git side, commit and push the result.

That should be enough to close the loop. It's a bit of a mess (e.g. it'd be nice if you could avoid the Bazaar branches), and other systems are likely simpler. The main benefit is that you'd get access to translations made in the context of the Ubuntu package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants