i18n space problem of consecutive {% trans %} blocks
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1k
- Forks
- 412
- Avg merge
- 6d 10h
- Merged PRs (30d)
- 3
Description
In some languages (like zh_TW) we don't put spaces after periods, commas or between sentences. For example, 你好,世界。歡迎! is correct but 你好, 世界。 歡迎! is not.
It seems that some of CMS's i18n glues two sentences with a space, like:
https://github.com/cms-dev/cms/blob/821fed553d419ef437bc00c208562a25ae060c1b/cms/server/contest/templates/overview.html#L84-L85
And it feels awkward to see those half-width space between two sentences in the translated pages.
Relevant codes:
c71b2959025d8bd7581431b25dc43a586fad7bdb
https://github.com/cms-dev/cms/blob/821fed553d419ef437bc00c208562a25ae060c1b/cms/server/contest/formatting.py#L83
https://github.com/cms-dev/cms/blob/821fed553d419ef437bc00c208562a25ae060c1b/cms/server/contest/formatting.py#L103
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the cited consecutive translation blocks in cms/server/contest/templates/overview.html and the related logic in cms/server/contest/formatting.py. Reproduce the rendered output for zh_TW and compare it with a language that uses spaces. Done means adjacent translated sentences no longer gain unwanted half-width spaces while spacing remains correct for languages that need it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- internationalization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100