Skip to content

Unify whitespace across translations (en.ts, ru.ts, zh-ch.ts) - #2418

Closed
playermiller109 wants to merge 1 commit into
zsviczian:masterfrom
playermiller109:master
Closed

Unify whitespace across translations (en.ts, ru.ts, zh-ch.ts)#2418
playermiller109 wants to merge 1 commit into
zsviczian:masterfrom
playermiller109:master

Conversation

@playermiller109

@playermiller109 playermiller109 commented Jul 22, 2025

Copy link
Copy Markdown
Contributor

To make it easier to compare with the original sources, the PR does not include any actual content changes.

For the convenience of translators, the formatting adjustments have been applied not only to en.ts, but also to existing translation files ru.ts and zh-cn.ts.

Why Unify Whitespace?

When comparing en.ts with other translation files using a diff editor, inconsistent whitespace may lead to irrelevant diffs. This makes it harder to identify real translation differences and increases maintenance difficulty.

Unified formatting also makes it easier to detect missing translations — for example, by comparing line counts or spotting gaps visually.

In short, unifying whitespace before translation is essential for clean and maintainable diffs.

What Was Changed?

  • Removed unnecessary trailing whitespace characters at the end of lines.
  • Replaced multiple consecutive spaces within sentences with a single space.
  • Unified JSON key-value formatting to follow key: value, ensuring all keys are followed by a colon and a single space (replacing inconsistent key : value formats).
  • Cleaned up unnecessary whitespace and translation edits in comment lines (// ...) within zh-cn.ts to match en.ts.
    • As with whitespace, comments in JSON files do not affect actual translations. Therefore, minimizing unnecessary differences helps keep the diffs clean and meaningful.

Feel free to reach out if you have any concerns.

@dmscode

dmscode commented Jul 22, 2025

Copy link
Copy Markdown
Contributor

刚刚我检 diff 了 en.ts 和 zh-cn.ts 中所有键值的对应情况,并移除了 zh-cn.ts 中所有 : 前面的空格。并同步了 zh-tw.ts 文件中相应的格式和更新。

I just checked the diff between en.ts and zh-cn.ts to ensure all key-value pairs correspond correctly. I also removed all spaces before the colons in zh-cn.ts and synchronized the formatting and updates in the zh-tw.ts file accordingly.

#2419

@playermiller109

Copy link
Copy Markdown
Contributor Author

@dmscode 这个不光是只移除了 zh-cn.ts 中所有 : 前面的空格,还有其他的空白字符也处理了的,你这样还是会有冲突的。这样吧,我把这个关了给你 PR 吧。

This not only removes all the spaces before the colons in zh-cn.ts, but also processes other whitespace characters. You'll still encounter conflicts this way. Well, let me close this and send you a PR.

@dmscode

dmscode commented Jul 22, 2025

Copy link
Copy Markdown
Contributor

@playermiller109 我是在做完我所说的一切之后,才看到了这个 pr,所以评论了一下。

关于空白,en.ts 中会存在一些统一或者不严格的状况,但不影响使用。为了便于对照检查,所以在 zh-cn.ts 中,我严格对应了 en.ts 的行号。

我觉得也没必要过分严格要求格式的严谨,反正现在密集跟进翻译更新的人似乎只有我,影响并不大。不过后面跟进繁体中文的话我可能要写一个脚本来对比 keys 的差异。

I only saw this PR after completing everything I mentioned, so I left a comment.

Regarding the blank spaces, there might be some inconsistencies or lack of strictness in en.ts, but it doesn't affect usage. To facilitate cross-checking, I strictly matched the line numbers in zh-cn.ts with those in en.ts.

I think there's no need to be overly strict about format precision. After all, it seems like I'm the only one intensively keeping up with translation updates right now, so the impact is minimal. However, if we proceed with Traditional Chinese updates later, I might need to write a script to compare the differences in keys.

@playermiller109 playermiller109 changed the title Unify whitespace across translations Unify whitespace across translations (en.ts, ru.ts, zh-ch.ts) Jul 23, 2025
dmscode added a commit to dmscode/obsidian-excalidraw-plugin that referenced this pull request Jul 23, 2025
Issue reported and fixed by @playermiller109 ([PR zsviczian#2418](zsviczian#2418), [PR #2](#2)).

- [x] Removed unnecessary trailing whitespace characters at the end of lines.
- [x] Replaced multiple consecutive spaces within sentences with a single space.
- [x] Unified JSON key-value formatting to follow key: value, ensuring all keys are followed by a colon and a single space (replacing inconsistent key : value formats).
- [x] Removed excessive blank lines.
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.

2 participants