© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
5 replies
alkasel#159

✅ Software architecture for front-end translations

I've an .NET 7 Blazor WebAssembly Hosted web application meant to be deployed in a industrial environment local network and to be used by as few as 5 users simultaneously.

Since at the factory there can be workers speaking different languages, and since we can connect via VPN for maintenance, I need to include a translation mechanism, which should involve all the front-end writings.

As of now I've setup some .cs files containing constants fields representing symbols. Example:
public string CAMERA_CONNECTION_LOST = "camera_connection_lost"
public string CAMERA_CONNECTION_LOST = "camera_connection_lost"


Then, in the database I'll have a "transl" table structured like this
--------------------------------------------------------
| symbol                   | lang  | translation       |
--------------------------------------------------------
| camera_connection_lost   | en_us | Connection lost   |
| camera_connection_lost   | it_it | Connessione persa |
--------------------------------------------------------
| symbol                   | lang  | translation       |
--------------------------------------------------------
| camera_connection_lost   | en_us | Connection lost   |
| camera_connection_lost   | it_it | Connessione persa |


And so on.
When an use launch the blazor application, blazor could
1) Retrieve from back-end translations for all the symbols defined in the web application (larger loading time at startup, larger memory usage, lower latency when navigating to another page of the application since no need to request translation for that specific page)
2) Retrieve from back-end translations for the symbols of a given page (maybe I should have a "page" table (representing a Blazor page) and an M-to-M relationship between pages and symbols.

What do you think of this approach?

What bothers me of this approach is to have the symbols hard-coded in the program. I'm not sure if that's acceptable or not.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

JWT in front-end
C#CC# / help
10mo ago
✅ Question about front-end frameworks
C#CC# / help
6mo ago
c# API + angular front end
C#CC# / help
11mo ago
✅ Adding an autonomous react front-end to a preexisting back-end
C#CC# / help
9mo ago