Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ougi strings localization #2

Open
HakkinDavid opened this issue Aug 20, 2020 · 2 comments
Open

Ougi strings localization #2

HakkinDavid opened this issue Aug 20, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@HakkinDavid
Copy link
Owner

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 HakkinDavid self-assigned this Aug 20, 2020
@HakkinDavid HakkinDavid added the enhancement New feature or request label Aug 20, 2020
@HakkinDavid
Copy link
Owner Author

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

  • Interactive content, such as responses is translated on the fly.
  • Bot commands are localizable, by default it uses English, if a preferred language is specified, it'll search for the proper strings in a custom JSON object, accessable as ougi.localization.js. If no translation is found, it'll translate on the fly. // Not all commands have been adapted to accept translations. WIP.
  • Guild owners can set their guild's preferred language, default is none.
  • Users can set their specific preferred language, which is used across DMs and guilds with no preferred language set.
  • Speak command will use the preferred guild language, defaults on English.

Pending:

  • Localization portal
  • Caching translations
  • Finishing localization on static content
  • Learning from languages and abstracting ???

@HakkinDavid
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant