Drarig29 / brackets-viewer.js

A simple library to display tournament brackets (round-robin, single elimination, double elimination).
https://drarig29.github.io/brackets-docs
MIT License
177 stars 45 forks source link

i18n #26

Closed enchantinggg4 closed 3 years ago

enchantinggg4 commented 3 years ago

Is there any planning for adding translation support, or at least simple label scheme instead of hardcoded labels(e.g. BYE, WB etc)

enchantinggg4 commented 3 years ago

Also, I might start implementing library in react, so if I have something to show, I'll create separate issue

Drarig29 commented 3 years ago

I tried to move most of the language-specific things in the lang.ts file with i18n in mind.

This is definitely on the todo list.

I will try to do that.

Drarig29 commented 3 years ago

Also, I might start implementing library in react, so if I have something to show, I'll create separate issue

Ok. I tried to do a full vanilla and lightweight project. What would you want to do in React? Using the viewer or recreating it with React?

enchantinggg4 commented 3 years ago

I'm thinking of recreating it in react using vanilla as a reference.

Drarig29 commented 3 years ago

By the way, I'm not using the viewer in a project where the scores are updated in real-time. That's why I don't use React with it.

When someone wants to get the latest data, he needs to refresh the page, just like in Toornament or Challonge.

enchantinggg4 commented 3 years ago

Hm, It works for me with "hard" repaint, when data changes I clear innerHtml and re-render it. works fine on small brackets, but I am expecting it to become pretty nasty with bigger brackets

Drarig29 commented 3 years ago

Yeah you're right. This viewer project is mostly for my needs right now.

You can have your React fork if you want.

I may want to create a public hosted editor to create and manage tournaments later. But I don't have much time right now.

Maybe I'll use your React fork in the future 😉 (for this editor)

enchantinggg4 commented 3 years ago

Sure, time will tell

enchantinggg4 commented 3 years ago

ah, only now noticed there is an issue already. Closing

Drarig29 commented 3 years ago

Oh yeah, forgot that.

Marking as duplicate of #13

Drarig29 commented 3 years ago

@enchantinggg4 there you go, you now have i18n 😉 (cf. PR https://github.com/Drarig29/brackets-viewer.js/pull/30)

I will wait to resolve other issues to make a new release, if you don't mind.

Drarig29 commented 3 years ago

You can use this CDN link for now: https://cdn.jsdelivr.net/gh/Drarig29/brackets-viewer.js@i18n/dist/brackets-viewer.min.js