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

Fix J-Stage translator to handle Japanese names properly. #3157

Merged
merged 6 commits into from
Mar 19, 2024

Conversation

aldente-hu
Copy link
Contributor

J-Stage translator handles Japanese names improperly, treating their first name as their last name and vise versa.
This problem is caused by the BibTex records of J-Stage. So I've fixed it to look at the RIS records instead.

@zoe-translates
Copy link
Collaborator

I have a generic question about the purpose of firstName/lastName fields in the creator record of a Zotero item.

These are not called "family name" "given name" or so, IMO for good reason, because what comes first in a name may or may not be the "given name", and concepts like "family/given name" may or may not apply in a particular socio-linguistic context. Can we say that for the name 田中博春, the first name is 田中 because it is literally the first part of the name? This part is the family name for sure, but should it be put into lastName?

I don't feel there are clear-cut answers as far as translator codes are concerned - while we strive for accuracy by default, we acknowledge that manual processing by the user is often necessary. Ultimately, it's how the user uses the bib items that matter, and I would like to know more about the impacts of different choices for this problem.

So in this particular case (Japanese persons' names in Japanese), what should be the best default choice and why? (I'd also like to hear @adam3smith's view; thanks)

@adam3smith
Copy link
Collaborator

adam3smith commented Oct 10, 2023

I think the goal should be to provide optimal output with Zotero's native format (i.e. CSL via citeproc-js).
I'd have to recheck (there are also some threads on the forum), but IIRC, citeproc-js handles Japanese names (as identified by Kanji) correctly when the family name is entered as last name. That's then the name that gets printed in form="short" but (and that's the crucial citeproc-js part), it prints the family name (i.e., Zotero last name) first when rendering the full name.
I don't know ottomh how exactly that's determined, e.g. ,if it also applies to Latin script names with jp in the language fields (I think?) and other languages (like Hungarian). I'm pretty sure it doesn't handle the complexity of names in India at all.

The standard recommendation, e.g. by W3C, is to use family and given/other when splitting names is necessary (as it is for citation generation), so Zotero's field naming isn't ideal here. I'm not sure if renaming these in the UI is up for grabs or if there are concerns about confusing users.

@aldente-hu
Copy link
Contributor Author

@zoe-translates
Talking about the particular case, I want Zotero to treat our(=Japanese people's) family name as lastName.

This is because:

It seems many(all?) parts of Zotero regard lastName field as their family name. For instance, Zotero displays 'Creators' name with their lastName, and uses their lastName field when citing their articles with Harvard referencing style. If our first/given names were stored in lastName field, Zotero would be very troublesome (and might be useless) for Japanese people.

Practically, storing our family name into lastName field seems the best solution, even if it might not be ideal.

Copy link
Collaborator

@zoe-translates zoe-translates left a comment

Choose a reason for hiding this comment

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

Thanks, @aldente-hu for the clarifications.

I tested generating citations bibliographies with Japanese author-names, using the items created by this translator with your changes. I don't see any problem with the generated output; the names are correctly spelled out.

J-Stage.js Outdated Show resolved Hide resolved
@aldente-hu
Copy link
Contributor Author

Thanks @zoe-translates . Your suggestion looks so good! I've committed it.

Copy link
Collaborator

@zoe-translates zoe-translates left a comment

Choose a reason for hiding this comment

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

Thanks! I learn a lot from contributors like you. BTW, if you see other problems like this with Japanese in item metadata, please feel free to report or submit a PR.

@aldente-hu
Copy link
Contributor Author

Thanks as well! I'll touch another one (such as CiNii translator).

@aldente-hu
Copy link
Contributor Author

What makes this PR remain unmerged?

@AbeJellinek AbeJellinek merged commit f3404ea into zotero:master Mar 19, 2024
1 check failed
@AbeJellinek
Copy link
Member

Nothing! Thanks for your great work.

@aldente-hu aldente-hu deleted the j-stage-ris branch March 21, 2024 03:01
@jajagara
Copy link

Thanks as well! I'll touch another one (such as CiNii translator).

Hi! I have been struggling with a similar problem (family name and given name getting swapped) when importing items from CiNii. Is it possible for you to fix this problem with CiNii as well?
(I tried mimicking your script in CiNii.js without any success. . .)

@aldente-hu
Copy link
Contributor Author

@jajagara
I suppose the current CiNii.js is not adjusted to the brandnew "CiNii Research". ( CiNii translator was not applyed, wasn't it?)
Now I'm fixing it!

@jajagara
Copy link

Oh! That's what it is! Thank you SOOO much!! とても助かります!!

@aldente-hu
Copy link
Contributor Author

It's my treasure!
Now I've done. #3363

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants