WhatsApp +60 11-5197 8879 Plan your route

How to structure a Bahasa Malaysia and English website so both are found

One address per language, hreflang with en-MY, ms-MY and x-default, a canonical that points to itself, no automatic redirect, and a full translation of every page. This site is the worked example.

Published
Reading time
6 min read
Author
Zahid AramaiFounder, KLCube Network

A Malaysian buyer may search in English, in Bahasa Malaysia, or in both on the same day. A site that serves both has two jobs: let each reader find the version in their language, and avoid making the second language a thin copy of the first. This article sets out the structure we use, with the rules taken from Google Search Central’s documentation and the W3C’s guidance on language tags. This site is the worked example: English at the root, Bahasa Malaysia under /ms, the same slug in both.

It describes a method, not a guarantee. We state no ranking effect, because none of the sources we read promises one.

1. Give each language its own address

Google’s documentation says: “Google recommends using different URLs for each language version of a page rather than using cookies or browser settings to adjust the content language on the page.”

The reason is practical. The same document warns that if you reroute or change content by language setting, Google might not find and crawl all your variations, because the crawler usually originates from the USA and sends requests without setting Accept-Language.

On this site:

English Bahasa Malaysia
https://klcube.net/services/seo-and-aeo https://klcube.net/ms/services/seo-and-aeo
https://klcube.net/pricing https://klcube.net/ms/pricing

The Bahasa Malaysia address is the English address with /ms in front. The slug after it stays in English, so the two pages are easy to match, to link and to maintain. Google notes it is fine to use localised words in a URL, as long as they are UTF-8 encoded and escaped properly. We keep English slugs for a different reason: one rule, no exceptions, nothing to look up.

2. Say which page is which with hreflang

Hreflang annotations tell Google that two pages are variants of the same content. The rules we follow, from the localized-versions documentation:

  • Each language version must list itself as well as all the other language versions.
  • Alternate URLs must be fully qualified, including https://, not /foo or //example.com/foo.
  • If two pages do not point to each other, the tags will be ignored.
  • Language codes use ISO 639-1, with an optional region in ISO 3166-1 Alpha 2.
  • A fallback page for unmatched languages is marked x-default.

Every page on this site carries three annotations in its head, here for the pricing page:

<link rel="alternate" hreflang="en-MY" href="https://klcube.net/pricing" />
<link rel="alternate" hreflang="ms-MY" href="https://klcube.net/ms/pricing" />
<link rel="alternate" hreflang="x-default" href="https://klcube.net/pricing" />

The Bahasa Malaysia page carries the same three lines. That is the self-reference and the return link in one.

Why en-MY and ms-MY rather than en and ms? Google’s documentation says you can specify a language code by itself and the region is optional. The W3C advises that “the golden rule is to keep your language tag as short as possible”, and to use a region subtag only if it contributes information needed in the context. Our choice of the Malaysian region is a decision about audience, not a requirement: both pages are written for readers in Malaysia, and the tags say so. If your site serves one language to many countries, the shorter tag may be the better choice.

The x-default entry points to the English page on this site. Google describes it as the fallback for users whose language settings do not match any version, designed for language selector pages. We use the English page because it is the one that has to work for any reader we cannot place.

3. Canonical to itself

A canonical tag tells Google which address of a page you prefer. Google’s guidance includes: “Do include a rel=“canonical” link on the canonical page itself (also known as a self-referential canonical).” For hreflang specifically: “If you’re using hreflang elements, make sure to specify a canonical page in the same language, or the best possible substitute language if a canonical page doesn’t exist for the same language.”

So each page declares itself as canonical. The Bahasa Malaysia page does not point its canonical at the English page, because that would tell Google the Bahasa Malaysia page is a duplicate to be folded away, and the hreflang would then contradict it.

4. Do not redirect by language

Google’s advice here is direct: “Avoid automatically redirecting users from one language version of a site to a different language version of a site. For example, don’t redirect based on what you think the user’s language may be. These redirections could prevent users (and search engines) from viewing all the versions of your site.”

Instead, it suggests adding links to the other language versions so that users can choose. This site has a language switch in the header that is an ordinary link to the same page in the other language. Nothing detects a browser setting and moves the reader. A visitor who lands on the English page and wants Bahasa Malaysia clicks once and arrives on the matching page, not on the home page of the other language.

5. Translate the whole page, not only the menu

Google’s localized-versions page lists a scenario for annotating alternates: you “keep the main content in a single language and translate only the template, such as the navigation and footer.” It also says: “Localized versions of a page are only considered duplicates if the main content of the page remains untranslated.”

Read together, the lesson is plain. A page whose menu is in Bahasa Malaysia and whose body is in English is not a Bahasa Malaysia page. The multi-regional documentation adds that translating only boilerplate while keeping the bulk of the content in one language “can create a bad user experience if the same content appears multiple times in search results with various boilerplate languages”. It also asks for a single language for content and navigation on each page, and for avoiding side-by-side translations.

For a build, that gives a checklist:

  • Every page that exists in English exists in Bahasa Malaysia, in the body, headings, buttons, form labels, error messages, image alt text and the page title and description.
  • If a page has not been translated, do not publish an empty Bahasa Malaysia copy. Leave it out of the hreflang set until it exists. Google notes you can omit some languages on some pages and the ones that point to each other are still processed.
  • Mark the page language in the HTML with the lang attribute. Google says it does not use lang or hreflang to detect language, since it uses algorithms on the visible content, but the attribute still tells browsers and assistive technology what language they are reading. The W3C notes that in HTML and XML documents a language tag is used to indicate the language of content.

6. A glossary and a register keep the second language from becoming a thin copy

This section is our practice, not a rule from a search engine. A second language written by different hands drifts: one page says “laman web”, another “tapak web”; one is formal, another chatty. We keep a glossary of the terms we use, with the Bahasa Malaysia form for each English term and a note on which terms stay in English (product names, standards and acronyms). We write in formal corporate Bahasa Malaysia, the register of a ministry or a government-linked company website, and we write each page as a Malaysian professional would, rather than translating sentence by sentence. Where people search in English for a term, the Bahasa Malaysia page may use that English term once as well.

That is what stops the second language being a thin copy: the same facts and figures, written in the language, with the same terms in every page.

A short checklist

  1. One address per language, same slug pattern, no cookie or header switching.
  2. Hreflang on every page: itself, the other language, and x-default, using fully qualified URLs, and return links on both pages.
  3. A canonical on each page that points to itself.
  4. No automatic redirect by language, and a visible link to switch.
  5. Every page fully translated, or left out of the pair until it is.
  6. A glossary and a register, applied to every page.

If you are planning a bilingual site and want it specified this way from the start, send us a brief.

All insights

Sources

Outside rules and figures in this article come from these pages. KLCube’s own facts come from klcube.net.

  1. Google Search Central: Managing multi-regional and multilingual siteshttps://developers.google.com/search/docs/specialty/international/managing-multi-regional-sites
  2. Google Search Central: Tell Google about localized versions of your pagehttps://developers.google.com/search/docs/specialty/international/localized-versions
  3. Google Search Central: How to specify a canonical with rel="canonical" and other methodshttps://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls
  4. W3C: Choosing a language taghttps://www.w3.org/International/questions/qa-choosing-language-tags

Start with a brief.

Tell us what you need built, for whom and by when. A paragraph is enough to begin.

What happens next

  1. You send a brief, or a message on WhatsApp.
  2. We reply within 8 working hours with questions or a time to talk.
  3. You receive a written proposal with scope, milestones and price. It is valid for 30 days.
WhatsApp Start a brief