Userfeedback #789

Userfeedback #783: Fehlende Übersetzungen De

api data like content category 'Sheet Music' won't get translated ...

Added by Thomas Mielke over 5 years ago. Updated over 4 years ago.

Status:ErledigtStart date:
Priority:NormalDue date:
Assignee:Thomas Mielke% Done:

100%

Category:-
Target version:Repertoire 2) Testing phase II

Description

... as api data won't be rendered. Translation strings need to be provided when initializing data tables.

This goes deep into the guts of datatables. Please take over, Alex!

Associated revisions

Revision ed60153b
Added by Thomas Mielke over 5 years ago

added translation for content categories, fixes #789

History

#1 Updated by Alexander Blum over 5 years ago

  • Assignee changed from Alexander Blum to Thomas Mielke

You mean, this doesn't work? This has nothing to do with datatables. It needs to be translated manually then.

#2 Updated by Alexander Blum over 5 years ago

Note: Link updated (pointed to an outdated doc version)

#3 Updated by Thomas Mielke over 5 years ago

You mean something like

from pyramid.i18n import get_localizer, TranslationString

...

# localization
import rpdb2; rpdb2.start_embedded_debugger("supersecret", fAllowRemote = True)
locale = get_localizer(request)
content_category = {

'audio': _("Audio"),
'sheet': _("Sheet Music"),
'lyrics': _("Lyrics"),

}

It gets the correct localizer 'de', so it seems. But the content types still don't get translated.

#4 Updated by Thomas Mielke over 5 years ago

  • Assignee changed from Thomas Mielke to Alexander Blum

#5 Updated by Alexander Blum over 5 years ago

See the next part of the example

translated = localizer.translate(ts) # translation string

#6 Updated by Alexander Blum over 5 years ago

  • Assignee changed from Alexander Blum to Thomas Mielke

#7 Updated by Alexander Blum over 5 years ago

and without the debugger :P

#8 Updated by Thomas Mielke over 5 years ago

seems, I forgot to add the domain as parameter also...

#9 Updated by Anonymous over 5 years ago

  • Status changed from Neu to Erledigt
  • % Done changed from 0 to 100

Applied in changeset commit:collecting_society_portal_repertoire|ed60153b4969ad381906cf237b062182e9d733a0.

#10 Updated by Alexander Blum over 4 years ago

  • Target version changed from 2) Testing phase II to Repertoire 2) Testing phase II

Also available in: Atom PDF