Mimesis: Country generation does not respect chosen locale

Created on 25 Jun 2019  路  9Comments  路  Source: lk-geimfari/mimesis

It appears that Address('en').country() does not respect the locale. Countries outside locale are still generated.

Looking at the code it appears there is no implementation for locale specific country, if so, please change issue to a feature request.

enhancement feature

Most helpful comment

Yes, we did the same thing in #664

I will work on it!

All 9 comments

Can you explain, please, what do you exactly expect? .country() returns name of the country for the current locale.

For example:

address = Address('ru')

address.country()
'袣懈褌邪泄'

address.country()
'袪芯褋褋懈褟'

Do you expect something like this?

address = Address('en')

address.country()
'United States of America'

address.country()
'United States of America'

Yes my understanding was that it would return a country who belongs to the locale. Now I can see that it is not the case and it is intended to be that way. Thanks.

Nevertheless locale/region specific data would be a great feature (like cities, countries, etc)

@andkii We will fix it ASAP. By default, it must return the name of the current country.

We can just add a parameter allow_random which will allow random values for it.

@ceccoemi If my memory doesn't let me down, you've already done something like this, haven't you?

Yes, we did the same thing in #664

I will work on it!

Great! Thanks!

@lk-geimfari what do you think about doing the same thing with the continent() function?

@ceccoemi I think it's can be useful.

@lk-geimfari no, maybe it's better to leave it as it is. Because some countries don't have a single specific continent, for example Russia and Turkey, they belong both to Europa and Asia. It could be ambiguous in some situations.

@ceccoemi Agree. Let's don't change it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lk-geimfari picture lk-geimfari  路  5Comments

lk-geimfari picture lk-geimfari  路  3Comments

chris-canipe picture chris-canipe  路  5Comments

faheel picture faheel  路  4Comments

lk-geimfari picture lk-geimfari  路  4Comments