Skip to content

Commit

Permalink
Add: italian language
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinpascale committed Jul 17, 2023
1 parent f7c47ad commit b92a12c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gensha.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import subprocess

langs = ['tam','eng','hin','jpn','rus','fra','tha','ara','chi_sim','spa', 'ind']
langs = ['tam','eng','hin','jpn','rus','fra','tha','ara','chi_sim','spa','ind', 'ita']

for lang in langs :
file_url = 'https://github.com/tesseract-ocr/tessdata_best/raw/main/'+lang+'.traineddata'
Expand Down
5 changes: 5 additions & 0 deletions gnomeapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ modules:
url: https://github.com/tesseract-ocr/tessdata_best/raw/main/ind.traineddata
sha256: 1f6596041ffb4cd5094e5f98764db43cfde04edb8f02b988f90ebc1353ac73b8
dest: traineddata
- type: file
url: https://github.com/tesseract-ocr/tessdata_best/raw/main/ita.traineddata
sha256: 8df9c89176fb93f56bf4b2d4ede04c01c1f31d4b7697fbd76cc336df700f3f38
dest: traineddata

post-install:
- install -p -D -m 0644 "traineddata"/deu.traineddata -t "${FLATPAK_DEST}/share/tessdata/";
Expand All @@ -127,3 +131,4 @@ modules:
- install -p -D -m 0644 "traineddata"/chi_sim.traineddata -t "${FLATPAK_DEST}/share/tessdata/";
- install -p -D -m 0644 "traineddata"/spa.traineddata -t "${FLATPAK_DEST}/share/tessdata/";
- install -p -D -m 0644 "traineddata"/ind.traineddata -t "${FLATPAK_DEST}/share/tessdata/";
- install -p -D -m 0644 "traineddata"/ita.traineddata -t "${FLATPAK_DEST}/share/tessdata/";
5 changes: 5 additions & 0 deletions manifests/tesseract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ sources:
url: https://github.com/tesseract-ocr/tessdata_best/raw/main/ind.traineddata
sha256: 1f6596041ffb4cd5094e5f98764db43cfde04edb8f02b988f90ebc1353ac73b8
dest: traineddata
- type: file
url: https://github.com/tesseract-ocr/tessdata_best/raw/main/ita.traineddata
sha256: 8df9c89176fb93f56bf4b2d4ede04c01c1f31d4b7697fbd76cc336df700f3f38
dest: traineddata

post-install:
- install -p -D -m 0644 "traineddata"/eng.traineddata -t "${FLATPAK_DEST}/share/tessdata/";
Expand All @@ -64,6 +68,7 @@ post-install:
- install -p -D -m 0644 "traineddata"/nld.traineddata -t "${FLATPAK_DEST}/share/tessdata/";
- install -p -D -m 0644 "traineddata"/tur.traineddata -t "${FLATPAK_DEST}/share/tessdata/";
- install -p -D -m 0644 "traineddata"/ind.traineddata -t "${FLATPAK_DEST}/share/tessdata/";
- install -p -D -m 0644 "traineddata"/ita.traineddata -t "${FLATPAK_DEST}/share/tessdata/";


modules:
Expand Down
4 changes: 4 additions & 0 deletions src/components/LanguageButton.vala
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class LanguageButton : Gtk.MenuButton {
var tur = new Gtk.ModelButton () ;
var deu = new Gtk.ModelButton () ;
var ind = new Gtk.ModelButton () ;
var ita = new Gtk.ModelButton () ;

deu.text = "German" ;
nld.text = "Dutch" ;
Expand All @@ -31,6 +32,7 @@ public class LanguageButton : Gtk.MenuButton {
fra.text = "French" ;
ara.text = "Arabic" ;
ind.text = "Indonesian" ;
ita.text = "Italiano";

deu.clicked.connect (() => { lang.save_pref_language ("deu") ; }) ;
eng.clicked.connect (() => { lang.save_pref_language ("eng") ; }) ;
Expand All @@ -43,6 +45,7 @@ public class LanguageButton : Gtk.MenuButton {
nld.clicked.connect (() => { lang.save_pref_language ("nld") ; }) ;
tur.clicked.connect (() => { lang.save_pref_language ("tur") ; }) ;
ind.clicked.connect (() => { lang.save_pref_language ("ind") ; }) ;
ita.clicked.connect (() => { lang.save_pref_language ("ita") ; }) ;

menu_list.add (eng) ;
menu_list.add (chi_sim) ;
Expand All @@ -54,6 +57,7 @@ public class LanguageButton : Gtk.MenuButton {
menu_list.add (tur) ;
menu_list.add (rus) ;
menu_list.add (ind) ;
menu_list.add (ita) ;

scroll_view.add (menu_list) ;
scroll_view.show_all () ;
Expand Down

0 comments on commit b92a12c

Please sign in to comment.