TimisRobert / ash_trans

An Ash extension that provides translations to a resource.
MIT License
3 stars 0 forks source link

Example use cases? #1

Closed RoyalIcing closed 1 month ago

RoyalIcing commented 1 month ago

Hi, got linked to your library, it looks cool. It took a little while to get my head around, I think a concrete example of a use case would help explain what it’s for as I wasn’t sure if it talked to an API or what the functionality was.

The best example I can think of is how Wikipedia is translated into multiple languages by its readers. Or how blogs sometimes allow people to contribute translations of articles.

Have I got that right?

TimisRobert commented 1 month ago

Yes, that would be it's use case.

What I want is to make the equivalent of Cldr Trans, but for the Ash framework. Since Ash does most of the heavy lifting, the extension is quite small actually.

I have added into the get started tutorial a full example using Phoenix, Ash and Cldr, if you have any more questions I will do my best to answer them!

WurmPeter commented 1 week ago

Hello @TimisRobert ,

Thanks for the library and that you added a tutorial. Sadly, I still couldn't figure it out completely...

I think I miss the following:

The show liveview from the end works with live "posts/:id", PostLive.Show, :index

Besides ash, ash_trans, ex_cldr also ex_cldr_locale_display has to be included in mix.exs (and then added to providers in cldr.ex).