汉化脚本

作者: unknowissue创建于 2024年4月29日更新于 2024年8月12日

Only applicable for win:

Logic:

  1. Read the environment variable $username = $env:USERNAME
  2. Read the version field in the file C:\Users\$username\AppData\Roaming\Notion\latestVersion.json
  3. Based on the value of the version field, check whether the following two files exist: C:\Users\$username\AppData\Roaming\Notion\notionAssetCache-v2\$version\assets_assets\index-en-US-***.html C:\Users\$username\AppData\Roaming\Notion\notionAssetCache-v2\$version\assets_assets\localeSetup-zh-CN-***.js
  4. If the two files exist, read the filename of C:\Users\$username\AppData\Roaming\Notion\notionAssetCache-v2\$version\assets_assets\localeSetup-zh-CN-***.js and copy it to $name_localeSetup-zh-CN
  5. Get the following string:'
  6. In the file C:\Users\$username\AppData\Roaming\Notion\notionAssetCache-v2\$version\assets_assets\index-en-US-***.html, replace the content of the head tag with the following:'

In addition, due to the security policy settings in win, it is necessary to start the powershell script with bat.

内容来源: Reamd7/notion-zh_CN