A Duda site connects to Universally with one script tag in its site-wide Head HTML. The tag renders the language switcher and translates each page in the visitor's browser, so your URLs stay the same in every language and there is no DNS to change. JavaScript serving mode explains how the translation works and what it leaves out.
Before you start
- A Duda Team plan or higher. Custom code is available on Team plans and higher.
- The Owner or Admin role in your Universally workspace, to create the project and see its snippet. Editors see "Ask a project admin for this project's installation snippet." instead of the line.
- A published site on your own domain. The connection check only sees the published site.
Create the project
- Start a new project. Under Select Your Technology, pick Duda.
- Fill in Domain, the fully qualified domain your site is published on, such as
example.com. If the domain does not resolve yet, you see a warning, and you can still continue. - Fill in Project Name, check Source Language (English (US) by default), and click Next.
Duda projects have no serving mode to pick, so the next screen is Add the snippet. Language subdomains are not available for Duda sites yet: your site is translated by the snippet, on its own addresses.
Add the snippet
The Add the snippet step draws your line inside an example page. The dashboard fills in your project's key:
<script src="https://scripts.universally.com/p/YOUR_PUBLIC_KEY/s.js" async></script>
- Click Copy line. It copies only the script tag, and the button changes to Copied.
- In Duda, open More › Settings › Head HTML.
- Paste the line and save.
Use the site-wide Head HTML field so the script loads on every page. The Mark as complete buttons on the screen are stored in your browser and gate nothing.
Publish and check the connection
- Save the code, then Publish or Republish to the domain you entered in Universally. The connection check only sees the published site.
- Back in Universally, click Check connection.
The check loads your home page and looks for the line. Found it means the line is on your domain, it belongs to this project, and there is nothing else to install.
Nothing changes for your visitors yet. The line only loads the Universally file, and your site starts serving translations once you add languages in the next step.
Continue and I will do this later both move on to Add Languages, and nothing waits on the check. The line stays on the project's Setup page, under The line your site needs.
Add languages
- On Add Languages, answer "Which languages do you want to translate into?" with at least one target language.
- Click Finish. It stays disabled until the project has a language.
The language dialog still shows URL Format, but the value is unused on Duda because your URLs never change. Each language row on All Languages has a Live switch. See Add and remove languages.
Verify it worked
- Open your published site in a private window. A first-time visitor is matched to their browser language automatically, so a browser set to one of your target languages sees the page translated.
- Find the language switcher in the bottom-right corner, with flags and language names.
- Pick a language. The page reloads in it, at the same address.
To see how much of a page was translated, add ?uni_debug=1 to its URL and open the browser console.
If it does not work
- We loaded your domain but the line was not in the page: the code was not saved, or the site was not republished since. Republish and re-check. A cached copy on your host or CDN can also hide the line for a while, and the check only looks at your home page.
- That line belongs to a different project: another project's line is on the site. Replace it with the line on this project's Setup page, then check again.
- No switcher appears: the project has no live target language yet. Add one, or turn on its Live switch.
- The switcher shows but some text stays in the source language: the page is behind a login or a password, or JavaScript adds the text after the page loads. See JavaScript serving mode.
More cases are in Translations are not appearing and The switcher is not visible.