ever-co / ever-gauzy

Ever® Gauzy™ - Open Business Management Platform (ERP/CRM/HRM/ATS/PM) - https://gauzy.co
https://gauzy.co
GNU Affero General Public License v3.0
2.24k stars 528 forks source link

Feature: Enhance i18 & support backend translations #1014

Closed rmagon closed 4 years ago

rmagon commented 4 years ago

Currently, translations are only being done in the frontend and at the runtime. Preferred language is not stored for a user and we always use the language of the browser. Error messages, emails are also not translated. As part of this ticket we need to do the following:

  1. Store preferred language of the user in the database
  2. Maintain the preferred language of the user in the frontend
  3. With every request, send the language to the API as well. If the user has not selected the preferred language, then send the browser's language code. This should perhaps be done as a header.
  4. Add a dependency to a nodejs i18 module, perhaps https://github.com/mashpie/i18n-node ?
  5. See if we can use the same language files for both frontend and backend? ( @evereq Not sure if it can be done easily and error-free, if not we can initially just use different translation files for front-end and back-end perhaps ?)
  6. Translate a few error messages and test them according to the chosen language by the user

This is part of the Epic #63

evereq commented 4 years ago

@rmagon For 4), I would research a bit about translations + NestJS For 5), think for now it's fine to go with separate translation files for front-end and for backend (in fact, I would actually prefer that). Just take a note that we will need to configure crowdin to use also backend JSON files, the same way we are doing it for the front-end.

rmagon commented 4 years ago

@evereq So NestJS in itself does not support any i18n as mentioned here https://github.com/nestjs/nest/issues/4486

I'm looking at a community package now https://github.com/ToonvanStrijp/nestjs-i18n though it's relatively new, looks promising, but I'll play around a little and get back.

camsil15 commented 1 year ago

Hello all, hope you are fine.

Can you please add support for French (FR) language? I can help with the translations.

Thanks.

evereq commented 1 year ago

@camsil15 thank you for the request, I created https://github.com/ever-co/ever-gauzy/issues/6571, we will have @adkif to add initial support and let you know when you can add all translations and how, etc.

evereq commented 1 year ago

@camsil15 please see https://github.com/ever-co/ever-gauzy/pull/6579#issuecomment-1646559090