Add language selection
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:
-
Check for Hardcoded Strings: Open the file and identify any hardcoded strings or overly complicated translations. Replace them with appropriate translation methods.
-
Model Attributes in Forms: Use
f.label :attr_namefor form labels. Add the translation underactiverecord.attributes.{modelname}.{attrname}in the YML file. -
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)orPerson.human_attribute_name(:person_roles). Refer to the documentation for more details. -
Link Text: For link texts, check if a link action helper can be used. Refer to the ActionsHelper documentation for guidance.
-
Errors https://stackoverflow.com/a/17935975
-
Other Translations: For other types of text, consider using lazy lookup translations or standard translation methods as outlined in the Rails I18n guide.
NOTES:
- [ ] Outsource trainee level slider in partial? (Potential external ticket)
The Language selector doesnt seem to persist the selected language. Everything else works