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 internationalisation support #98

Closed

Conversation

wgresshoff
Copy link
Contributor

❤️ Thank you for your contribution!

Description

Add internationalisation support. By adding a lang column and extendig the unique constraint the goal is achieved. This feature is available in the Administration interface as well.

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Frontend

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

@wgresshoff
Copy link
Contributor Author

@wgresshoff wgresshoff requested review from slint and tmorrell February 13, 2025 10:31
Copy link
Member

@slint slint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, some minor decisions and concern about use of server_default vs. default for the field definition

@@ -36,6 +37,9 @@ class PageModel(db.Model, Timestamp):
title = db.Column(db.String(200), nullable=False, default="")
"""Page title."""

lang = db.Column(db.String(2), nullable=False, default="en")
Copy link
Member

@slint slint Feb 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor/question: (probably I18N/L10N experts can jump in) is this the best format to store the language? E.g. could en-US or similar be better and map to the overall translations process? This would affect the string size, i.e. 2 vs. 5 (or even higher?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not an expert but this is the information the UI provides?! This follows the settings in I18N_LANGUAGES.

…hanges.

This makes the alembic tests run, too!
@slint
Copy link
Member

slint commented Mar 26, 2025

Merged with using server_default for the new lang field in #99.

@slint slint closed this Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Discarded
Development

Successfully merging this pull request may close these issues.

3 participants