puzzle / skills

Open source skill management web application
GNU Affero General Public License v3.0
53 stars 17 forks source link

Add language selection #728

Open ManuelMoeri opened 2 months ago

ManuelMoeri commented 2 months ago

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:

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 commented 1 month ago

NOTES:

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