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

Translation settings fields to chinese #688

Merged
merged 3 commits into from
Apr 21, 2023

Conversation

windily-cloud
Copy link
Contributor

I have encountered several issues while using the commands you provided:

  1. After running npm ci, I need to execute npm run build to generate the translation-helper file.
  2. However, this doesn't generate the style.css file.
  3. When I run npm run translate and select zh-cn, the corresponding translation doesn't get updated in the corresponding zh-cn file.

As a result, I opted to directly translate the en.ts file. I encountered some changes during the debugging process, so I'd appreciate it if you could help me address those. I'm sorry for the delay in translation as I've been very busy recently.

Lastly, having a developer like you for Obsidian is truly an honor. I also feel lucky to be able to use linter plugin.

@pjkaufman
Copy link
Collaborator

pjkaufman commented Apr 17, 2023

I have encountered several issues while using the commands you provided:

  1. After running npm ci, I need to execute npm run build to generate the translation-helper file.
  2. However, this doesn't generate the style.css file.
  3. When I run npm run translate and select zh-cn, the corresponding translation doesn't get updated in the corresponding zh-cn file.

As a result, I opted to directly translate the en.ts file. I encountered some changes during the debugging process, so I'd appreciate it if you could help me address those. I'm sorry for the delay in translation as I've been very busy recently.

Lastly, having a developer like you for Obsidian is truly an honor. I also feel lucky to be able to use linter plugin.

Thanks for letting me know. I will have to check what is up with npm run translate on zh-cn. I know it worked for Spanish, but maybe that is because it is not a compound name.

Edit: 2. Is working as expected as the styles.css does not need generating. It is located under src. I probably should just copy it to the root of the directory as well just to help people better understand where things are that need to be included in releases.

@pjkaufman
Copy link
Collaborator

pjkaufman commented Apr 17, 2023

The build error is because the following line needs to be updated:

import zhCN from './locale/zh-cn';

It needs to be import zhCN from './locale/zh';

Edit: We probably want to leave the file names as they were and just account for the issue in the translation helper.

@pjkaufman
Copy link
Collaborator

I have encountered several issues while using the commands you provided:

  1. After running npm ci, I need to execute npm run build to generate the translation-helper file.
  2. However, this doesn't generate the style.css file.
  3. When I run npm run translate and select zh-cn, the corresponding translation doesn't get updated in the corresponding zh-cn file.

As a result, I opted to directly translate the en.ts file. I encountered some changes during the debugging process, so I'd appreciate it if you could help me address those. I'm sorry for the delay in translation as I've been very busy recently.
Lastly, having a developer like you for Obsidian is truly an honor. I also feel lucky to be able to use linter plugin.

Thanks for letting me know. I will have to check what is up with npm run translate on zh-cn. I know it worked for Spanish, but maybe that is because it is not a compound name.

The issue here seems to have been that it was in the map differently from the name of the file because the file language was listed as zh, but it referred to zh-cn.ts which would cause the translation helper to be unable to properly save the language values. Sorry about that.

I am going to try to remove any other scenarios like that if possible.

src/lang/helpers.ts Outdated Show resolved Hide resolved
src/lang/locale/zh-cn.ts Outdated Show resolved Hide resolved
@pjkaufman
Copy link
Collaborator

This looks good to me. I will take a look at the actual displaying of the values when I get a chance. Once that happens I will go ahead and merge this.

@pjkaufman
Copy link
Collaborator

Thanks for taking the time to translate this!

@windily-cloud
Copy link
Contributor Author

Thanks for taking the time to translate this!

Compared to your efforts, this work of mine is really very insignificant. I've already posted articles in China promoting linter and they all think it works very well. Before linter had i18n, there were already translations by directly modifying the main.js file.

Thanks again for your efforts !!!!

Copy link
Collaborator

@pjkaufman pjkaufman left a comment

Choose a reason for hiding this comment

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

I tested it out and it works. I noticed one bug in the settings page around language text, so I am putting in a fix for that, but I wanted to check that YAML and Debug are supposed to be in the heading names for the tabs. If so, I will merge this translation in.

// tab.ts
'general': '通用设置',
'custom': '自定义设置',
'yaml': 'YAML设置',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is YAML supposed to be here?

'footnote': '内容设置',
'spacing': '间距设置',
'paste': '粘贴设置',
'debug': 'Debug设置',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is debug supposed to be here?

@pjkaufman
Copy link
Collaborator

It works with the following language selected: 简体中文 which maps to zh in terms of its language codes.

@pjkaufman
Copy link
Collaborator

I have yet to hear back on the 2 headings, but I will go ahead and merge this PR and a subsequent PR can be created if either of the 2 headers should not have the English name present.

@pjkaufman pjkaufman merged commit 4ee623a into platers:master Apr 21, 2023
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