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

refactor(git-changelog): migrate i18n to ui config #213

Merged
merged 4 commits into from
May 15, 2024

Conversation

nekomeowww
Copy link
Member

@nekomeowww nekomeowww commented May 15, 2024

Close #198

Thanks @BeiyanYunyi's work and the discovery of id attribute of h2 could be discoverable by VitePress and include as parts of outline in @project-trans/rle-wiki.

  1. The locales in the original Vite plugin GitChangelogMarkdownSection no longer need to be configured and have been migrated to the UI configuration under locales:
    1. changelog.title
    2. contributors.title;
  2. In order to better structure the organization of the i18n fields, the original
    1. noLogs i18n configuration changed to changelog.noData;
    2. noContributors i18n configuration was changed to contributors.noData.
    3. lastEdited i18n Configuration changed to lastEdited.
    4. lastEditedDateFnsLocaleName configuration changed to changelog.lastEditedDateFnsLocaleName
    5. viewFullHistory i18n Configuration changed to changelog.viewFullHistory
    6. committedOn i18n configuration changed to changelog.committedOn

@nekomeowww nekomeowww added bug Something isn't working enhancement New feature or request pkg/git-changelog Related to @nolebase/vitepress-plugin-git-changelog labels May 15, 2024
@nekomeowww nekomeowww added this to the 2.0.0 milestone May 15, 2024
@nekomeowww nekomeowww requested a review from northword May 15, 2024 07:01
@nekomeowww nekomeowww self-assigned this May 15, 2024
Copy link

github-actions bot commented May 15, 2024

✅ Successfully deployed to Netlify

Platform Status URL
Ubuntu Success https://66447ced4aa95681abceb132--nolebase-integrations.netlify.app
Windows Success https://66447cf91d25fe800af16999--nolebase-integrations.netlify.app

Copy link
Member

@northword northword left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs/vite.config.ts 也需要相应更新:

image

docs/pages/zh-CN/releases/migrations/v1-to-v2.md Outdated Show resolved Hide resolved
docs/pages/en/releases/migrations/v1-to-v2.md Outdated Show resolved Hide resolved
nekomeowww and others added 2 commits May 15, 2024 16:24
1. The `locales` in the original Vite plugin `GitChangelogMarkdownSection` no longer need to be configured and have been migrated to the UI configuration under `locales`:
	1. `changelog.title`
	2. `contributors.title`;
2. In order to better structure the organization of the i18n fields, the original
	1. `noLogs` i18n configuration changed to `changelog.noData`;
	2. `noContributors` i18n configuration was changed to `contributors.noData`.
	3. `lastEdited` i18n Configuration changed to `lastEdited`.
	4. `lastEditedDateFnsLocaleName` configuration changed to `changelog.lastEditedDateFnsLocaleName`
	5. `viewFullHistory` i18n Configuration changed to `changelog.viewFullHistory`
	6. `committedOn` i18n configuration changed to `changelog.committedOn`

Signed-off-by: Neko Ayaka <neko@ayaka.moe>
Co-authored-by: BeiyanYunyi <14120445+BeiyanYunyi@users.noreply.github.com>
Signed-off-by: Neko Ayaka <neko@ayaka.moe>
Copy link
Member

@northword northword left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

话说是不是可以把 markdownSection 插件整合进 Git 插件,两个插件共用一个 include(include 里的文件执行 git 并插入 md);需要自定义组件的用户可以用 sections.disableChangelog等 来禁用。

(不过这样似乎和其他插件不是很统一了,我看 PageProperties 也是分成了俩
(现在这样也挺好,配置起来也方便,而且超出这个 pr 的范围了

@nekomeowww
Copy link
Member Author

话说是不是可以把 markdownSection 插件整合进 Git 插件,两个插件共用一个 include(include 里的文件执行 git 并插入 md);需要自定义组件的用户可以用 sections.disableChangelog等 来禁用。

我想过,事实上我过去的几天一直在想这个事情,但是我考虑到可能会出现有的用户只是想要 git changelog 的 data loader 能力,有的用户可能会想要自己搞自己的 Markdown manipulation。

不确定什么样的设计会比较好...

nekomeowww and others added 2 commits May 15, 2024 17:06
Co-authored-by: Northword <44738481+northword@users.noreply.github.com>
Co-authored-by: Northword <44738481+northword@users.noreply.github.com>
@nekomeowww nekomeowww enabled auto-merge (squash) May 15, 2024 09:07
@nekomeowww
Copy link
Member Author

好像把之前的 comment 给 force push 掉了 😂
重新 apply 一下。

@nekomeowww nekomeowww merged commit 04fb100 into main May 15, 2024
6 checks passed
@nekomeowww nekomeowww deleted the dev/git-changelog-i18n branch May 15, 2024 09:13
@northword
Copy link
Member

我考虑到可能会出现有的用户只是想要 git changelog 的 data loader 能力,有的用户可能会想要自己搞自己的 Markdown manipulation。

需要自定义组件的用户可以用 sections.disableChangelog 等 来禁用(或是有一个选项形如 useBuildInComponent),这样可以让用户自己在配置文件里写 transfromMarkdown。

不过当新方案对比现有方案没有比较明确的优势的时候,我们不妨先保持原状。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request pkg/git-changelog Related to @nolebase/vitepress-plugin-git-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improve: git-change-log plugin, locales doesn't work in locales root mode.
2 participants