Skip to content

Commit

Permalink
Merge pull request #6317 from tomachalek/translat_fix
Browse files Browse the repository at this point in the history
Fix translation - template variant must be used to translate
  • Loading branch information
tomachalek authored Oct 7, 2024
2 parents 8bc7d36 + 99fc23d commit 3b9f874
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 32 deletions.
6 changes: 3 additions & 3 deletions lib/action/model/keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ def add_save_menu(self):
self._add_save_menu_item(
'CSV', save_format='csv',
hint=self._req.translate(
f'Saves at most {self.KEYWORDS_QUICK_SAVE_MAX_LINES} items. Use "Custom" for more options.'))
'Saves at most {0} items. Use "Custom" for more options.').format(self.KEYWORDS_QUICK_SAVE_MAX_LINES))
self._add_save_menu_item(
'XLSX', save_format='xlsx',
hint=self._req.translate(
f'Saves at most {self.KEYWORDS_QUICK_SAVE_MAX_LINES} items. Use "Custom" for more options.'))
'Saves at most {0} items. Use "Custom" for more options.').format(self.KEYWORDS_QUICK_SAVE_MAX_LINES))
self._add_save_menu_item(
'XML', save_format='xml',
hint=self._req.translate(
f'Saves at most {self.KEYWORDS_QUICK_SAVE_MAX_LINES} items. Use "Custom" for more options.'))
'Saves at most {0} items. Use "Custom" for more options.').format(self.KEYWORDS_QUICK_SAVE_MAX_LINES))
self._add_save_menu_item(self._req.translate('Custom'))


Expand Down
6 changes: 3 additions & 3 deletions lib/action/model/pquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ def add_save_menu(self):
self._add_save_menu_item(
'CSV', save_format='csv',
hint=self._req.translate(
f'Saves at most {self.PQUERY_QUICK_SAVE_MAX_LINES} items. Use "Custom" for more options.'))
'Saves at most {0} items. Use "Custom" for more options.').format(self.PQUERY_QUICK_SAVE_MAX_LINES))
self._add_save_menu_item(
'XLSX', save_format='xlsx',
hint=self._req.translate(
f'Saves at most {self.PQUERY_QUICK_SAVE_MAX_LINES} items. Use "Custom" for more options.'))
'Saves at most {0} items. Use "Custom" for more options.').format(self.PQUERY_QUICK_SAVE_MAX_LINES))
self._add_save_menu_item(
'XML', save_format='xml',
hint=self._req.translate(
f'Saves at most {self.PQUERY_QUICK_SAVE_MAX_LINES} items. Use "Custom" for more options.'))
'Saves at most {0} items. Use "Custom" for more options.').format(self.PQUERY_QUICK_SAVE_MAX_LINES))
self._add_save_menu_item(self._req.translate('Custom'))
8 changes: 4 additions & 4 deletions lib/views/colls.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ async def collx(amodel: ConcActionModel, req: KRequest, resp: KResponse):
amodel.add_save_menu_item(
'CSV', save_format='csv',
hint=req.translate(
'Saves at most {0} items. Use "Custom" for more options.'.format(amodel.CONC_QUICK_SAVE_MAX_LINES)))
'Saves at most {0} items. Use "Custom" for more options.').format(amodel.CONC_QUICK_SAVE_MAX_LINES))
amodel.add_save_menu_item(
'XLSX', save_format='xlsx',
hint=req.translate(
'Saves at most {0} items. Use "Custom" for more options.'.format(amodel.CONC_QUICK_SAVE_MAX_LINES)))
'Saves at most {0} items. Use "Custom" for more options.').format(amodel.CONC_QUICK_SAVE_MAX_LINES))
amodel.add_save_menu_item(
'XML', save_format='xml',
hint=req.translate(
'Saves at most {0} items. Use "Custom" for more options.'.format(amodel.CONC_QUICK_SAVE_MAX_LINES)))
'Saves at most {0} items. Use "Custom" for more options.').format(amodel.CONC_QUICK_SAVE_MAX_LINES))
amodel.add_save_menu_item(
'TXT', save_format='txt',
hint=req.translate(
'Saves at most {0} items. Use "Custom" for more options.'.format(amodel.CONC_QUICK_SAVE_MAX_LINES)))
'Saves at most {0} items. Use "Custom" for more options.').format(amodel.CONC_QUICK_SAVE_MAX_LINES))
amodel.add_save_menu_item(req.translate('Custom'))
await amodel.save_options(amodel.LOCAL_COLL_OPTIONS, amodel.args.corpname)

