scribe-org / Scribe-i18n

Application text localization files for Scribe apps
GNU General Public License v3.0
1 stars 4 forks source link

Create GitHub action to update the .xcstrings file from Scribe-i18n #8

Closed andrewtavis closed 2 weeks ago

andrewtavis commented 1 month ago

Terms

Description

Related to scribe-org/Scribe-i18n#9, it would be great if we created a GitHub Action that would automatically trigger the process in scribe-org/Scribe-i18n#9 when the Scribe-i18n files are updated in this repository. This would dramatically simplify the i18n workflow and make it so that someone doesn't need to run the update script locally.

Contribution

@Jag-Marcel will be working on this as a part of GSoC ☀️ Can you write in here so I can assign? Let us know if and how we can help!

andrewtavis commented 1 month ago

Let us know if you have ideas on this already, @Jag-Marcel :) CC @wkyoshida and @henrikth93 as well, as this actions related work might need a bit of thought on our part to make sure that we're guiding towards a good solution 😊

Jag-Marcel commented 1 month ago

Like with scribe-org/Scribe-i18n#9, it could be better to implement this in Scribe-i18n and have everything in one place. Maybe then it's automatic since it's included in Scribe-iOS?

andrewtavis commented 1 month ago

Thinking about this, and good points 🤔 I think I was getting confused because we hadn't finalized the i18n system yet and also still have the Scribe-i18n files in the build. Writing it out explicitly:

This is as you're thinking about it, @Jag-Marcel?

Jag-Marcel commented 1 month ago

Yeah, that's how I imagined it to work

andrewtavis commented 1 month ago

And here we are in i18n then! 😊 Let's use this as proof of the work on this that you can then reference on Phabricator :)

andrewtavis commented 3 weeks ago

The following is the error for the most recent run, @Jag-Marcel:

Run $diff = git diff --name-only HEAD^ HEAD
fatal: ambiguous argument 'HEAD^': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-[10](https://github.com/scribe-org/Scribe-i18n/actions/runs/9490739220/job/26154796950#step:3:11)-11-github-actions-deprecating-save-state-and-set-output-commands/
Error: Process completed with exit code 1.

Let me know what your thoughts are!

Jag-Marcel commented 3 weeks ago

The following is the error for the most recent run, @Jag-Marcel:

Run $diff = git diff --name-only HEAD^ HEAD
fatal: ambiguous argument 'HEAD^': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-[10](https://github.com/scribe-org/Scribe-i18n/actions/runs/9490739220/job/26154796950#step:3:11)-11-github-actions-deprecating-save-state-and-set-output-commands/
Error: Process completed with exit code 1.

Let me know what your thoughts are!

@andrewtavis If my research and thinking is correct, the first error should be because it doesn't actually fetch any of the recent commits. Maybe something like this could work at line 15:

      - name: Checkout
        uses: actions/checkout@v4
        with:
            fetch-depth: 2

For the second one, it should be json_changed=$HasDiff >> $GITHUB_OUTPUT instead of ::set-output name=json_changed::$HasDiff at 25, I guess the guide I used was a bit outdated. Let me know if it works this way!

andrewtavis commented 3 weeks ago

Do you want to open a PR, @Jag-Marcel, or should I make the changes? Up to you :) Will get it figured out before Saturday either way 😊

Jag-Marcel commented 3 weeks ago

I'll make a PR in a second 👍

andrewtavis commented 3 weeks ago

Thank you, @Jag-Marcel!

andrewtavis commented 3 weeks ago

As discussed, let's test this out in the dev sync and then we can close it afterwards, @Jag-Marcel. Thanks for the persistence here!

andrewtavis commented 2 weeks ago

Closing this out given the state of things 😊 Let's again discuss during the next sync as we were able to in the last one, @Jag-Marcel :)