HakkinDavid / OugiBot

Oshino Ougi
https://top.gg/bot/629837958123356172
3 stars 0 forks source link

Ougi strings localization #2

Open HakkinDavid opened 4 years ago

HakkinDavid commented 4 years ago

An AI is not necessarily enclosed to English speakers usage, specially Ougi as a public Discord entity. This is why finding a method to localizate current and future content seamlessly plus link languages to users must be done.

preloaded JSON objects are our best bet rn

HakkinDavid commented 3 years ago

This has been a work in progress for a while now. Progress made since then is:

Pending:

HakkinDavid commented 3 years ago

A week or so ago, I added a translations cache. I think it works pretty well.

Basically, any string requested to ougi.text() will attempt to load from localization.js, if it isn't found it'll check the cache, if it isn't cached yet, Ougi will translate it on the fly then save it into the cache for future requests. Now, localized commands execute a whole lot faster.