Skip to content

Refactor/switch to american english#830

Merged
TuomasBorman merged 53 commits intomicrobiome:develfrom
artur-sannikov:refactor/switch-to-american-english
Feb 11, 2026
Merged

Refactor/switch to american english#830
TuomasBorman merged 53 commits intomicrobiome:develfrom
artur-sannikov:refactor/switch-to-american-english

Conversation

@artur-sannikov
Copy link
Contributor

See #800.

I think I covered all of British spelling.

Copy link
Contributor

@TuomasBorman TuomasBorman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome.

@TuomasBorman TuomasBorman linked an issue Jan 15, 2026 that may be closed by this pull request
@TuomasBorman
Copy link
Contributor

Btw, what script did you use? Thinking about the future use...

What do you think, should this be automated like "Style code"?

@artur-sannikov
Copy link
Contributor Author

artur-sannikov commented Jan 15, 2026

I just used https://www.npmjs.com/package/american-british-english-translator to look see what spelling needs to be changed, and then just used something like for each word:

find -name "*.qmd" -or -name "*.Rmd" | xargs sed -i 's/minimises/minimizes/g'

We can use a bash script to do this automatically at every PR.

@artur-sannikov
Copy link
Contributor Author

Don't forget to fix the permissions for styler: https://github.com/microbiome/OMA/actions/runs/21026866334/job/60453346460

@TuomasBorman
Copy link
Contributor

Don't forget to fix the permissions for styler: https://github.com/microbiome/OMA/actions/runs/21026866334/job/60453346460

It is working for OMA branches, but the styler does not have access to forks. It might be possible somehow to add them as " Maintainers are allowed to edit this pull request. ", but don't know how. Can you check?

I.e., can styler have "maintainer" status?

@TuomasBorman
Copy link
Contributor

I just used https://www.npmjs.com/package/american-british-english-translator to look see what spelling needs to be changed, and then just used something like for each word:

find -name "*.qmd" -or -name "*.Rmd" | xargs sed -i 's/minimises/minimizes/g'

We can use a bash script to do this automatically at every PR.

Can you make one? Create new GHA for that so we can remove it if it is not working

@artur-sannikov
Copy link
Contributor Author

Note: some words do not have to be substituted, such as colour in the function parameters.

@artur-sannikov
Copy link
Contributor Author

Should be fine now. Let me know, and I wish squash the commits.

@TuomasBorman
Copy link
Contributor

It seems that the GHA is failing to push. "Style" GHA is also pushing --> can you check that these both are using same approach

@artur-sannikov
Copy link
Contributor Author

That's expected because the branch/switch-to-american-english does not exist in the repo. On my fork, it works fine: https://github.com/artur-sannikov/OMA/actions/runs/21242510916/job/61123638447

But I will see what I can do to fix it.

@artur-sannikov
Copy link
Contributor Author

Now the conversion GHA is fixed. The style fails because of the 403 error (access forbidden). I'm not entirely sure what's going on here because I gave it the write permissions to the repo.

However, I plan to switch to this Action for commit and push the changes. Right now, it's my custom script.

-e 's/visualise/visualize/' \
-e 's/visualisation/visualization/' \
-e 's/summarise /summarize /' \
-e 's/summarised /summarized /' \
Copy link
Contributor

@TuomasBorman TuomasBorman Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why there is space after summarised? Does it mean that this does not work for

This sentence is summarised.

Copy link
Contributor Author

@artur-sannikov artur-sannikov Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why there is space after summarised? Does it mean that this does not work for

This sentence is summarised.

The reason is that we have a summarise function, so summarise() would be
matched. That's unwanted behavior. I would use the negated set here
(https://www.regular-expressions.info/charclass.html).

I tested it briefly: it will not work with summarise (no space character),
but I suppose this situation should not occur.

So, something like this: "s/<summarise>([^(])/summarize\1/" and
"s/<summarised\>([^(])/summarized\1/". Not sure if this can be merged into
one rule. Need some Regex gurus here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, can you move the GHA related stuff to the PR: #840

The text is good to go but this might need more thinking?

Copy link
Contributor

@TuomasBorman TuomasBorman Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still feel this is not safe enough as it can match with function names or variables and lead to problems in the future. Maybe words inside code chunks should be ignored, but I would already merge the qmd files from this PR to get forward.

@artur-sannikov

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use the negation pattern ^ to ignore some blocks, but I feel like
we are entering the bash script area here. Do you know someone with better
regex knowledge?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might be the best candidate that I know. Also, this might need more sophisticated approach (for instance dedicated R function).

As the PR is good otherwise, I propose that the GHA related stuff will be moved to another PR

TuomasBorman
TuomasBorman approved these changes Feb 9, 2026
@TuomasBorman
Copy link
Contributor

Thanks, looks good! Check the last comment.

Copy link
Contributor

@TuomasBorman TuomasBorman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you!

@TuomasBorman TuomasBorman merged commit cc35732 into microbiome:devel Feb 11, 2026
0 of 2 checks passed
@artur-sannikov artur-sannikov deleted the refactor/switch-to-american-english branch February 11, 2026 19:00
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

Successfully merging this pull request may close these issues.

Use US English

2 participants