respec icon indicating copy to clipboard operation
respec copied to clipboard

Support translations in configuration

Open marcoscaceres opened this issue 4 years ago • 5 comments

Is your feature request related to a problem? Please describe. I'm always frustrated when I see:

          otherLinks: [
            {
              key: "Translations",
              data: [
                {
                  "value": "ру́сский язы́к",
                  "href": "http://topolyan.com/w3c/html_media_capture_ru.html"
                },
                {
                  "value": "한국어",
                  "href": "https://techhtml.github.io/html-media-capture/"
                },
                {
                  "value": "日本語",
                  "href": "http://www.asahi-net.or.jp/~ax2s-kmtn/internet/media/REC-html-media-capture-20180201.html"
                }
              ]
            }
          ]

Describe the solution you'd like A way to specify translations.... maybe:

 translations: {
   "jp": "https://...",
   "zh": "https://..."
}

marcoscaceres avatar May 27 '21 05:05 marcoscaceres

Should we look into adding <link hreflang> tags also? https://en.wikipedia.org/wiki/Hreflang

sidvishnoi avatar May 28 '21 21:05 sidvishnoi

Yes, good suggestion. I think iOS/Safari even suggests when translations are available, which is a nice touch.

marcoscaceres avatar May 29 '21 00:05 marcoscaceres

It should probably be a separate plugin then? Showing it in headers (alone it could be a template) + adding link tags (templates shouldn't have such side effects).

sidvishnoi avatar May 29 '21 06:05 sidvishnoi

Yeah, separate plugin would be fine.

marcoscaceres avatar May 31 '21 01:05 marcoscaceres

I wonder if <a rel="alternate" hreflang="${lang}" lang="${lang}"> would get us same effect.

sidvishnoi avatar May 31 '21 11:05 sidvishnoi