Skip to content

Commit

Permalink
New translations.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Sep 9, 2024
1 parent f8303fc commit 290eae4
Show file tree
Hide file tree
Showing 11 changed files with 1,292 additions and 1,667 deletions.
15 changes: 9 additions & 6 deletions bin/python/po_translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ def __init__(self, po_file, lang, use_google = True, use_tokenizer = True):
self.use_google = use_google
self.use_tokenizer = use_tokenizer
self.code = lang[0:2]
# Load the model and tokenizer for English to Simplified Chinese
self.helsinki = self.code
if self.code == 'pt' or self.code == 'fr' or \
self.code == 'es' or self.code == 'it':
self.helsinki = 'ROMANCE'

self.model = self.tokenizer = None

self.have_seen = {}
Expand All @@ -193,12 +199,6 @@ def __init__(self, po_file, lang, use_google = True, use_tokenizer = True):
self.translate_po(po_file, self.code)
return

# Load the model and tokenizer for English to Simplified Chinese
self.helsinki = self.code
if self.code == 'pt' or self.code == 'fr' or \
self.code == 'es' or self.code == 'it':
self.helsinki = 'ROMANCE'

model_name = f"Helsinki-NLP/opus-mt-en-{self.helsinki}"
print('Load model',model_name)

Expand Down Expand Up @@ -360,6 +360,9 @@ def translate_po(self, po_input, language):
for entry in po:
if language == 'en':
entry.msgstr = entry.msgid
if 'fuzzy' in entry.flags:
entry.flags.remove('fuzzy')
continue
elif entry.msgid in DONT_TRANSLATE:
entry.msgstr = entry.msgid
elif 'GOOGLE' == entry.msgstr:
Expand Down
37 changes: 16 additions & 21 deletions src/lib/mrvWidgets/mrvPreferencesUI.fl
Original file line number Diff line number Diff line change
Expand Up @@ -1022,8 +1022,8 @@ v->uiPrefsFPS->value( g );}
}
}
Fl_Group {} {
label OCIO open
xywh {288 37 555 360} box EMBOSSED_BOX align 5
label OCIO
xywh {288 37 555 360} box EMBOSSED_BOX align 5 hide
} {
Fl_Group {} {
label OCIO open
Expand Down Expand Up @@ -1080,7 +1080,7 @@ uiPrefs->uiPrefsOCIOConfig->value( r.c_str() );}
tooltip {Pick a config.ocio file from disk.} xywh {751 182 55 31}
}
Fl_Light_Button uiOCIOUseDefaultDisplayView {
label {Use Default Display and View} selected
label {Use Default Display and View}
tooltip {When this option is on, and your config.ocio has a default display and view, it will be used to be set as default.} xywh {421 236 288 24}
}
Fl_Light_Button uiOCIOUseActiveViews {
Expand All @@ -1090,26 +1090,25 @@ uiPrefs->uiPrefsOCIOConfig->value( r.c_str() );}
}
}
Fl_Group {} {
label {OCIO Defaults}
xywh {288 37 555 367} align 5 hide
label {OCIO Defaults} open
xywh {288 37 555 367} align 5
} {
Fl_Group {} {
label {OCIO Defaults} open
label {OCIO Defaults} open selected
xywh {305 54 520 340} box ROUNDED_BOX
} {
Fl_Group uiOCIO_ICS {
label {Input Color Space} open
xywh {315 75 500 220} box ROUNDED_BOX
} {
Fl_Group {} {
Fl_Group {} {open
xywh {363 83 411 34}
} {
Fl_Input uiOCIO_8bits_ics {
label {8-bits}
user_data this user_data_type {PreferencesUI*}
callback {mrv::Media::ocio_8bits_ics = o->value();}
tooltip {The name of the OCIO default image color space for 8 bit images (jpg, bmp, etc)
(Environment variable: MRV_OCIO_8bits_ICS)} xywh {398 87 283 25} box THIN_DOWN_BOX color 20 labelsize 11 align 132 textcolor 56
tooltip {The name of the OCIO default image color space for 8 bit images (jpg, bmp, etc).} xywh {398 87 283 25} box THIN_DOWN_BOX color 20 labelsize 11 align 132 textcolor 56
}
Fl_Button {} {
label Pick
Expand All @@ -1120,15 +1119,14 @@ v->uiOCIO_8bits_ics->do_callback();}
xywh {686 87 88 25}
}
}
Fl_Group {} {
Fl_Group {} {open
xywh {371 123 403 32}
} {
Fl_Input uiOCIO_16bits_ics {
label {16-bits}
user_data this user_data_type {PreferencesUI*}
callback {mrv::Media::ocio_16bits_ics = o->value();}
tooltip {The name of the OCIO default image color space for 16-bit images (cin, tiff, etc)
(Environment variable: MRV_OCIO_16bits_ICS)} xywh {398 127 283 25} box THIN_DOWN_BOX color 20 labelsize 11 align 132 textcolor 56
tooltip {The name of the OCIO default image color space for 16-bit images (cin, tiff, etc.)} xywh {398 127 283 25} box THIN_DOWN_BOX color 20 labelsize 11 align 132 textcolor 56
}
Fl_Button {} {
label Pick
Expand All @@ -1139,15 +1137,14 @@ v->uiOCIO_16bits_ics->do_callback();}
xywh {686 127 88 25}
}
}
Fl_Group {} {
Fl_Group {} {open
xywh {371 165 403 39}
} {
Fl_Input uiOCIO_32bits_ics {
label {32-bits}
user_data this user_data_type {PreferencesUI*}
callback {mrv::Media::ocio_32bits_ics = o->value();}
tooltip {The name of the OCIO default image color space for 32-bit int images (openexr integers, etc)
(Environment variable: MRV_OCIO_32bits_ICS)} xywh {398 170 283 24} box THIN_DOWN_BOX color 20 labelsize 11 align 132 textcolor 56
tooltip {The name of the OCIO default image color space for 32-bit int images (openexr integers, etc.)} xywh {398 170 283 24} box THIN_DOWN_BOX color 20 labelsize 11 align 132 textcolor 56
}
Fl_Button {} {
label Pick
Expand All @@ -1158,15 +1155,14 @@ v->uiOCIO_32bits_ics->do_callback();}
xywh {686 170 88 25}
}
}
Fl_Group {} {
Fl_Group {} {open
xywh {368 210 406 33}
} {
Fl_Input uiOCIO_half_ics {
label half
user_data this user_data_type {PreferencesUI*}
callback {mrv::Media::ocio_half_ics = o->value();}
tooltip {The name of the OCIO default image color space for OpenEXR half images
(Environment variable: MRV_OCIO_half_ICS)} xywh {397 214 284 25} box THIN_DOWN_BOX color 20 labelsize 11 align 132 textcolor 56
tooltip {The name of the OCIO default image color space for OpenEXR half images.} xywh {397 214 284 25} box THIN_DOWN_BOX color 20 labelsize 11 align 132 textcolor 56
}
Fl_Button {} {
label Pick
Expand All @@ -1177,15 +1173,14 @@ v->uiOCIO_half_ics->do_callback();}
xywh {686 214 88 25}
}
}
Fl_Group {} {
Fl_Group {} {open
xywh {366 253 406 33}
} {
Fl_Input uiOCIO_float_ics {
label float
user_data this user_data_type {PreferencesUI*}
callback {mrv::Media::ocio_float_ics = o->value();}
tooltip {The name of the OCIO default image color space for half and float images (OpenEXR, dpx, etc)
(Environment variable: MRV_OCIO_float_ICS)} xywh {395 257 284 25} box THIN_DOWN_BOX color 20 labelsize 11 align 132 textcolor 56
tooltip {The name of the OCIO default image color space for half and float images (OpenEXR, hdr, dpx, etc.)} xywh {395 257 284 25} box THIN_DOWN_BOX color 20 labelsize 11 align 132 textcolor 56
}
Fl_Button {} {
label Pick
Expand Down
Loading

0 comments on commit 290eae4

Please sign in to comment.