Code Monkey home page Code Monkey logo

Comments (3)

JanVargovsky avatar JanVargovsky commented on September 24, 2024

It would be great. There are methods Before/After execute of a command so you can set the correct culture information based on config here. However I see that I'm using multiple base classes from Discord.Net/Discord.Net.Interactive libraries such as ModuleBase, ModuleBase<T> and InteractiveBase<T>, so every class would have to override it on its own - not in every module but rather create some own base classes for it and just derive from them.

Do you need some help or guidance?

from pogo.discordbot.

a2937 avatar a2937 commented on September 24, 2024

I have been looking at the summary attribute and wondering how to localize those. They don't seem to like allowing non-certain text values. Also I am partial just to just letting the hosted location determine the localization, as I am not quite sure how to read from your config file. Also I am trying to find an efficient way of getting into the resx file and having to specify the locale every single time. I am considering an extension method somewhere perhaps. In addition concepts are a little more difficult when you apply them.

from pogo.discordbot.

JanVargovsky avatar JanVargovsky commented on September 24, 2024

Summary attribute can still remain as a key to a resources. Its not about the host, currently the bot is being used across a few guilds (servers - Discord terminology). Each guild can specify its own language. It has to be configurable so every guild can choose what language they would like to use.

I found this package named Microsoft.Extensions.Localization that has this factory. IStringLocalizer looks better to me rather than your proposed ResourceManager that is there for a couple for years (its quite obsolete in my view and there are better approaches nowadays). I would like to have only one resx file per language (Global.en.resx, Global.cs.resx etc.) in Resources folder. Just wrap the mentioned factory class into e.g. LocalizationService, load resource based on thread's culture and that is basically it.

Configuration is only about adding a new property e.g. Language to GuildOptions, then it will be automatically loaded from configuration*.json files.

from pogo.discordbot.

Related Issues (1)

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.