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

重命名问题 #201

Open
iubuling opened this issue Nov 7, 2024 · 3 comments
Open

重命名问题 #201

iubuling opened this issue Nov 7, 2024 · 3 comments

Comments

@iubuling
Copy link

iubuling commented Nov 7, 2024

按此规则:
{{ if language == "en" }} {{ if firstCreator == creators }}{{ firstCreator }}{{ else }} {{ creators join=" & " max="2" suffix=" et al." }}{{ endif }}
{{elseif language == "en-US" }} {{ if firstCreator == creators }}{{ firstCreator }}{{ else }} {{ creators join=" & " max="2" suffix=" et al." }}{{ endif }}
{{ elseif language == "zh-CN" }}{{ if firstCreator == creators }}{{ firstCreator }}{{ else }}{{ creators join=" 和 " max="2" suffix=" 等"}}{{ endif }}
{{ elseif language == "zh" }}{{ if firstCreator == creators }}{{ firstCreator }}{{ else }}{{ creators join=" 和 " max="2" suffix=" 等"}}{{ endif }}
{{ endif }}{{year}}{{ title truncate="50" }}
重命名后,英文文献的名称最前面会有空格,一直不知道怎么删除,在ONedrive上同步会报错,说是有无效字符

@smallFF
Copy link

smallFF commented Nov 15, 2024

哥们,感谢你提供的这个命名规则。我试了一下,通过删除空格(这种形式:}} {{应该改成无空格的形式}}{{)可以解决这个问题。下面是我修改后的,你可以试一下。

{{ if language == "en" }}{{ if firstCreator == creators }}{{ firstCreator }}{{ else }}{{ creators join=" & " max="2" suffix=" et al." }}{{ endif }}
{{elseif language == "en-US" }}{{ if firstCreator == creators }}{{ firstCreator }}{{ else }}{{ creators join=" & " max="2" suffix=" et al." }}{{ endif }}
{{ elseif language == "zh-CN" }}{{ if firstCreator == creators }}{{ firstCreator }}{{ else }}{{ creators join=" 和 " max="2" suffix=" 等"}}{{ endif }}
{{ elseif language == "zh" }}{{ if firstCreator == creators }}{{ firstCreator }}{{ else }}{{ creators join=" 和 " max="2" suffix=" 等"}}{{ endif }}
{{ endif }}{{year}}{{ title truncate="50" }}

@smallFF
Copy link

smallFF commented Dec 6, 2024

上面规则存在一点问题,我补充一个修改版的规则,更加直观易于理解,分别针对一个作者,两个作者,两个作者以上作者的情形。

{{ if language == "en" }}
{{ if firstCreator == {{creators max="1"}} }}{{ firstCreator suffix="" }}
{{ elseif {{creators max="2"}} == {{creators max="3"}} }}{{ creators join=" & " suffix="
"}}
{{ else }}{{ creators max="1" suffix=" et al." }}
{{ endif }}
{{ elseif language == "en-US" }}
{{ if firstCreator == {{creators max="1"}} }}{{ firstCreator suffix="
" }}
{{ elseif {{creators max="2"}} == {{creators max="3"}} }}{{ creators join=" & " suffix=""}}
{{ else }}{{ creators max="1" suffix=" et al.
" }}
{{ endif }}
{{ elseif language == "zh" }}
{{ if firstCreator == {{creators max="1"}} }}{{ firstCreator suffix="" }}
{{ elseif {{creators max="2"}} == {{creators max="3"}} }}{{ creators join=" 和 " suffix="
"}}
{{ else }}{{ creators max="1" suffix=" 等_" }}
{{ endif }}
{{ elseif language == "zh-CN" }}
{{ if firstCreator == {{creators max="1"}} }}{{ firstCreator suffix="" }}
{{ elseif {{creators max="2"}} == {{creators max="3"}} }}{{ creators join=" 和 " suffix="
"}}
{{ else }}{{ creators max="1" suffix=" 等_" }}
{{ endif }}
{{ endif }}
{{ year suffix="_" }}
{{ title truncate="100" }}

@iubuling
Copy link
Author

谢谢,按你说的已经解决啦

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

No branches or pull requests

2 participants