Giter Club home page Giter Club logo

python-zodiac-sign's People

Contributors

crusat avatar ermini avatar garpixspace avatar jcprz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

python-zodiac-sign's Issues

Greek Zodiacs

You can add this in order to support Zodiacs in Greek:

el_dict = (
    (0, "Κριός"),
    (1, "Ταύρος"),
    (2, "Δίδυμοι"),
    (3, "Καρκίνος"),
    (4, "Λέων"),
    (5, "Παρθένος"),
    (6, "Ζυγός"),
    (7, "Σκορπιός"),
    (8, "Τοξότης"),
    (9, "Αιγόκερως"),
    (10, "Υδροχόος"),
    (11, "Ιχθείς"),
)

language_dict = {
    'en_US': en_dict,
    'ru_RU': ru_dict,
    'pt_BR': pt_dict,
    'pt_PT': pt_dict,
	'el': el_dict,
	'el_CY': el_dict,
	'el_GR': el_dict,
    None: en_dict
}

When the locale isn't supported

I suggest when there isn't support for a specific locale to fallback to english:

def _(word_index):
    language = locale.getlocale()
    return language_dict.get(language[0], 'en_US')[word_index][1]

Translation/Localization of zodiac strings

It would be nice if there would be some way to set up localization for the zodiac strings that the library returns.

I'm not sure if this is technically possible to do, but I'd suggest using some dedicated program like gettext.

Otherwise, a way to set a locale when requesting a zodiac string would also work.

Locale issue.

The code needs to be changed like this:

def _(word_index):
language = locale.getlocale()
return language_dict.get(language[0], language_dict.get('en_US'))[word_index][1]

As of now the code is
def _(word_index):
language = locale.getlocale()
return language_dict.get(language[0], 'en_US')[word_index][1]

For me,
language = locale.getlocale()
language[0]

'English_United States'

For the code as of now, 'English_United States' is not included in the language_dict dictionary. So a string 'en_US' is returned. And you can see there will be errors later.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.