Remove localization for field names (#178)

Remove localization for field names as it creates agnostic output.
This commit is contained in:
CRIMX 2020-06-03 11:27:33 +08:00 committed by GitHub
parent 745fd34b83
commit 5438b19ba1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,7 +30,6 @@ from PyQt5.QtWidgets import QMessageBox
import anki import anki
import anki.exporting import anki.exporting
import anki.lang
import anki.storage import anki.storage
import aqt import aqt
from anki.exporting import AnkiPackageExporter from anki.exporting import AnkiPackageExporter
@ -660,11 +659,11 @@ class AnkiConnect:
mm = collection.models mm = collection.models
# Generate new Note # Generate new Note
m = mm.new(anki.lang._(modelName)) m = mm.new(modelName)
# Create fields and add them to Note # Create fields and add them to Note
for field in inOrderFields: for field in inOrderFields:
fm = mm.newField(anki.lang._(field)) fm = mm.newField(field)
mm.addField(m, fm) mm.addField(m, fm)
# Add shared css to model if exists. Use default otherwise # Add shared css to model if exists. Use default otherwise
@ -678,7 +677,7 @@ class AnkiConnect:
if 'Name' in card: if 'Name' in card:
cardName = card['Name'] cardName = card['Name']
t = mm.newTemplate(anki.lang._(cardName)) t = mm.newTemplate(cardName)
cardCount += 1 cardCount += 1
t['qfmt'] = card['Front'] t['qfmt'] = card['Front']
t['afmt'] = card['Back'] t['afmt'] = card['Back']