Expand Down
12 changes: 6 additions & 6 deletions lib/views/concordance.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,16 +318,16 @@ async def view_conc(
amodel.CONC_QUICK_SAVE_MAX_LINES))
amodel.add_save_menu_item(
'XLSX', save_format='xlsx',
hint=req.translate('Saves at most {0} items. Use "Custom" for more options.'.format(
amodel.CONC_QUICK_SAVE_MAX_LINES)))
hint=req.translate('Saves at most {0} items. Use "Custom" for more options.').format(
amodel.CONC_QUICK_SAVE_MAX_LINES))
amodel.add_save_menu_item(
'XML', save_format='xml',
hint=req.translate('Saves at most {0} items. Use "Custom" for more options.'.format(
amodel.CONC_QUICK_SAVE_MAX_LINES)))
hint=req.translate('Saves at most {0} items. Use "Custom" for more options.').format(
amodel.CONC_QUICK_SAVE_MAX_LINES))
amodel.add_save_menu_item(
'TXT', save_format='txt',
hint=req.translate('Saves at most {0} items. Use "Custom" for more options.'.format(
amodel.CONC_QUICK_SAVE_MAX_LINES)))
hint=req.translate('Saves at most {0} items. Use "Custom" for more options.').format(
amodel.CONC_QUICK_SAVE_MAX_LINES))
amodel.add_save_menu_item(req.translate('Custom'))

# unlike 'globals' 'widectx_globals' stores full structs+structattrs information
Expand Down
16 changes: 8 additions & 8 deletions lib/views/freqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,20 +319,20 @@ def is_non_structural_attr(criteria):

amodel.add_save_menu_item(
'CSV', save_format='csv',
hint=req.translate('Saves at most {0} items. Use "Custom" for more options.'.format(
amodel.CONC_QUICK_SAVE_MAX_LINES)))
hint=req.translate('Saves at most {0} items. Use "Custom" for more options.').format(
amodel.CONC_QUICK_SAVE_MAX_LINES))
amodel.add_save_menu_item(
'XLSX', save_format='xlsx',
hint=req.translate('Saves at most {0} items. Use "Custom" for more options.'.format(
amodel.CONC_QUICK_SAVE_MAX_LINES)))
hint=req.translate('Saves at most {0} items. Use "Custom" for more options.').format(
amodel.CONC_QUICK_SAVE_MAX_LINES))
amodel.add_save_menu_item(
'XML', save_format='xml',
hint=req.translate('Saves at most {0} items. Use "Custom" for more options.'.format(
amodel.CONC_QUICK_SAVE_MAX_LINES)))
hint=req.translate('Saves at most {0} items. Use "Custom" for more options.').format(
amodel.CONC_QUICK_SAVE_MAX_LINES))
amodel.add_save_menu_item(
'TXT', save_format='txt',
hint=req.translate('Saves at most {0} items. Use "Custom" for more options.'.format(
amodel.CONC_QUICK_SAVE_MAX_LINES)))
hint=req.translate('Saves at most {0} items. Use "Custom" for more options.').format(
amodel.CONC_QUICK_SAVE_MAX_LINES))
amodel.add_save_menu_item(req.translate('Custom'))

result['coll_form_args'] = CollFormArgs().update(amodel.args).to_dict()
Expand Down
16 changes: 8 additions & 8 deletions lib/views/wordlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,23 +165,23 @@ async def view_result(amodel: WordlistActionModel, req: KRequest):
amodel.add_save_menu_item(
'CSV', save_format='csv',
hint=req.translate(
'Saves at most {0} items. Use "Custom" for more options.'.format(
amodel.WORDLIST_QUICK_SAVE_MAX_LINES)))
'Saves at most {0} items. Use "Custom" for more options.').format(
amodel.WORDLIST_QUICK_SAVE_MAX_LINES))
amodel.add_save_menu_item(
'XLSX', save_format='xlsx',
hint=req.translate(
'Saves at most {0} items. Use "Custom" for more options.'.format(
amodel.WORDLIST_QUICK_SAVE_MAX_LINES)))
'Saves at most {0} items. Use "Custom" for more options.').format(
amodel.WORDLIST_QUICK_SAVE_MAX_LINES))
amodel.add_save_menu_item(
'XML', save_format='xml',
hint=req.translate(
'Saves at most {0} items. Use "Custom" for more options.'.format(
amodel.WORDLIST_QUICK_SAVE_MAX_LINES)))
'Saves at most {0} items. Use "Custom" for more options.').format(
amodel.WORDLIST_QUICK_SAVE_MAX_LINES))
amodel.add_save_menu_item(
'TXT', save_format='txt',
hint=req.translate(
'Saves at most {0} items. Use "Custom" for more options.'.format(
amodel.WORDLIST_QUICK_SAVE_MAX_LINES)))
'Saves at most {0} items. Use "Custom" for more options.').format(
amodel.WORDLIST_QUICK_SAVE_MAX_LINES))
amodel.add_save_menu_item(req.translate('Custom'))
# custom save is solved in templates because of compatibility issues
result['tasks'] = []
Expand Down

0 comments on commit 3b9f874

Please sign in to comment.