diff --git a/README.md b/README.md index b5a3d54..bdd7da0 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Hello. Welcome to the source repo for Kaplan Desktop. It’s been in the works for quite some time and it is exciting to go out and show it to fellow linguists. Please do not hesitate to reach out to contact@kaplan.pro should you have any inquiries. -The documentation for the app itself is available [here](https://kaplan.pro/#/docs). +The documentation for the app itself is available [here](https://kaplan.pro/docs). ## Installation There are a few options: @@ -43,41 +43,25 @@ This is by far the most efficient method and the steps are more or less the same > > pip install pyinstaller -6. Create a .spec file for pyinstaller: +6. Have pyinstaller build the backend Django server: - > pyi-makespec --name=backend manage.py + > pyinstaller --name=backend --hidden-import backend.urls --distpath ../app --clean --noconfirm manage.py -7. Open the backend.spec file with a text editor and change two lines: +7. Install yarn. - > hiddenimports=['api.urls'], - > - > . - > - > . - > - > excludes=['db-sqlite3'], - -8. We’re ready to have pyinstaller build the executable: - - > pyinstaller --clean --noconfirm backend.spec - - This will create a folder called “backend” under /backend/dist/ Move this folder to the /app/ directory. - -9. Install yarn. - -10. Navigate to /app/ and have yarn install the Nodejs libraries: +8. Navigate to /app/ and have yarn install the Nodejs libraries: > yarn install -11. (Windows-specific step) Remove the following line from package.json +9. (Windows-specific step) Remove the following line from package.json > "executableName": "kaplan-desktop", -12. Have yarn build the executable: +10. Have yarn build the executable: > yarn make -13. The resulting executable(s) will be under /app/out/ +11. The resulting executable(s) will be under /app/out/ ## Links: 1. [Kaplan Homepage](https://kaplan.pro) diff --git a/app/package.json b/app/package.json index 2fd82d8..f7fe003 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "name": "kaplan-desktop", "productName": "Kaplan Desktop", - "version": "0.5.1", + "version": "0.5.2", "description": "An open-source CAT tool.", "homepage": "https://kaplan.pro", "main": "src/main.js", diff --git a/app/src/editor.js b/app/src/editor.js index bec5b8a..0c508cd 100644 --- a/app/src/editor.js +++ b/app/src/editor.js @@ -68,7 +68,9 @@ function selectSegmentForMerge(segmentHeader) { } function openCommentForm(buttonElement) { buttonElement.classList.add("hidden"); - buttonElement.nextSibling.classList.add("hidden"); + if (buttonElement.nextSibling){ + buttonElement.nextSibling.classList.add("hidden"); + } noteDiv = document.createElement("div"); noteDiv.classList.add("note"); diff --git a/app/src/index.js b/app/src/index.js index 90dd3b3..2929b5d 100644 --- a/app/src/index.js +++ b/app/src/index.js @@ -410,7 +410,7 @@ function fireOnReady() { if (supportsComments === "true") { notesTD = document.createElement("td"); notesTD.classList.add("notes"); - segmentNotes = segments[s_i].getElementsByTagName("notes") + segmentNotes = segments[s_i].getElementsByTagName("misc") if (segmentNotes.length > 0 && segmentNotes[0].childNodes.length > 0) { segmentNotes[0].childNodes.forEach(function(segmentNote) { noteDiv = document.createElement("div"); diff --git a/backend/api/views.py b/backend/api/views.py index c63c159..ff0a880 100644 --- a/backend/api/views.py +++ b/backend/api/views.py @@ -457,32 +457,6 @@ def project_file(request, project_id, file_id): translation_units.attrib['source_direction'] = project.get_source_direction() translation_units.attrib['target_direction'] = project.get_target_direction() - for tu in translation_units: - for segment in tu: - segment_notes = [] - if isinstance(bf, KXLIFF): - for segment_lqi in bf.get_segment_lqi(segment.attrib.get('id', 0)): - if segment_lqi.attrib.get('resolved'): - continue - lqi_comment = segment_lqi.attrib.get('comment') - if lqi_comment is None: - lqi_comment == '' - segment_lqi.tag = 'lqi' - segment_lqi.text = lqi_comment - segment_notes.append((datetime.fromisoformat(segment_lqi.attrib['added_at']), segment_lqi)) - for child in segment: - if child.tag == 'notes': - for segment_note in child: - segment_notes.append((datetime.fromisoformat(segment_note.attrib['added_at']), segment_note)) - segment.remove(child) - - if len(segment_notes) > 0: - sorted(segment_notes) - notes = etree.Element('notes') - for datetime_iso, segment_note in segment_notes: - notes.append(segment_note) - segment.append(notes) - return HttpResponse(etree.tostring(translation_units, encoding="UTF-8")) @csrf_exempt diff --git a/backend/requirements.txt b/backend/requirements.txt index 88c07a3..e3c38ed 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,3 +1,3 @@ Django==3.2.3 -kaplan==0.11.1 +kaplan==0.12.0 mysql-connector-python==8.0.23