vanderlee / phpSyllable

PHP Syllable splitter/counter and Hyphenator for text and HTML. Multi-language, customisable, cached and fast!
http://vanderlee.github.io/phpSyllable/
117 stars 80 forks source link

Update languages script #45

Closed alexander-nitsche closed 1 year ago

alexander-nitsche commented 1 year ago

Hi Martijn,

this PR is about providing a script for automatic language files updates, including a first bunch of updated files. It is related to issue #44 . What remains is:

Greetings, Alex

alexander-nitsche commented 1 year ago

The console output looks like:

Updating 75 language files on 2023-03-17 19:18:45 CET.
File hyph-af.tex has been UPDATED.
..
File hyph-de-ch-1901.tex has been UPDATED.
Error: Call to URL http://mirror.ctan.org/language/hyph-utf8/tex/generic/hyph-utf8/patterns/tex/hyph-de.tex failed with
{
    "status": 404,
    "response": "<html>\r\n<head><title>404 Not Found<\/title><\/head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404 Not Found<\/h1><\/center>\r\n<hr><center>nginx\/1.14.2<\/center>\r\n<\/body>\r\n<\/html>\r\n ..",
    "cURL error": "",
    "cURL error number": 0
}
File hyph-el-monoton.tex has been UPDATED.
..
File hyph-zh-latn-pinyin.tex has been UPDATED.
Result: 75/75 files processed, 74 changed, 0 unchanged and 1 failed.
alexander-nitsche commented 1 year ago

I split off the updated language files to PR #46 to ease review.

alexander-nitsche commented 1 year ago

Done :)

alexander-nitsche commented 1 year ago

The latest commit "Add language files update GitHub Action" adds the well tested GitHub action "Update languages" which updates the language files once a month. This commit makes PR #46 obsolete.

alexander-nitsche commented 1 year ago

Hi Martijn,

how to proceed here: the checks require changes, where the Codacy can be met with a new commit, but the Travis CI cannot pass as the service is off-duty. I could make Codacy happy with a new commit and you might want to unset Travis CI as required?

Greetings, Alex

alexander-nitsche commented 1 year ago

Hi Martijn,

I have replaced testing by Travis CI with a GitHub action. This makes PRs #49 and #50 obsolete.

Also, I've moved to not committing the updated language files directly to the master branch, but creating a feature branch and first creating a PR from that branch to the master branch before automatically merging the PR - if the required checks pass.

To merge this PR, we need to disable Codacy and Travis CI as required checks. Codacy and StyleCI conflict with each other, and Travis CI is no longer available. If you agree, we can finalize this PR together in a short call.

Greetings, Alex

alexander-nitsche commented 1 year ago

Temporarily disabling GitHub checks is explained here.

alexander-nitsche commented 1 year ago

Hi Martijn,

with the latest changes the updated language files are automatically published - if the previous head of the master branch was also published. This helps to automatically provide package users with the latest language updates while ensuring that no non-language files commits are accidentally published.

It is tested thoroughly.

Greetings, Alex

alexander-nitsche commented 1 year ago

Added some tests for the build/ classes to increase confidence.

alexander-nitsche commented 1 year ago

Improved the tests.

I will rebase this branch on the new master.

alexander-nitsche commented 1 year ago

Rebased.

alexander-nitsche commented 1 year ago

The outcome of this PR will look like this:

Tests GitHub Action syllable-tests-github-action

Update Languages GitHub Action syllable-languages-github-action

Automatic commits and release syllable-languages-commits

vanderlee commented 1 year ago

@alexander-nitsche , since you're making regular improvements, do you think this is ready to merge? I finally managed to find how to remove the Travis-CI check, and you should have permissions to merge it, so please do when you feel it's ready.