g-battaglia / kerykeion

Data driven Astrology 💫
Kerykeion is a python library for astrology. It can generate SVG charts and extract all data about a birthchart, a synastry chart and a transit chart.
https://kerykeion.net
GNU Affero General Public License v3.0
297 stars 103 forks source link

How to change language using object KerykeionChartSVG? #111

Closed wrld-builder closed 2 months ago

wrld-builder commented 5 months ago

I need to change language for KerykeionChartSVG object.

Example:

pic.language_settings = get_settings().language_settings[lang]
print(pic.language_settings)

but it didn't work. help

wrld-builder commented 5 months ago

full code:

@app.get("/make_full_svg")
def make_full_svg(name: str, year: int, month: int, day: int, hour: int, minute: int, city: str, lang: str):
    kanye = AstrologicalSubject(name, year, month, day, hour, minute, city)

    pic = KerykeionChartSVG(kanye, chart_type="Natal")
    pic.language_settings = get_settings().language_settings[lang]
    print(pic.language_settings)

    pic.set_output_directory(Path('./charts'))
    pic.makeSVG()
    print(pic.language_settings)

    return FileResponse(f'{str(pic.chartname)}')
D1fify commented 3 months ago

Haven't found a solution yet?

wrld-builder commented 2 months ago

Have one. I found a config file in sources and set up this for my goals (added some languages). Then, I use an non required argument in function that can change language of file (see docs, I found there). So, I can generate in different langs

Example in my site: astrohelp24.com

D1fify commented 2 months ago

How can I connect with you? Maybe on telegram

g-battaglia commented 2 months ago

@D1fify I created a doc page with examples on how to change language: here

wrld-builder commented 2 months ago

@D1fify yeah you can connect with me in Telegram. My social links in my profile