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

Japanese readtime.other shows a full-width instead of the correct number #7099

Closed
4 tasks done
gh640 opened this issue Apr 25, 2024 · 7 comments
Closed
4 tasks done
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@gh640
Copy link
Contributor

gh640 commented Apr 25, 2024

Context

No response

Bug description

The issue is with the translation of the Japanese text.

When the theme language is set to Japanese (ja) and the blog plugin is used, the string readtime.other (which is "# min read" in English) is not displayed correctly.

Specifically, the number representing the minutes is not displayed properly, resulting in the text "このページは約#分で読めます" (which is "# min read" in English).

It should actually be displayed as "このページは約15分で読めます" (which translates to "This page can be read in about 15 minutes").

I guess the cause should be the use of a full-width character where a half-width # character should be used.

(This is an translation issue. I apologize if I am mistaken about the place and method to report this.)

Related links

Reproduction

9.5.18-wrong-number-display-in-japanese.zip

Steps to reproduce

  1. Run the dev server by mkdocs serve
  2. Open the blog post page in a browser: http://localhost:8000/blog/2024/04/24/this-is-a-sampple-post/
  3. Check the display of ul.md-post__meta element

Browser

No response

Before submitting

@gh640
Copy link
Contributor Author

gh640 commented Apr 25, 2024

Screenshots

English (correct):

Screenshot 2024-04-25 at 9 11 34

Japanese (incorrect):

Screenshot 2024-04-25 at 9 06 09

@gh640
Copy link
Contributor Author

gh640 commented Apr 25, 2024

By the way, currently the translation for readtime.one is "このページは約1分で読めます" ("This page takes about 1 minute to read"). The "1" here is a full-width character.

But for numbers greater than 1 (in the case of readtime.other), a half-width character is used. To improve consistency, I think it would be better to use a half-width "1" for readtime.one as follows:

このページは約1分で読めます

@squidfunk squidfunk added the bug Issue reports a bug label Apr 25, 2024
@squidfunk
Copy link
Owner

Thanks for reporting! Fixed in bde889f.

Yes, we're currently not able to use full-width numbers, so switching to half-width to be consistent is likely to be our best option. We could add whitespace left and right, if that makes reading any easier, but then we should also adjust that for:

  "search.result.more.one": "このページ内にもう1件見つかりました",
  "search.result.more.other": "このページ内にあと#件見つかりました",

We'll be working on improving internationalization in the future, as we want to provide the best experience possible!

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Apr 25, 2024
@gh640
Copy link
Contributor Author

gh640 commented Apr 25, 2024

@squidfunk

Thank you for your quick response! I have confirmed that the issue has been resolved by running a sample with master after bde889f :D

We could add whitespace left and right, if that makes reading any easier, but then we should also adjust that for:

You are right. FYI, whether or not to add spaces around half-width characters within Japanese sentences is a point of contention. My preference is to add spaces, but there are also people who don't like it. Even within a single company, there is no consistency. For example, spaces are added in the UI within macOS, but not on Apple's website (apple.com).

If there is an opportunity in the future when internationalization is improved, I would love to contribute.

I will close this issue. If there are any problems, please reopen it. Thanks :)

@gh640 gh640 closed this as completed Apr 25, 2024
@squidfunk
Copy link
Owner

squidfunk commented Apr 25, 2024

FYI, whether or not to add spaces around half-width characters within Japanese sentences is a point of contention. My preference is to add spaces, but there are also people who don't like it. Even within a single company, there is no consistency. For example, spaces are added in the UI within macOS, but not on Apple's website (apple.com).

Thanks for the clarification! Then let's just leave it like that for now, as translations can also be quite simply overridden. I'll let you know when we start working on better translations support ✌️

Let's keep this issue open until released ☺️

@squidfunk squidfunk reopened this Apr 25, 2024
@squidfunk
Copy link
Owner

Released as part of 9.5.19

@gh640
Copy link
Contributor Author

gh640 commented Apr 25, 2024

Yay! Thank you.

Yes, please reach out when the time comes ✌️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants