Bib Editor: the initial commit

This commit is contained in:
yu-i-i
2026-11-04 17:51:41 +01:00
parent 01d5002ea9
commit ca8fd03a2e
63 changed files with 12854 additions and 15 deletions
@@ -1828,6 +1828,7 @@
"repository_visibility": "",
"republish": "",
"request_edit_access": "",
"required_field_missing": "",
"required_fields_missing": "",
"resend": "",
"resend_activation_email": "",
@@ -2830,5 +2831,100 @@
"zotero_sync_success_plural": "",
"zotero_sync_up_to_date": "",
"zotero_upgrade_prompt_content": "",
"zotero_upgrade_prompt_title": ""
"zotero_upgrade_prompt_title": "",
"add_field": "",
"add_name": "",
"add_optional_field": "",
"author_name": "",
"badly_formatted_field": "",
"badly_formatted_fields": "",
"bib_field_group_books_and_volumes": "",
"bib_field_group_contributors": "",
"bib_field_group_digital_and_online": "",
"bib_field_group_events_and_conferences": "",
"bib_field_group_language_and_origin": "",
"bib_field_group_periodicals_and_journals": "",
"bib_field_group_publication_details": "",
"bib_field_helper_doi_identifier": "",
"bib_field_helper_page_range": "",
"bib_field_helper_preprint_archive_identifier": "",
"bib_syntax_duplicate_field": "",
"bib_syntax_expected_comma_after_citation_key": "",
"bib_syntax_expected_comma_before_field": "",
"bib_syntax_expected_equals_after_field_name": "",
"bib_syntax_invalid_entry_header": "",
"bib_syntax_invalid_field": "",
"bib_syntax_line": "",
"bib_syntax_missing_closing_brace_opened_on_line": "",
"bib_syntax_missing_closing_quote": "",
"bib_syntax_unexpected_comma": "",
"bibliography_editor_load_error": "",
"bibtex_doi_description": "",
"citation_key": "",
"citation_key_contains_invalid_characters": "",
"collapse_optional": "",
"confirm_delete_entry": "",
"confirm_delete_references_count": "",
"correct_syntax_error_in_code_mode": "",
"correct_syntax_errors_in_code_mode": "",
"could_not_import_this_reference": "",
"could_not_parse_this_reference": "",
"could_not_repair_this_reference": "",
"could_not_retrieve_doi_metadata": "",
"could_not_save_bib_file": "",
"curly_braces_must_be_balanced": "",
"date_format_hint": "",
"delete_entries": "",
"delete_entry": "",
"doi_format_hint": "",
"either_a_or_b_is_required": "",
"enter_field_name": "",
"enter_orcid_id": "",
"enter_type": "",
"entry_has_syntax_error": "",
"entry_has_syntax_errors": "",
"entry_has_warnings": "",
"entry_type": "",
"expand_optional": "",
"failed_to_fetch_doi": "",
"failed_to_load_works": "",
"field_is_required": "",
"generate": "",
"import_failed": "",
"import_from_orcid_org": "",
"invalid_doi_format": "",
"invalid_response_from_server": "",
"load_works": "",
"missing_field_for_entry_type": "",
"missing_fields_for_entry_type": "",
"move_down": "",
"move_up": "",
"no_authors_found": "",
"no_bibliography_entries_yet_add_one": "",
"no_entries_match_your_search": "",
"no_name": "",
"no_works_found_for_this_author": "",
"orcid_crossref_rate_limited": "",
"orcid_enriched_reference": "",
"orcid_enriched_references": "",
"orcid_enrichment_failed_reference": "",
"orcid_enrichment_failed_references": "",
"orcid_id": "",
"orcid_imported_reference": "",
"orcid_imported_references": "",
"remove_author": "",
"remove_field": "",
"resolving": "",
"search_bib_file": "",
"search_by_name": "",
"search_failed": "",
"search_orcid_by_name_or_id": "",
"select_a_type_to_see_the_required_fields": "",
"separate_multiple_names_with_and": "",
"some_works_could_not_be_fetched": "",
"some_works_could_not_be_imported": "",
"untitled": "",
"url_format_hint": "",
"works_by_author": "",
"year_format_hint": ""
}
@@ -21,7 +21,7 @@ export function generateBaseCitationKey({
}): string {
const firstAuthor = authors.names[0]
if (!firstAuthor) return ''
const surname = firstAuthor.toLast().replace(/[^A-Za-z0-9]/g, '')
const surname = firstAuthor.toLast().replace(/[^\p{L}\p{N}]/gu, '')
if (!surname) return ''
if (!YEAR_REGEX.test(year.trim())) return ''
return surname + year.trim()
@@ -254,7 +254,7 @@ export const SettingsModalProvider: FC<React.PropsWithChildren> = ({
},
{
key: 'write-and-cite-settings',
component: <ReferenceSearchSetting />,
component: ReferenceSearchSetting ? <ReferenceSearchSetting /> : null,
hidden: !ReferenceSearchSetting,
},
],