I am new to django and i am loving it so far especially its nice community. Here is my question: I have this model
class Nationality(models.Model):
nationality_fr = models.CharField(max_length=50)
nationality_en = models.CharField(max_length=50)
show_flag = models.BooleanField()
display_order = models.PositiveSmallIntegerField()
def __str__(self):
return self.nationality_fr
I want to change the __ str __ function to return nationality_fr if the language selected (by the user) is "fr" and language_en if the selected language is "en". the reason i need this is because i am showing a drop-down for selecting nationalities for the user to choose and he/she should see the choices in his/her language. what is the best to way to deal with this?
Note: I know there is a nice app for countries but i should be able to do that for other scenarios other than this countries scenario.