Menu

Arabic and English in one Angular app: direction, fonts and numbers
📰

Arabic and English in one Angular app: direction, fonts and numbers

DEV Community: dotnet·Anas Amin·3 days ago
#6Trnyb4X
#devtodotnet#devto#dev#arabic#language
Reading 0:00
15s threshold

Translating the strings is the easy part. The hard part is everything around them: a page that flips before its words arrive, arrows that point the wrong way, a Hijri date nobody asked for, a page range that reads backwards. This is what three systems running in Arabic and English today taught me.

The language goes in the URL, not the browser

On public pages, make the language part of the address: /ar/... and /en/.... The URL is the single source of truth. Search engines see two separate pages, a shared link opens in its own language, and the language toggle takes you to the same page in the other language without jumping to the top.

An unknown prefix redirects to the default language, and so does the bare home page. Keep localStorage for the admin and sign-in pages that search engines never need.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.