Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add language selection #728

Open
ManuelMoeri opened this issue Jun 12, 2024 · 1 comment
Open

Add language selection #728

ManuelMoeri opened this issue Jun 12, 2024 · 1 comment
Assignees
Labels
plan needs to be planned

Comments

@ManuelMoeri
Copy link
Collaborator

ManuelMoeri commented Jun 12, 2024

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.

@kcinay055679
Copy link
Collaborator

kcinay055679 commented Jul 2, 2024

NOTES:

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plan needs to be planned
Projects
None yet
Development

No branches or pull requests

3 participants