Steffo99 / greed

Customizable, multilanguage Telegram shop bot with Payments support
GNU Affero General Public License v3.0
540 stars 263 forks source link

Scape of the keys in file string #82

Closed tomtomaZ closed 4 years ago

tomtomaZ commented 4 years ago

I tried to insert some strings of my own in the language files, but as braces called "{...}" it doesn't work in the new messages I created even following a syntax, maybe it is an error in the localization.py formation

Steps to reproduce the behavior:

  1. Go to wathever string file
  2. try create a new message format using the standard keys
  3. when a tested the key did showed, like "{name}", but works in messages that were already there
Steffo99 commented 4 years ago

Can you please provide an example key that doesn't work with the relative self.loc call?

tomtomaZ commented 4 years ago

Just a call that i create dosen't work with self.loc.get(), i create a call called "conversation_click_add_cart", and in his string in a pt_br.py i used a product of name key, the message is showed but the key is not converted for the value, showing {name} in message

Steffo99 commented 4 years ago

Have you passed the key as a keyword argument in the self.loc.get call?

Can you please send me the problematic line(s) of code?

Steffo99 commented 4 years ago

you need to pass name in the self.loc.get call

self.loc.get("conversation_click_add_cart", name="your string")