-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable I18N for reveals, contexts and texts #72
- Loading branch information
Showing
6 changed files
with
35 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,25 @@ | ||
from utils.widgets import InfoButton | ||
from stemp_abw.app_settings import labels, TEXT_FILES | ||
from stemp_abw.app_settings import labels, text_files | ||
|
||
def prepare_label_data(): | ||
def label_data(): | ||
return {'panels': labels()['panels'], | ||
'tooltips': labels()['tooltips'], | ||
'charts': labels()['charts']} | ||
|
||
|
||
def create_reveal_info_button(): | ||
def text_data(): | ||
"""Create reveal window with trigger button with content from markdown file | ||
(general app info buttons, e.g. in top navigation bar) | ||
""" | ||
text_data = {} | ||
for name, data in TEXT_FILES.items(): | ||
text_data_store = {} | ||
for name, data in text_files().items(): | ||
f = open(data['file'], 'r', encoding='utf-8') | ||
text = f.read() | ||
text_data[name] = InfoButton(text=text, | ||
text_data_store[name] = InfoButton(text=text, | ||
tooltip=text.split("\n")[0][2:], | ||
is_markdown=True, | ||
ionicon_type=data['icon'], | ||
ionicon_size='medium', | ||
info_id=name) | ||
f.close() | ||
return {'texts': text_data} | ||
|
||
|
||
LABEL_DATA = prepare_label_data() | ||
TEXT_DATA = create_reveal_info_button() | ||
return {'texts': text_data_store} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters