Skip to content

Commit 83c393e

Browse files
authored
Merge pull request #10 from kaplanPRO/development
version 0.5.2
2 parents 84df75b + 558e979 commit 83c393e

File tree

6 files changed

+14
-54
lines changed

6 files changed

+14
-54
lines changed

README.md

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
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.
99

10-
The documentation for the app itself is available [here](https://kaplan.pro/#/docs).
10+
The documentation for the app itself is available [here](https://kaplan.pro/docs).
1111

1212
## Installation
1313
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
4343
>
4444
> pip install pyinstaller
4545
46-
6. Create a .spec file for pyinstaller:
46+
6. Have pyinstaller build the backend Django server:
4747

48-
> pyi-makespec --name=backend manage.py
48+
> pyinstaller --name=backend --hidden-import backend.urls --distpath ../app --clean --noconfirm manage.py
4949
50-
7. Open the backend.spec file with a text editor and change two lines:
50+
7. Install yarn.
5151

52-
> hiddenimports=['api.urls'],
53-
>
54-
> .
55-
>
56-
> .
57-
>
58-
> excludes=['db-sqlite3'],
59-
60-
8. We’re ready to have pyinstaller build the executable:
61-
62-
> pyinstaller --clean --noconfirm backend.spec
63-
64-
This will create a folder called “backend” under /backend/dist/ Move this folder to the /app/ directory.
65-
66-
9. Install yarn.
67-
68-
10. Navigate to /app/ and have yarn install the Nodejs libraries:
52+
8. Navigate to /app/ and have yarn install the Nodejs libraries:
6953

7054
> yarn install
7155
72-
11. (Windows-specific step) Remove the following line from package.json
56+
9. (Windows-specific step) Remove the following line from package.json
7357

7458
> "executableName": "kaplan-desktop",
7559
76-
12. Have yarn build the executable:
60+
10. Have yarn build the executable:
7761

7862
> yarn make
7963
80-
13. The resulting executable(s) will be under /app/out/
64+
11. The resulting executable(s) will be under /app/out/
8165

8266
## Links:
8367
1. [Kaplan Homepage](https://kaplan.pro)

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "kaplan-desktop",
33
"productName": "Kaplan Desktop",
4-
"version": "0.5.1",
4+
"version": "0.5.2",
55
"description": "An open-source CAT tool.",
66
"homepage": "https://kaplan.pro",
77
"main": "src/main.js",

app/src/editor.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ function selectSegmentForMerge(segmentHeader) {
6868
}
6969
function openCommentForm(buttonElement) {
7070
buttonElement.classList.add("hidden");
71-
buttonElement.nextSibling.classList.add("hidden");
71+
if (buttonElement.nextSibling){
72+
buttonElement.nextSibling.classList.add("hidden");
73+
}
7274

7375
noteDiv = document.createElement("div");
7476
noteDiv.classList.add("note");

app/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ function fireOnReady() {
410410
if (supportsComments === "true") {
411411
notesTD = document.createElement("td");
412412
notesTD.classList.add("notes");
413-
segmentNotes = segments[s_i].getElementsByTagName("notes")
413+
segmentNotes = segments[s_i].getElementsByTagName("misc")
414414
if (segmentNotes.length > 0 && segmentNotes[0].childNodes.length > 0) {
415415
segmentNotes[0].childNodes.forEach(function(segmentNote) {
416416
noteDiv = document.createElement("div");

backend/api/views.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -457,32 +457,6 @@ def project_file(request, project_id, file_id):
457457
translation_units.attrib['source_direction'] = project.get_source_direction()
458458
translation_units.attrib['target_direction'] = project.get_target_direction()
459459

460-
for tu in translation_units:
461-
for segment in tu:
462-
segment_notes = []
463-
if isinstance(bf, KXLIFF):
464-
for segment_lqi in bf.get_segment_lqi(segment.attrib.get('id', 0)):
465-
if segment_lqi.attrib.get('resolved'):
466-
continue
467-
lqi_comment = segment_lqi.attrib.get('comment')
468-
if lqi_comment is None:
469-
lqi_comment == ''
470-
segment_lqi.tag = 'lqi'
471-
segment_lqi.text = lqi_comment
472-
segment_notes.append((datetime.fromisoformat(segment_lqi.attrib['added_at']), segment_lqi))
473-
for child in segment:
474-
if child.tag == 'notes':
475-
for segment_note in child:
476-
segment_notes.append((datetime.fromisoformat(segment_note.attrib['added_at']), segment_note))
477-
segment.remove(child)
478-
479-
if len(segment_notes) > 0:
480-
sorted(segment_notes)
481-
notes = etree.Element('notes')
482-
for datetime_iso, segment_note in segment_notes:
483-
notes.append(segment_note)
484-
segment.append(notes)
485-
486460
return HttpResponse(etree.tostring(translation_units, encoding="UTF-8"))
487461

488462
@csrf_exempt

backend/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Django==3.2.3
2-
kaplan==0.11.1
2+
kaplan==0.12.0
33
mysql-connector-python==8.0.23

0 commit comments

Comments
 (0)