简体   繁体   中英

Best strategy for localizing a mixed application: Razor, Angular, Typescript, .NET and database layer

Our application is a mix of:

  1. Front-end: Asp .NET with Razor pages (parent application), and some Angular Pages (displayed in an iFrame) along with typescript. Not fantastic, I know, but the intention is to slowly migrate the application pages to a SPA written in Angular
  2. Back end is .NET framework and .NET core
  3. SQL DB

All 3 layers above have a scattering of strings that are displayed across the application. We have a quick need to localize the application over the next couple of months essentially so that:

  1. A user with a supported localized language gets the localized version when accessed from the browser. ie German Chrome gets German version of the application.
  2. A user can change the language within the website.

All the above should happen dynamically (no separate language builds), meaning resources are loaded dynamically.

What are the best strategies around this? Some items I've considered:

  1. Use XLIFF as the base storage for the strings. This is a generic standard so tools can be run during build to generate.resx and other formats
  2. Use.resx and use a translation lib in javascript to access those strings (are there libs like this available). Or the reverse - use xliff and a .net lib to read that.
  3. Database - strings table with a language column and an API which figures out main and fallback languages.
  4. Other strategies, given all the above - we have to do in-place migrations and live with the above solution while we consolidate the various technologies in the application.

Is this something that you want to develop in house or are you considering a third-party translation management system? I hate to use this question as a forum to advertise my company but it does occur to me that the approach we take at Localize would work well in your situation.

The basics are that we have built a widget that parses out the final html and replaces the strings from one language to another based upon the user's locale and their language selection. This approach means that it doesn't matter which frameworks you use since we are only parsing the dom after it is generated (or modified in your SPA code).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM