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

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

Closed
2 tasks done
andrewtavis opened this issue Jun 7, 2024 · 12 comments
Closed
2 tasks done
Assignees
Labels
localization Add or correct localizations

Comments

@andrewtavis
Copy link
Member

andrewtavis commented Jun 7, 2024

Terms

Description

Related to #9, it would be great if we created a GitHub Action that would automatically trigger the process in #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 andrewtavis added help wanted Extra attention is needed blocked Another issue is blocking labels Jun 7, 2024
@andrewtavis
Copy link
Member Author

andrewtavis commented Jun 7, 2024

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
Copy link
Member

Like with #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
Copy link
Member Author

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:

  • We do some localizations in a platform and via a PR those are sent to Scribe-i18n
  • The import triggers the process you created in Implemented conversions between JSON and Xcode files #7
  • We then send over the JSON files and the .xcstrings file to Scribe-iOS via the subtree functionality as parts of Scribe-i18n
  • From there, ONLY the Scribe/i18n/.xcstrings file would be included in the build, so regardless of the fact that the JSON files are in the directory, they won't be included in the build

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

@Jag-Marcel
Copy link
Member

Yeah, that's how I imagined it to work

@andrewtavis andrewtavis transferred this issue from scribe-org/Scribe-iOS Jun 7, 2024
@andrewtavis
Copy link
Member Author

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 andrewtavis added localization Add or correct localizations and removed help wanted Extra attention is needed labels Jun 8, 2024
@andrewtavis
Copy link
Member Author

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
Copy link
Member

Jag-Marcel commented Jun 13, 2024

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
Copy link
Member Author

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
Copy link
Member

I'll make a PR in a second 👍

@andrewtavis
Copy link
Member Author

Thank you, @Jag-Marcel!

@andrewtavis andrewtavis moved this from Todo to In Progress in Scribe Board Jun 13, 2024
@andrewtavis andrewtavis removed the blocked Another issue is blocking label Jun 13, 2024
@andrewtavis
Copy link
Member Author

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
Copy link
Member Author

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 :)

@github-project-automation github-project-automation bot moved this from In Progress to Done in Scribe Board Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
localization Add or correct localizations
Projects
Archived in project
Development

No branches or pull requests

2 participants