3 ms·
They've done exactly this with https://example-com.translate.goog https://example-com.translate.goog
by tombl 3y ago
They've done exactly this with https://example-com.translate.goog https://example-com.translate.goog
- jesprenj 3y agoYeah. Though they have a potential bug with domains that end in a dot. For example, my website translated with their service: https://splet-4a-si.translate.goog/?_x_tr_sch=http&_x_tr_sl=sl&_x_tr_tl=en&_x_tr_hl=sl&_x_tr_pto=wapp https://splet-4a-si.translate.goog/?_x_tr_sch=http&_x_tr_sl=... Clicking on the link "version control" leads to the page https://ni-xn----ijanec--9jb-eu-.translate.goog/?_x_tr_sch=http&_x_tr_sl=sl&_x_tr_tl=en&_x_tr_hl=sl&_x_tr_pto=wapp https://ni-xn----ijanec--9jb-eu-.translate.goog/?_x_tr_sch=h... (note the second label ending with -) and this page can't be reached according to google, but on the real site (http://splet.4a.si http://splet.4a.si), the link is valid: https://ni.šijanec.eu./ https://ni.xn--ijanec-9jb.eu/ Another pretty bad aspect of their domain handling (replacing dot with -) is that they can't support really long domains that exceed the length of a label. Secondly, this breaks punycode parsers and instead of "šijanec" as a label you get some garbled unreadable punycode. Label length problem: Website http://splet.sijanec.sijanec.sijanec.sijanec.sijanec.sijanec.sijanec.eu http://splet.sijanec.sijanec.sijanec.sijanec.sijanec.sijanec... cannot be unambiguously page-translated with their service. -- they remove the first s in the hostname, yielding: https://plet-sijanec-sijanec-sijanec-sijanec-sijanec-sijanec-sijanec-eu.translate.goog/?_x_tr_sch=http&_x_tr_hp=s&_x_tr_sl=sl&_x_tr_tl=en&_x_tr_hl=sl&_x_tr_pto=wapp https://plet-sijanec-sijanec-sijanec-sijanec-sijanec-sijanec... EDIT: they seem to add a get parameter _x_tr_hp=s, so this is probably how they work around the limitation. Nice! They could've done www.website.example.translate.goog, but that would add issues with TLS, since a wildcard subject alternative name only matches one label. But by getting a CA signed cert, limited to translate.goog (which is possible), they could just issue certs on the fly.
- gregable 3y agoThe amp version gets around the length by hashing the hostname if it's too long: https://amp.dev/documentation/guides-and-tutorials/learn/amp-caches-and-cors/amp-cache-urls https://amp.dev/documentation/guides-and-tutorials/learn/amp...