Closed jompu closed 5 years ago
Hi @jompu - thanks for the suggestion.
I'd disagree on this - not all projects need translations, and we can't assume that all developers will be familiar with the _(...)
method. In that situation, it would be a bad idea to introduce the concept at the same time as demonstrating how to use this library - they could be misled into thinking that _(...)
is part of wagtail-generic-chooser's functionality.
If we get round to creating detailed documentation for this library (with tutorial and reference sections, rather than just a readme), then I think we could sensibly include translations as part of the tutorial.
Sorry, I think I misunderstood what you were suggesting here...
It's better to give translators complete sentences such as "Choose a person" rather than having them translate "Person" separately, as the "choose a..." text might have to change according to the following word (e.g. "a" vs "an" in English, or different genders in other languages).
The snippet chooser in Wagtail does this the "wrong" way because it's a single class dealing with many possible models, so translations have to work around that limitation (e.g. "Choose person" instead of "Choose a person"). wagtail-generic-chooser allows us to improve on this by having a separate translation for each model.
In the README.md, the examples should make translations like in the example below. This way they are translated correctly and this is also how Wagtail does them.