getgrav / getgrav/grav-plugin-readingtime

Reading time calculation seems to be incorrect for Chinese

Open
#26 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
22
Forks
10
PR merge metrics
No merged PRs in 30d

Description

I am building a multilingual website in English, Spanish, Vietnamese, Simplified Chinese, and Traditional Chinese. For English, Spanish, and Vietnamese, the reading times for a sample page with the English content translated to the other languages are, respectively, 4m41s, 4m29s, and 5m21s. For Simplified Chinese the reading time is 0m28s and for Traditional Chinese the reading time is 0m27s. So I suspect that this plugin is not calculating reading times for Chinese in a manner that we should expect. I’m wondering if this can be confirmed and whether there is a solution. For now, my workaround will be to exclude reading times for Chinese via an if statement in my twig template, and I know I can confidently use reading times for English, Spanish, and Vietnamese.

{% if grav.language.getActive not in ['zh-Hans', 'zh-Hant'] %}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported reading-time results for the English, Spanish, Vietnamese, Simplified Chinese, and Traditional Chinese samples, then inspect the plugin's reading-time calculation. Use the Twig workaround in the issue as the current behavior reference. Done means Chinese reading times are calculated consistently with the project's expected approach and the reported discrepancy is covered by a verification or regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.