Commit 61137ee1 authored by Philipp Auersperg's avatar Philipp Auersperg
Browse files

i18n

parent 4e17427b
.PHONY: po mo
LCDIR=./locale
SOURCES=src/ui/kivy/sequence.py
SOURCES=src/ui/kivy/sequence.py mains/mobilep3/main.py
DOMAIN=default
POTCREATE=./bin/pot-create
LANGUAGES=de en
......
......@@ -51,7 +51,7 @@ from kivymd.button import MDRaisedButton as Button, MDIconButton
from ui.kivy.settings import SettingsSheet, open_settings_dialog
from ui.kivy.widgetsmd import BDDialog
from ui.kivy.i18n import i18nstr
from ui.kivy.i18n import i18nstr, I18NProperty as _
logger = logging.getLogger("woodmaster")
......@@ -123,28 +123,28 @@ Builder.load_string("""
NavigationDrawerIconButton:
icon: 'format-list-bulleted'
text: "Overview"
text: root.text_overview
on_release: root.wiz.open_screen('screen_list')
NavigationDrawerIconButton:
icon: 'map'
text: "Map view"
text: root.text_mapview
on_release: root.wiz.switch_to_map()
NavigationDrawerIconButton:
icon: 'camera'
text: "Neue Aufnahme"
text: root.text_new_capture
# on_release: root.wiz.open_screen('screen_props')
on_release: root.wiz.capture_sequence()
NavigationDrawerIconButton:
icon:'brush'
text:'Theming'
text:root.text_theming
on_release: root.on_set_theme()
NavigationDrawerIconButton:
icon:'exit-to-app'
text:'Beenden'
text:root.text_exit
on_release: root.on_exit()
# NavigationDrawerIconButton:
......@@ -188,6 +188,12 @@ class MainWindowMobile(NavigationLayout):
responsible for selecting a project
"""
text_overview = _('overview')
text_mapview = _('map view')
text_new_capture = _('new capture')
text_theming = _('theming')
text_exit = _('exit')
# project = ObjectProperty(None)
def __init__(self, *a, **kw):
......
......@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE 1.0\n"
"POT-Creation-Date: 2019-04-13 16:57+0200\n"
"POT-Creation-Date: 2019-04-13 18:52+0200\n"
"PO-Revision-Date: 2019-04-13 16:57+0200\n"
"Last-Translator: Philipp Auersperg <phil@bluedynamics.com>\n"
"Language-Team: German\n"
......@@ -22,24 +22,92 @@ msgstr "weiter"
#: src/ui/kivy/sequence.py:220
msgid "location"
msgstr ""
msgstr "Standort"
#: src/ui/kivy/sequence.py:221
msgid "overlapping"
msgstr ""
msgstr "Ueberlappende Bilder"
#: src/ui/kivy/sequence.py:222
msgid "comment"
msgstr ""
msgstr "Kommentar"
#: src/ui/kivy/sequence.py:223
msgid "service provider"
msgstr ""
msgstr "Dienstleister"
#: src/ui/kivy/sequence.py:224
msgid "log length"
msgstr ""
msgstr "Stammlaenge"
#: src/ui/kivy/sequence.py:225
msgid "pile name"
msgstr ""
msgstr "Name des Polters"
#: src/ui/kivy/sequence.py:226
msgid "delete pile"
msgstr "Polter entfernen"
#: src/ui/kivy/sequence.py:812
msgid "detection task"
msgstr "Vorgang"
#: src/ui/kivy/sequence.py:813 src/ui/kivy/sequence.py:907
msgid "progress"
msgstr "Fortschritt"
#: src/ui/kivy/sequence.py:903
msgid "properties"
msgstr "Eigenschaften"
#: src/ui/kivy/sequence.py:904
msgid "options"
msgstr "Optionen"
#: src/ui/kivy/sequence.py:905
msgid "shapes detected"
msgstr "Staemme erkannt"
#: src/ui/kivy/sequence.py:906
msgid "log detection"
msgstr "Stammerkennung"
#: src/ui/kivy/sequence.py:908
msgid "dedup"
msgstr "deduplizieren"
#: src/ui/kivy/sequence.py:909
msgid "dedupped"
msgstr "dedupliziert"
#: src/ui/kivy/sequence.py:910
msgid "keypoints"
msgstr "Keypoint"
#: src/ui/kivy/sequence.py:911
msgid "ready"
msgstr "fertig"
#: src/ui/kivy/sequence.py:1327
msgid "new pile"
msgstr "Neuen Polter anlegen"
#: mains/mobilep3/main.py:191
msgid "overview"
msgstr "Uebersicht"
#: mains/mobilep3/main.py:192
msgid "map view"
msgstr "Karte"
#: mains/mobilep3/main.py:193
msgid "new capture"
msgstr "Neue Aufnahme"
#: mains/mobilep3/main.py:194
msgid "theming"
msgstr "Farbschema"
#: mains/mobilep3/main.py:195
msgid "exit"
msgstr "Beenden"
......@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE 1.0\n"
"POT-Creation-Date: 2019-04-13 16:57+0200\n"
"POT-Creation-Date: 2019-04-13 18:52+0200\n"
"PO-Revision-Date: 2019-04-13 16:57+0200\n"
"Last-Translator: Philipp Auersperg <phil@bluedynamics.com>\n"
"Language-Team: English\n"
......@@ -43,3 +43,71 @@ msgstr "log length"
#: src/ui/kivy/sequence.py:225
msgid "pile name"
msgstr "pile name"
#: src/ui/kivy/sequence.py:226
msgid "delete pile"
msgstr ""
#: src/ui/kivy/sequence.py:812
msgid "detection task"
msgstr ""
#: src/ui/kivy/sequence.py:813 src/ui/kivy/sequence.py:907
msgid "progress"
msgstr ""
#: src/ui/kivy/sequence.py:903
msgid "properties"
msgstr ""
#: src/ui/kivy/sequence.py:904
msgid "options"
msgstr ""
#: src/ui/kivy/sequence.py:905
msgid "shapes detected"
msgstr ""
#: src/ui/kivy/sequence.py:906
msgid "log detection"
msgstr ""
#: src/ui/kivy/sequence.py:908
msgid "dedup"
msgstr ""
#: src/ui/kivy/sequence.py:909
msgid "dedupped"
msgstr ""
#: src/ui/kivy/sequence.py:910
msgid "keypoints"
msgstr ""
#: src/ui/kivy/sequence.py:911
msgid "ready"
msgstr ""
#: src/ui/kivy/sequence.py:1327
msgid "new pile"
msgstr ""
#: mains/mobilep3/main.py:191
msgid "overview"
msgstr ""
#: mains/mobilep3/main.py:192
msgid "map view"
msgstr ""
#: mains/mobilep3/main.py:193
msgid "new capture"
msgstr ""
#: mains/mobilep3/main.py:194
msgid "theming"
msgstr ""
#: mains/mobilep3/main.py:195
msgid "exit"
msgstr ""
......@@ -283,6 +283,7 @@ class i18nstr(str):
locale = jlocale.getDefault()
return locale.language
else:
return 'de'
raise AttributeError("have no locale, need android")
i18nstr.switch_lang('en')
......
......@@ -223,6 +223,7 @@ class SequenceProps(ScrollView):
text_service_provider = _('service provider')
text_log_length = _('log length')
text_pile_name = _('pile name')
text_delete_pile = _('delete pile')
def __init__(self, *a, **kw):
super().__init__(*a, **kw)
......@@ -232,7 +233,7 @@ class SequenceProps(ScrollView):
Clock.schedule_once(self.after_init)
def after_init(self, *a):
delete_button=MDRaisedButton(text='delete')
delete_button=MDRaisedButton(text=self.text_delete_pile)
delete_button.bind(
on_release=lambda dt:
self.dispatch("on_delete_selected"))
......@@ -789,12 +790,12 @@ Builder.load_string("""
# text:'Task'
MDLabel:
id:log
text:'log'
text:root.text_detection_task
theme_text_color: 'Primary'
BoxLayout:
MDLabel:
id:sublog
text:'sublog'
text:root.text_progress
theme_text_color: 'Primary'
MDLabel:
......@@ -808,6 +809,8 @@ class ProgressContent(BoxLayout):
# def __init__(self, *a, **kw):
# import pdb;pdb.set_trace()
# super(ProgressContent, self).__init__(self, *a, **kw)
text_detection_task = _('detection task')
text_progress = _('progress')
Builder.load_string("""
<SequenceView>:
......@@ -850,6 +853,7 @@ Builder.load_string("""
text:'berechnen!'
# on_release:root.detect_dedup()
on_release:root.start_computation()
MDIconButton:
icon:'file-document'
# text:'properties'
......@@ -896,6 +900,16 @@ class SequenceView(BoxLayout):
cascade_name = StringProperty('lbp-16-11')
smooth = BooleanProperty(False)
text_properties = _('properties')
text_options = _('options')
text_shapes_detected = _('shapes detected')
text_detecting = _('log detection')
text_progress = _('progress')
text_dedup = _('dedup')
text_dedupped = _('dedupped')
text_keypoints = _('keypoints')
text_ready = _('ready')
def __init__(self, *a, **kw):
super(SequenceView, self).__init__(*a, **kw)
Clock.schedule_once(self.after_init, 0)
......@@ -942,7 +956,7 @@ class SequenceView(BoxLayout):
scale_factor=self.scale_factor,
min_neighbors=self.imin_neighbors,
smooth=self.ids.smooth.state)
self.update_progress("shapes detected", self.dedup_shapes)
self.update_progress(self.shapes_detected, self.dedup_shapes)
# Clock.schedule_once(self.dedup_shapes, 0)
def dedup_shapes(self, *a):
......@@ -950,7 +964,7 @@ class SequenceView(BoxLayout):
self.summarize()
def detect_dedup(self):
Clock.schedule_once(functools.partial(self.update_progress, 'detecting', self.detect_shapes), 0)
Clock.schedule_once(functools.partial(self.update_progress, self.text_detecting, self.detect_shapes), 0)
def start_computation(self):
# self.detect_dedup()
......@@ -967,7 +981,7 @@ class SequenceView(BoxLayout):
content=ProgressContent()
self.progress_dialog = MDDialog(
content=content,
title='Progress',
title=self.text_progress,
size_hint=(.5, .5),
auto_dismiss=False
)
......@@ -981,11 +995,11 @@ class SequenceView(BoxLayout):
dedup = self.sequence.deduplicate_shapes_generator()
all = chaining.clock_chain([
functools.partial(self.log_step,"detect"),
functools.partial(self.log_step, self.text_detecting),
[detect, self.log_detect],
functools.partial(self.log_step,"dedup"),
functools.partial(self.log_step, self.text_dedup),
[dedup, self.log_dedup],
functools.partial(self.log_step,"ready"),
functools.partial(self.log_step, self.text_ready),
self.summarize,
self.show_first_image,
self.progress_dialog.dismiss
......@@ -993,9 +1007,9 @@ class SequenceView(BoxLayout):
self.log_exception)
else:
all = chaining.clock_chain([
functools.partial(self.log_step, "detect"),
functools.partial(self.log_step, self.text_detecting),
[detect, self.log_detect],
functools.partial(self.log_step, "ready"),
functools.partial(self.log_step, self.text_ready),
self.summarize,
self.show_first_image,
self.progress_dialog.dismiss
......@@ -1005,12 +1019,12 @@ class SequenceView(BoxLayout):
all()
def log_detect(self, r):
self.progress_dialog.content.sublog.text = "detected:%s" % r
self.progress_dialog.content.sublog.text = (self.text_shapes_detected + " : %s") % (r + 1)
def log_dedup(self, r):
dlg=self.progress_dialog.content
dlg.sublog.text = "dedup:%s , %s" % (r['index'], r['index']+1)
dlg.details.text = 'keypoints: %s' % r['keypoints']
dlg.sublog.text = (self.text_dedup + " : %s , %s") % (r['index']+1, r['index']+2)
dlg.details.text = (self.text_keypoints + ' : %s') % r['keypoints']
def log_step(self, msg):
self.progress_dialog.content.log.text = str(msg)
......@@ -1042,7 +1056,7 @@ class SequenceView(BoxLayout):
content = SequenceProps(location=self.sequence.location,
show_delete=True)
content.data = self.sequence.metadata
dlg = BDDialog( title="Properties",
dlg = BDDialog( title=self.text_properties,
size_hint=(1,1), auto_dismiss=True)
def handle(content):
# content.data.write_metadata()
......@@ -1075,7 +1089,7 @@ class SequenceView(BoxLayout):
def options_dialog(self):
# import pdb;pdb.set_trace()
print("options dialog")
dialog = BDDialog(title='Options',
dialog = BDDialog(title=self.text_options,
auto_dismiss=True,
size_hint=(.8, .8),)
......@@ -1310,6 +1324,8 @@ class SequenceWizard(ScreenManager):
sequence_path = StringProperty()
sequence_container=ObjectProperty()
text_new_pile = _('new pile')
def on_sequence(self, *a, **kw):
# print 'SequenceWizard::on_sequence:', a, kw
self.sequence_path=self.sequence.path
......@@ -1396,7 +1412,7 @@ class SequenceWizard(ScreenManager):
data={}
content = SequenceProps()
content.data = data
dlg = BDDialog(title="Neuen Polter anlegen", size_hint=(1,1), auto_dismiss=True)
dlg = BDDialog(title=self.text_new_pile, size_hint=(1,1), auto_dismiss=True)
def handle(content):
content.read_fields()
self.switch_to_capture(content, id=id, ref_id=ref_id, orig_sequence=orig_sequence)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment