Skip to content
This repository has been archived by the owner on Sep 24, 2022. It is now read-only.

Language #64

Closed
binaryoverload opened this issue Mar 19, 2019 · 8 comments
Closed

Language #64

binaryoverload opened this issue Mar 19, 2019 · 8 comments
Labels
type: breaking change This issue or PR introduces a breaking change
Milestone

Comments

@binaryoverload
Copy link
Member

So a few meetings ago, we decided that we would implement a language system due to the fact @mrjvs will be doing the same on the website.

Since we already use YAML for our config, I think we should do the same for the language. This will allow for the easy specification of strings (Unlike something like JSON) and also easily allow nesting if so needed.

To access the language string, I think a helper function in the CommandContext will be very helpful and sensible to do. A method like context.i18n(String key) will allow easy access to lang strings without having to put a long reference. (I18n being a shortening of internationalisation)

@binaryoverload binaryoverload added status: planning type: breaking change This issue or PR introduces a breaking change labels Mar 19, 2019
@binaryoverload binaryoverload added this to the Alpha milestone Mar 19, 2019
@binaryoverload binaryoverload added this to To Do in CascadeBot Alpha via automation Mar 19, 2019
@JamesHawkinss
Copy link
Contributor

I have no clue how to set this up, but once someone has done the groundwork I'm more than happy to go through switching all the strings for stuff like that :)

@weeryan17
Copy link
Member

I think we need to plan out how we're going to do this before we talk about how we're going to retrieve lang. You saw the video binary. lang is complex so before we start taking about using lang we should talk about the senerios that pop up in different languages that we need to account and make a system for.

@binaryoverload
Copy link
Member Author

Honestly, I think worrying about the ins and out of different scenarios is a bit out of the scope of the project. I think a simple system where each string has value placeholders would be okay to do.

@weeryan17
Copy link
Member

If we want to have proper lang just replacing strings dosn't work

@binaryoverload
Copy link
Member Author

It will for the most part. I think I have some good ideas on utils which can allow for flexibility also

@binaryoverload
Copy link
Member Author

Time util class

So we have two methods
I18n#formatTime(int time, TimeUnit unit)
I18n#formatTime(long duration)

This can use special fields we set in the lang file like
day, days, hour, hours, seconds etc for each language.

This means that we can create a good util on how time is represented.

This was referenced Mar 30, 2019
@JamesHawkinss JamesHawkinss moved this from To Do to In progress in CascadeBot Alpha Apr 25, 2019
@JamesHawkinss JamesHawkinss moved this from In progress to Being Reviewed in CascadeBot Alpha Apr 25, 2019
@JamesHawkinss
Copy link
Contributor

#98

@weeryan17 weeryan17 moved this from Being Reviewed to In progress in CascadeBot Alpha Apr 27, 2019
@binaryoverload
Copy link
Member Author

Closing this issue as the PR is underway. For reference, we decided to use the http://site.icu-project.org/ to format our language properly.

CascadeBot Alpha automation moved this from In progress to Closed May 12, 2019
@weeryan17 weeryan17 moved this from Closed to Done in CascadeBot Alpha May 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: breaking change This issue or PR introduces a breaking change
Projects
No open projects
Development

No branches or pull requests

3 participants