First time here? Check out the FAQ!

dealing with %(question)s in translation

Using the replacement "%(question)s" is not good with italian translations. In fact italian words may have different genres which should translate differently. Also there are issue with singular/plural since sometimes the translation would use a plural name where the english original uses singular.

As an example:

  "write a question"  -> "scrivi una domanda" (feminine)   
  "write a message"  -> "scrivi un messaggio" (masculine)
  "latest question feed"  -> "feed ultimi messaggi" (pluralization)

Maybe substitution marks should never contain localized text. I would replace something like:

_("Individual %(question)s feed") % _(question)


{'question': "Individual question feed",
 'answer': "Individual answer feed"}[question]

BTW What is the context of the message "individual %(question)s feed"? "individual" refers to question or to feed?

paolini's avatar
asked 2014-10-21 08:21:35 -0500, updated 2014-10-21 08:28:46 -0500
edit flag offensive 0 remove flag close merge delete


add a comment see more comments

1 Answer


This form is used in the following context:

_('Individual %(question)s feed') % {'question': askbot_settings.WORDS_QUESTION_SINGULAR}

And the purpose is to replace the word "question" with something else, such as "problem". If such replacement does not work in Italian, then we might need to add yet another parametrizable phrase to the askbot.conf.words module.

Evgeny's avatar
answered 2014-10-23 16:48:12 -0500
edit flag offensive 0 remove flag delete link


In italian it is not possible to parametrize a phrase on a noun... Both "question" and "problem" have the same gender so I have a solution working for these two. But other nouns such as "message" or "comment" have different genre hence the phrase containing them would be different. In general the complete phrase should be parametrized.

paolini's avatar paolini (2014-10-24 05:15:19 -0500) edit

However I think that the best solution would be to remove WORDS_QUESTION_SINGULAR from the configurable settings. Seems to me that it would be fine to modify the source code for such a customization. It is something very similar to the modification of a template... you cannot parametrize all possible HTML layouts in the configuration settings. Maybe one could think of some kind of "skin" package which can be plugged in to override templates and also translation strings?

paolini's avatar paolini (2014-10-24 05:31:05 -0500) edit
add a comment see more comments