Site icon Gordarg Blog

Multi-language Support of Web Applications

Our PHP framework supports multi-language content. There are two groups of multi-language content: first, static labels, messages, paragraphs, etc; and second, are database content (e.g. products, posts, etc).

Static Content

With a built-in function t with a dictionary.csv file behind, end user (also including search engines and crawlers) are able to view web pages rendered in their preferred langauge.

https://blog.gordarg.com/wp-content/uploads/2023/11/Screencast-from-2023-11-23-17-20-57.webm

Function t('...') will iterate over the dictionary and return equivalent phrase in the desired language-region passed in the URI.

https://blog.gordarg.com/wp-content/uploads/2023/11/Screencast-from-2023-11-23-17-22-06.webm

Dynamic Content

The web server must follow some rules in database design and/or its returning schema, so the front-end will parse the results as expected.

Exit mobile version