skills icon indicating copy to clipboard operation
skills copied to clipboard

Add language selection

Open ManuelMoeri opened this issue 1 year ago • 1 comments

Add the functionality to switch between languages. This also includes making sure that every string is correctly defined and translated for each language.

Talk with @Robin481 about the design. Maybe create a small mockup to show.

TODO:

  • Check the languages.yml files for any mistakes
  • Make sure both german and english are fully translated
  • Set the design
  • Implement the language selector
  • Make the language selector automagically detect the available languages and display all those options
  • Tests

Ⓜ️Ⓜ️

Workflow

To improve code readability and maintainability, follow these guidelines:

  1. Check for Hardcoded Strings: Open the file and identify any hardcoded strings or overly complicated translations. Replace them with appropriate translation methods.

  2. Model Attributes in Forms: Use f.label :attr_name for form labels. Add the translation under activerecord.attributes.{modelname}.{attrname} in the YML file.

  3. Model Attributes Outside Forms: For model attributes outside forms, use {model_instance}.human_attribute_name(:attr_name) or {ModelClass}.human_attribute_name(:attr_name). Example: @person.human_attribute_name(:person_roles) or Person.human_attribute_name(:person_roles). Refer to the documentation for more details.

  4. Link Text: For link texts, check if a link action helper can be used. Refer to the ActionsHelper documentation for guidance.

  5. Errors https://stackoverflow.com/a/17935975

  6. Other Translations: For other types of text, consider using lazy lookup translations or standard translation methods as outlined in the Rails I18n guide.

ManuelMoeri avatar Jun 12 '24 07:06 ManuelMoeri

NOTES:

  • [ ] Outsource trainee level slider in partial? (Potential external ticket)

The Language selector doesnt seem to persist the selected language. Everything else works

kcinay055679 avatar Jul 02 '24 09:07 kcinay055679