Replies: 1 comment
-
Been thinking about this some more. This is a proposal for steps to get there. Of course it's just one way to of it, and so maybe there are others approaches to the how. This layered approach in these 3 stages seems like the right way to approach adding these things into htmgo in a Long term plan.
https://www.hyperui.dev/components/application-ui/alerts is an example where the LTR / RTL is able to be toggled. Basically the idea is to have the LTR / RLT and lang detection built in to the htmgo at the framework level, so it can be leveraged. Once it is built in, then all current examples could take advantage of it too, as well as the Template. @maddalax I dont know the best way and where to do this in htmgo specifically, and I leave this one up to you to advise or help as time permits. A quick scan of https://github.com/search?q=repo%3Amarkmead%2Fhyperui%20LTR&type=code shows how its done and the cross over points to htmgo.
Because htmgo is a file based router, it has some cross over to Hugo perhaps. Hugo can be JSON or Markup driven, so we can also use JSON I think. I have used this this hugomods and its been really good as a high-level approach. https://github.com/hugomods/i18n-js provides a basis for this. https://hugomods.com/docs/i18n-js/ documents it usage. https://gohugo.io/content-management/multilingual goes into the config, that perhaps we can leverage.
Make it easy for developers to present things that are region and language specific like Dates, Date times, Currency, etc https://github.com/invopop/gobl has some helpers for this that I have used before. Each Stage of this immediately mades all the Examples better. Stage 1 makes them able to do Screen Layout as LTR / RLT, based on the detected language in the browser. Stage 2 makes it possible to then start to add content per region as JSON. Stage 3 takes it further and provides a way to convert Dates and Times and currency to the right layout and language. |
Beta Was this translation helpful? Give feedback.
-
I would love to see i18n and i10 using https://github.com/invopop/gobl
I use invopop to do auto translations as stage 1, and then checking by orgs / users as stage 2.
It handles all the edge cases of currency and location detection and then formatting.
Web GUI can then easily do LTR / RTL detections and google translate as you work.
htmgo is rich enough to integrate these things because of the way it can do introspection, and code gen.
Web Debug GUI that shows up in Dev mode so your can flip RTL, LTR, and Screen sizes is awesome too.
demo: https://zeon.studio/preview?project=hugoplate
https://github.com/zeon-studio/hugoplate
Beta Was this translation helpful? Give feedback.
All reactions